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?