I would like to get a live m3u8 file rather than a DVR m3u8 as the latter contains too many segments (4 hours) and is slow and not convenient to download and process.
For example, the sky news live channel
www.youtube.com/watch?v=y60wDzZt8yg
What I have done:
Changing user-agent string to iPad or visiting
www.youtube.com/get_video_info?&video_id=y60wDzZt8yg
I could get something like
manifest.googlevideo.com/api/manifest/hls_variant/playlist_type/DVR/signature/11D1EE619ACDCA91661CB6F42597F96F0C86CC1F.742A7B383F4B10A099B1C7AAEF1E15DCD2F160C6/ipbits/0/fexp/9416126%2C9420452%2C9422596%2C9423459%2C9423661%2C9423662/source/yt_live_broadcast/id/y60wDzZt8yg.2/sver/3/key/yt6/upn/0y8ab4RaX_U/expire/1454380402/sparams/gcr%2Cid%2Cip%2Cipbits%2Citag%2Cmaudio%2Cplaylist_type%2Cpmbypass%2Csource%2Cexpire/ip/86.172.63.152/itag/0/pmbypass/yes/maudio/1/gcr/gb/file/index.m3u8
which contains sub-m3u8 files of multiple resolutions.
When opening this 720p sub-m3u8 file
manifest.googlevideo.com/api/manifest/hls_playlist/id/y60wDzZt8yg.2/itag/95/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/gir/yes/dg_shard/eTYwd0R6WnQ4eWcuMg.95/hls_chunk_host/r7---sn-cu-n1qe.googlevideo.com/playlist_type/DVR/pmbypass/yes/gcr/gb/mm/32/mn/sn-cu-n1qe/ms/lv/mv/u/pcm2cms/yes/pl/24/dover/3/fexp/9416126,9420452,9422596,9423459,9423661,9423662/sver/3/upn/0y8ab4RaX_U/mt/1454358580/ip/86.172.63.152/ipbits/0/expire/1454380402/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,gir,dg_shard,hls_chunk_host,playlist_type,pmbypass,gcr,mm,mn,ms,mv,pcm2cms,pl/signature/86FCD06C0400556C7F94B21019707B2501F98308.659A34C0F8A2DC70CC8DC411CD5D723C55146DD3/key/dg_yt0/playlist/index.m3u8
It contains the ts segments of recent 4 hours and it is so slow to process and do further things. I have found if I add the query string
?start_seq=344610
to the above link, I could get a much shorter m3u8 file which starts with this particular sequence. However, the number of sequences in the file will increase with time unless the start_seq parameter is increased at the same time.
In contrast, for a live stream without playback enabled by the channel provider, YouTube will automatically return a live m3u8 file which contains only several sequences of less than one minute. The most noticeable difference of the link is
playlist_type/LIVE
rather than
playlist_type/DVR
I am wondering if I could get a LIVE m3u8 file for those YouTube live streams whose providers allow playback? Maybe there are some parameters similar to the "start_seq=XXX"? Or there is some API which can return live m3u8 links directly? Thank you very much.