Getting YouTube livestream URL

我只是一个虾纸丫 提交于 2019-12-09 23:05:59

问题


I need a way to get the URLs of a YouTube live stream, ideally URLs for each quality (i.e. 240p, 360p).

What I tried so far:

  1. Use Wireshark (Don't know how to apply proper filters)
  2. Use urlsnoopers (Couldn't find anything that works in Linux)
  3. Get the m3u8 URL from the page source (Couldn't control quality)
  4. Use Firefox developer tools to analyze the network (Would not get the m3u8 URL for some links)

On another note I noticed that some of the lower quality stream URL links seem to get stuck after a few seconds. Any idea why?


回答1:


There's a Python tool called livestreamer that gets the job done.

Steps:

  1. Install python-pip (Python module management tool):

    yum install python-pip 
    
  2. Add the livestreamer module:

    sudo pip install livestreamer
    
  3. Play the video with the --stream-url option:

    livestreamer https://www.youtube.com/watch?v=eWRei_9cEO8 240p --stream-url
    


来源:https://stackoverflow.com/questions/25563055/getting-youtube-livestream-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!