Skip to content
K-S-V edited this page Jan 29, 2013 · 35 revisions

AdobeHDS is a php script to join HDS fragments into flv file. you can either use manifest switch or use any download manager with batch capabilities to download the fragments though use of manifest switch is recommended.

php AdobeHDS.php --manifest "your_manifest_url" --delete

Offline fragment processing:

if you fragments are serially numbered without a base filename (1.f4f, 2.f4f.......99.f4f) then you can run the script without any parameter and it will look for the fragments in current directory and output will be saved as Joined.flv.

However if your fragments are named with base filename (MyVideo-Seg1-Frag1.f4f, MyVideo-Seg1-Frag2.f4f.........MyVideo-Seg1-Frag99.f4f) then you can pass the base filename with fragments switch to the script and it will look for the fragments starting with this name and output will be saved as MyVideo-Seg1-Frag.flv. f4f extension is optional.

1.f4f, 2.f4f.......99.f4f

php AdobeHDS.php

MyVideo-Seg1-Frag1.f4f, MyVideo-Seg1-Frag2.f4f.........MyVideo-Seg1-Frag99.f4f

php AdobeHDS.php --fragments MyVideo-Seg1-Frag

or

php AdobeHDS.php MyVideo-Seg1-Frag

Usage:

You can use script with following switches:

 --help              displays this help
 --debug             show debug output
 --delete            delete fragments after processing
 --fproxy            force proxy for downloading of fragments
 --play              dump stream to stdout for piping to media player
 --rename            rename fragments sequentially before processing
 --update            update the script to current git version
 --auth      [param] authentication string for fragment requests
 --duration  [param] stop recording after specified number of seconds
 --filesize  [param] split output file in chunks of specified size (MB)
 --fragments [param] base filename for fragments
 --manifest  [param] manifest file for downloading of fragments
 --outdir    [param] destination folder for output file
 --outfile   [param] filename to use for output file
 --parallel  [param] number of fragments to download simultaneously
 --proxy     [param] proxy for downloading of manifest
 --quality   [param] selected quality level (low|medium|high) or exact bitrate
 --referrer  [param] Referer to use for emulation of browser requests
 --start     [param] start from specified fragment
 --useragent [param] User-Agent to use for emulation of browser requests

Proper switch usage:

  1. Grabbing the manifest and auth parameter with Firefox
HDS Link Detector Add-on

i have also written a pretty basic [Firefox add-on] (http://www.mediafire.com/file/7e04vvxocstr452/hds-link-detector.xpi) to auto-detect HDS link and generate proper command line which you can simply paste in command prompt. whenever a link is detected it shows a notification which remains visible for few seconds. clicking on this notification will copy the generated command to clipboard. i have tested it with pluzz.fr, fora.tv, nrk.no and few other sites and it seems to work pretty well. though i have no intention to work on it any further it still serves as a good cross-platform helper tool to easily grab HDS videos. drag drop [this xpi file] (http://www.mediafire.com/file/7e04vvxocstr452/hds-link-detector.xpi) on Firefox to install it. it will show up in add-on bar (Ctrl + /). clicking the icon will enable or disable the link detection.

Manual method

Press Ctrl+Shift+K to open the inbuilt web console. type .f4m in search filter to grab the manifest url.

http://some.website.com/video/manifest.f4m?foobar

To grab auth parameter use Seg as search filter and copy only the request parameters.

http://some.website.com/video/Seg1-Frag1?foobar

here foobar can be passed to auth switch.

  1. Play

You can use the play switch to directly pipe the output of script to video player of your choice.

  • php AdobeHDS.php --manifest "manifest_url" --play | mplayer -cache 2048 -
  • php AdobeHDS.php --manifest "manifest_url" --play | vlc --file-caching=10000 -
  1. Proxy

You can pass the proxy parameter in any of the following formats:

  • http://1.2.3.4:1234 or 1.2.3.4:1234
  • socks4://1.2.3.4:1234
  • socks5://1.2.3.4:1234
  1. Useragent

useragent switch is normally used along with auth parameter. you must use the User-Agent string of the same browser from which you have copied the auth string.

Installing PHP for dummies:

  1. Download PHP 5.4 and extract it to C:\PHP folder.

  2. Download PHP.ini and copy it to the same folder.

  3. Right click on "My Computer" and go to Properties->Advanced->Environment Variables and add following string to the end of Path Variable.

;C:\PHP
  1. Open cmd prompt and type php -v. if you have done above steps correctly then you will see something like following.
PHP 5.4.11 (cli) (built: Jan 16 2013 20:26:43)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Clone this wiki locally