pantiweara / get-flash-videos

Automatically exported from code.google.com/p/get-flash-videos
0 stars 0 forks source link

Videos cannot be downloaded from discovery.com #447

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to download a video (e.g. Gold Rush) from dsc.discovery.com
2. get_flash_videos reverts to a 'generic' method
3. No video is downloaded

What is the expected output? What do you see instead?

The video should be downloaded.

What version of the product are you using? On what operating system?

git master, commit 1538eeae6e6e3c2d7a3689bf4c0431d45759e1f0

Please provide any additional information below.

Normally I would write a patch for something like this, but I don't have time 
right now.  In the meantime, it is relatively easy to script the downloads in 
bash and join the segments by hand.  The files are unencrypted and the URLs can 
be easily extracted from the HTML, so I'm providing instructions below.

Download the following Discovery.com show page:

http://dsc.discovery.com/tv-shows/gold-rush/videos/the-long-road.htm

There will be some JSON which includes a list of clips.  The '"m3u8": ' items 
are the interesting bits.  These might be multiple short 1-2 minute clips, and 
there will be one much longer clip (~42 minutes).  In the above case:

http://discidevflash-f.akamaihd.net/i/digmed/hdnet/35/f8/02652500201001_GR_Long_
Road-,400k,110k,200k,600k,800k,1500k,3500k,.mp4.csmil/master.m3u8

is the one we're interested in.  Downloading the referenced file, we get a text 
file with several lines like this:

....
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3560000,RESOLUTION=1280x720,CODECS="avc
1.77.30, mp4a.40.5"
index_6_av.m3u8?e=b471643725c47acd
....

Concatenate the base of the above URL with the a requested playlist to get (in 
this case the HD stream):

http://discidevflash-f.akamaihd.net/i/digmed/hdnet/35/f8/02652500201001_GR_Long_
Road-,400k,110k,200k,600k,800k,1500k,3500k,.mp4.csmil/index_6_av.m3u8?e=b4716437
25c47acd

Downloading this file, we finally get the playlist:

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-ALLOW-CACHE:YES
#EXT-X-VERSION:2
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:10,
segment1_6_av.ts?e=b471643725c47acd
#EXTINF:10,
segment2_6_av.ts?e=b471643725c47acd
#EXTINF:10,
...
etc

In the case of the above HD stream, each segment will be about 4-5 megabytes 
and there could be upwards of 250 of them.  These segments are parts of an mpeg 
transport stream, and seem to be safe to blindly concatenate.  They are 
identified by ffmpeg as follows:

Input #0, mpegts, from 'ts/segment99_6_av.ts?e=b471643725c47acd':
  Duration: 00:00:10.01, start: 980.113000, bitrate: 3623 kb/s
  Program 1
    Stream #0.0[0x100]: Video: h264 (Main), yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 32.11 fps, 1k tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x101]: Audio: aac, 44100 Hz, stereo, s16, 63 kb/s

Original issue reported on code.google.com by akih...@gmail.com on 2 Nov 2012 at 1:50