Revision of How to download HTTP Dynamic Streaming video using Livestreamer and UnPlug from Mon, 01/27/2014 - 07:00

The revisions let you track differences between multiple versions of a post.

Many websites now provide video using Adobe's HTTP Dynamic Streaming. Some videos delivered using this method can be viewed and downloaded by using Livestreamer and UnPlug without running non-free JavaScript.

First install the add-on UnPlug:

https://addons.mozilla.org/en-US/firefox/addon/unplug/

Then install livestreamer using pip:

sudo aptitude install python-pip
sudo pip install livestreamer

Here is an example of a website offering video using HTTP Dynamic Streaming:

http://news.walla.co.il/mahadura/?w=//2715352

By clicking the UnPlug icon the following link is offered but cannot be downloaded using the browser:

http://cache02.mintmark.co.il:1935/redirector/mediacache/_definst_/mp4:http/media_iphone/016/172/1617283-42.mp4

Now copy this link to the browser and insert "view-source:" before it:

view-source:http://cache02.mintmark.co.il:1935/redirector/mediacache/_definst_/mp4:http/media_iphone/016/172/1617283-42.mp4

Now more links are offered. Copy the one you want into the browser and add "view-source:" again:

view-source:http://199.203.85.3:1935/mediacache/_definst_/mp4:http/media_iphone/016/172/1617283-42.mp4/chunklist.m3u8?wowzasessionid=273365045

Now we are offered this link followed by a list of media.ts files so this is the final link:

https://stream01.wcdn.co.il/mediacache/_definst_/mp4:http/media_iphone/016/172/1617283-42.mp4/key.m3u8key?wowzasessionid=273365045

Now remove the final part (that starts with "key"), replace it by "manifest.f4m" and add "hds://" to the beginning of the url and feed it to livestreamer:

livestreamer hds://https://stream01.wcdn.co.il/mediacache/_definst_/mp4:http/media_iphone/016/172/1617283-42.mp4/manifest.f4m

Now you will see the following output:

[cli][info] Found matching plugin stream for URL hds://https://stream01.wcdn.co.il/mediacache/_definst_/mp4:http/media_iphone/016/172/1617283-42.mp4/manifest.f4m
Available streams: 234p (worst, best)

Now select the quality (e.g. "best") and download using "-o filename":

livestreamer hds://https://stream01.wcdn.co.il/mediacache/_definst_/mp4:http/media_iphone/016/172/1617283-42.mp4/manifest.f4m best -o out.mp4

You will see that livestreamer is downloading the file:

[cli][info] Found matching plugin stream for URL hds://https://stream01.wcdn.co.il/mediacache/_definst_/mp4:http/media_iphone/016/172/1617283-42.mp4/manifest.f4m
[cli][info] Opening stream: 234p
Written 5661062 bytes[cli][error] Error when reading from stream: Read timeout

[cli][info] Stream ended

Now you can view the video using your favorite video player such as Totem, VLC or MPlayer. If you just want to view the stream without downloading it simply run the last command without the "-o" part:

livestreamer hds://https://stream01.wcdn.co.il/mediacache/_definst_/mp4:http/media_iphone/016/172/1617283-42.mp4/manifest.f4m best

The default player used is VLC. In order to use MPlayer instead create a file "~/.livestreamerrc" and paste into it:

player=mplayer -cache 2048

Revisions

01/26/2014 - 17:50
aloniv
09/21/2024 - 14:49
knife