Is there any way to automatically extract the video source of the live streaming website?

Source: Internet
Author: User

netizen Question:Is there any way to automatically extract the video source of the live streaming website?

Usually like watching Dota2 game Live,
But the fighting fish and the fire cat's viewing experience is really bad,
I hate the barrage,
The page interacts with the dregs of the Earth,
The horrible effects of various brushes are not yet blocked,
The whole urban and rural combination of Dragon City crazy Bully Feeling,
I just want to see Twitch as quiet, undisturbed.
Of course, flash caused by the huge calorific value is also an important factor,
Then I found out that the network of Chrome F12 was able to see the video source address directly,
is usually an FLV followed by a large string of parameters,
This address can be played directly with a video player,
Like the potplayer I used,
So here's the question,
Is there a way to automate the acquisition of this address?
Every time you open a F12 in the list a lot of resources to find tired ~ ~
I think this is a very market demand ah,
How can nobody make a chrome plugin?

The barrage can be closed I know, but the gift effect on the flash is not closed, I just want to watch the game the first time, and so on Youku can see all over the past 2-3 days ~

Enthusiastic Netizen reply:

Before watching live broadcast every day, use this to get RMTP address after using Potplayer play. Many recommended streaming media system software on the Internet, thank you all.

Import OS
Import Urllib2
Import JSON
Import MD5
Import time



Class Apihelper:
def __init__ (self):
Self.baseurl = "http://www.douyutv.com/api/v1/"
Self.midreq = "? Aid=android&cdn=ws&client_sys=android&time="

def GetStringMD5 (self, str):
m = Md5.new ()
M.update (str)
Return M.hexdigest ()

def request (Self, Action, Param=none):
t = str (int (time.time ()))
Md5_url = action + self.midreq + t + "1231"
Auth = self. GetStringMD5 (Md5_url)

Requrl = Self.baseurl + action + self.midreq + t + "&auth=" + self. GetStringMD5 (Md5_url)
if param! = None:
For K, V in Enumerate (param):
Requrl = Requrl + "&" + V + "=" + Param[v]
Print "Requrl:" + requrl

Try
Response = Urllib2.urlopen (Requrl, timeout=10). Read ()
Jsonobject = json.loads (response)
data = jsonobject["Data"]
Return data
Except Exception, E:
Print "Error:" + str (e)
Return None

Load = Apihelper ()
data = Load.request ("room/58428")
Rtmp_url = data["Rtmp_url"]
rtmp_live = data["Rtmp_live"]
Videourl = Rtmp_url + "/" + rtmp_live
Print Videourl

Is there any way to automatically extract the video source of the live streaming website?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.