Greetings fellow video download enthusiasts. I have been using HDSdump.exe recently and have created a few batch files to automate things a bit. Just thought I would share these to see if they might be of any use to anyone and see if any actual programmers might be able to improve on them.
I am in Canada and have only tested them on a couple of sites such as cbc.ca and thecomedynetwork.ca, but they should work on any site that uses unencrypted .f4m manifest files.
CBC uses an unencrypted stream spliced into .f4v files referenced by an .f4m manifest file which is easily revealed by the HDS.Link.Detector Firefox Plugin.
However, with Thecomedynetwork site, The link detector doesn't work since it only captures the first .f4m link out of a possible 9. The first link does not contain the proper information, but the next 8 links will work fine with HDSdump and each link represents a resolution/quality setting. To find the links, I just use the firefox console (press f12) and enter .f4m in the filter box on the right.
Once I see the list of links, I further filter it down to one link according to the desired quality. For example, to get the best quality link, I would type "8.mp4.f4m". Each video is further spliced into multiple segments corresponding to the commercial breaks. To get the full list of .f4m url's, I just drag the video seek button onto each segment briefly until the .f4m link appears, then pause the video on the last segment.
Now you can "select all" and select "copy url" (right-click context). The url's need to each be on a separate line and sometimes windows or firefox copies them all to one line, so paste into a text editor to verify. You can also use URLsnooper to get the links as well.
In order to make things easy and universal, my batch file just takes the list of url's or single url directly from the clipboard and puts them into a temp file which is processed and deleted. I use a modified version of the HDS.Link.Detector that only captures the url to get the single .f4m file links on CBC.ca. Then the links are processed in the batch file using HDSdump.exe, but it should be trivial to modify it to use the Adobe.HDS.php script.
To make it all work, you need HDSdump.exe, ffmpeg, and a tiny exe file called paste.exe which is needed to paste the clipboard contents into a temp file.
https://github.com/WendyH/hdsdump/releases
http://www.c3scripts.com/tutorials/msdos/paste.html
http://ffmpeg.zeranoe.com/builds/
ffmpeg is used to stitch or join the flv segments from multi-segment sites like thecomedynetwork.ca and also remux the files to MP4. Remuxing is much quicker than re-encoding and the result should be playable on most devices that can handle mp4 h.264 video.
The batch file tries to capture a unique filename from the url using some "delimited FOR loops" but it may not be perfect for every site. You will likely have to edit the filename once the download is done.
So here is the batch file for handling the multi-part videos which also works for single part videos as well:
Download.HDS.Video.bat
Code:
@echo off
setlocal enableextensions enabledelayedexpansion
SET TEMPFILE=%DATE:~-4%%DATE:~4,2%%DATE:~7,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
paste > %TEMPFILE%.tmp
set /p firstline=<%TEMPFILE%.tmp
for /f "tokens=1 delims=? " %%a in ("!firstline!") do (set TITLE=%%a)
for /f "tokens=1 delims=, " %%a in ("!TITLE!") do (SET TITLE=%%~nxa)
for /f "tokens=1-4 delims=- " %%b in ("!TITLE!") do (SET MP4TITLE=%%b_%%c_%%d_%%e)
rem echo %MP4TITLE%
SET /A COUNT=0
for /f "tokens=*" %%a in (%TEMPFILE%.tmp) do (SET /A COUNT+=1
hdsdump -m "%%a" -o %MP4TITLE%!COUNT!.flv
echo file %MP4TITLE%!COUNT!.flv>>Filelist.%TEMPFILE%.tmp)
del %TEMPFILE%.tmp
echo "Download Complete. Files will now be joined"
Pause
ffmpeg -f concat -i Filelist.%TEMPFILE%.tmp -c copy -copyts %MP4TITLE%.mp4
del Filelist.%TEMPFILE%.tmp
echo "All finished. Temp FLV files will now be deleted"
pause
del %MP4TITLE%*.flv
timeout /T 3
I will also post an earlier version that works for a singlle url, and one that works for .M3U8 playlist files.