View Single Post
  #8  
Old 03-28-2014, 08:31 PM
magichandz magichandz is offline
Junior Member
 
Join Date: Mar 2013
Posts: 21
magichandz is on a distinguished road
Default

Re: Download encrypted YouTube livestreams


lesor has it right. just get the m3u8 out of the page source the only problem i've run into is after about an hour or so the stream will disconnect and i have to start over. the same m3u8 will work but i get the same disconnect. i think i'll have to write a script that starts downloading the stream over again if it stops.

or i'll just hope that he download doesn't get interrupted.

Code:
ffmpeg -i "http://www.youtube.com/api/manifest/hls_playlist/id/MF0UNmHzu5Y.1/itag/95/source/yt_live_broadcast/ratebypass/yes/live/1/cmbypass/yes/newshard/yes/gir/yes/dg_shard/MF0UNmHzu5Y.1_95/hls_chunk_host/www.youtube.com/maudio/1/pmbypass/yes/playlist_type/LIVE/gcr/us/fexp/906373,931946,938647,914089,937417,913434,936910,936913,934022/sver/3/upn/ijUA-7cc8gI/ip/{my-ip}/ipbits/0/expire/1396073058/sparams/ip,ipbits,expire,id,itag,source,ratebypass,live,cmbypass,newshard,gir,dg_shard,hls_chunk_host,maudio,pmbypass,playlist_type,gcr/signature/14C8FBE4DEB9D29DB85FC0AE6A552445526A13B8.8F86EAC0860F4D4591799128175A839A572793DB/key/dg_yt0/file/index.m3u8" -c copy ultra02.ts
ffmpeg version 2.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Mar 25 2014 08:36:03 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --enable-vda --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libavresample   1.  2.  0 /  1.  2.  0
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
[hls,applehttp @ 0x7fd0d5000600] Estimating duration from bitrate, this may be inaccurate
Input #0, hls,applehttp, from 'http://www.youtube.com/api/manifest/hls_playlist/id/MF0UNmHzu5Y.1/itag/95/source/yt_live_broadcast/ratebypass/yes/live/1/cmbypass/yes/newshard/yes/gir/yes/dg_shard/MF0UNmHzu5Y.1_95/hls_chunk_host/www.youtube.com/maudio/1/pmbypass/yes/playlist_type/LIVE/gcr/us/fexp/906373,931946,938647,914089,937417,913434,936910,936913,934022/sver/3/upn/ijUA-7cc8gI/ip/{my-ip}/ipbits/0/expire/1396073058/sparams/ip,ipbits,expire,id,itag,source,ratebypass,live,cmbypass,newshard,gir,dg_shard,hls_chunk_host,maudio,pmbypass,playlist_type,gcr/signature/14C8FBE4DEB9D29DB85FC0AE6A552445526A13B8.8F86EAC0860F4D4591799128175A839A572793DB/key/dg_yt0/file/index.m3u8':
  Duration: 00:00:00.12, start: 1815.000000, bitrate: 233 kb/s
  Program 0 
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 256 kb/s
Output #0, mpegts, to 'ultra02.ts':
  Metadata:
    encoder         : Lavf55.33.100
    Stream #0:0: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 90k tbn, 25 tbc
    Stream #0:1: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, 256 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[tcp @ 0x7fd0d3e05760] Failed to resolve hostname www.youtube.com: nodename nor servname provided, or not known
[tcp @ 0x7fd0d3c00f20] Failed to resolve hostname www.youtube.com: nodename nor servname provided, or not known
frame=49250 fps= 25 q=-1.0 Lsize=  644339kB time=00:32:50.01 bitrate=2679.4kbits/s    
video:528667kB audio:61563kB subtitle:0 data:0 global headers:0kB muxing overhead 9.167596%

$ ffmpeg -i "http://www.youtube.com/api/manifest/hls_playlist/id/MF0UNmHzu5Y.1/itag/95/source/yt_live_broadcast/ratebypass/yes/live/1/cmbypass/yes/newshard/yes/gir/yes/dg_shard/MF0UNmHzu5Y.1_95/hls_chunk_host/www.youtube.com/maudio/1/pmbypass/yes/playlist_type/LIVE/gcr/us/fexp/906373,931946,938647,914089,937417,913434,936910,936913,934022/sver/3/upn/ijUA-7cc8gI/ip/{my-ip}/ipbits/0/expire/1396073058/sparams/ip,ipbits,expire,id,itag,source,ratebypass,live,cmbypass,newshard,gir,dg_shard,hls_chunk_host,maudio,pmbypass,playlist_type,gcr/signature/14C8FBE4DEB9D29DB85FC0AE6A552445526A13B8.8F86EAC0860F4D4591799128175A839A572793DB/key/dg_yt0/file/index.m3u8" -c copy ultra03.ts
ffmpeg version 2.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Mar 25 2014 08:36:03 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --enable-vda --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libavresample   1.  2.  0 /  1.  2.  0
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
[hls,applehttp @ 0x7f900381b400] Estimating duration from bitrate, this may be inaccurate
Input #0, hls,applehttp, from 'http://www.youtube.com/api/manifest/hls_playlist/id/MF0UNmHzu5Y.1/itag/95/source/yt_live_broadcast/ratebypass/yes/live/1/cmbypass/yes/newshard/yes/gir/yes/dg_shard/MF0UNmHzu5Y.1_95/hls_chunk_host/www.youtube.com/maudio/1/pmbypass/yes/playlist_type/LIVE/gcr/us/fexp/906373,931946,938647,914089,937417,913434,936910,936913,934022/sver/3/upn/ijUA-7cc8gI/ip/{my-ip}/ipbits/0/expire/1396073058/sparams/ip,ipbits,expire,id,itag,source,ratebypass,live,cmbypass,newshard,gir,dg_shard,hls_chunk_host,maudio,pmbypass,playlist_type,gcr/signature/14C8FBE4DEB9D29DB85FC0AE6A552445526A13B8.8F86EAC0860F4D4591799128175A839A572793DB/key/dg_yt0/file/index.m3u8':
  Duration: 00:00:00.13, start: 4120.000000, bitrate: 225 kb/s
  Program 0 
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 251 kb/s
Output #0, mpegts, to 'ultra03.ts':
  Metadata:
    encoder         : Lavf55.33.100
    Stream #0:0: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 90k tbn, 25 tbc
    Stream #0:1: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, 251 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=20179 fps= 25 q=-1.0 size=  264446kB time=00:13:27.16 bitrate=2683.9kbits/s
Reply With Quote