2012-09-15, 20:22
hi guys i wrote simple regex code for my plugin which is reveal divxstage.net flv video link and wanna share you..if some one needs it
in my first video page i found the first embed link
--------------------------- RESULT ----------------------------------
----------------------------------------------------------------------------
Use url to find first divxstage web page
------------------------- RESULT -------------------------------------------------------------
-------------------------------------------------------------------------------
Use url to find second divxstage web page
-------------------------- RESULT ---------------------------------
-------------------------------------------------------------------------------------------------
Here is the flv link...
i know everybody knows code between lines but here is the code to open and read url
in my first video page i found the first embed link
Code:
match=re.compile('src=.*?embed\.php(.*?)\&').findall(link)
url='http://embed.divxstage.eu/embed.php'+str(match[0])
Code:
http://embed.divxstage.eu/embed.php?v=46dhv6rh25rl4
Use url to find first divxstage web page
Code:
match=re.compile('domain="http://www.divxstage.eu";\n\t\t\tflashvars.file="(.*?)";\n\t\t\tflashvars\.filekey="(.*?)"').findall(link)
for first,second in match:
url ='http://www.divxstage.eu/api/player.api.php?file='+first+'&key='+second
------------------------- RESULT -------------------------------------------------------------
Code:
http://www.divxstage.eu/api/player.api.php?file=46dhv6rh25rl4&key=46.154.67.175-3d17eb5316ba4a2df288d82a14be3c87
Use url to find second divxstage web page
Code:
match=re.compile('url=(.*?)&').findall(link)
-------------------------- RESULT ---------------------------------
Code:
http://s43.divxstage.eu/dl/abd0e59fa52829ac3e3eda55a2d39529/5054b6f4/fffde8ce1c925f20f46ce2310e94b6ec15.flv
Here is the flv link...
i know everybody knows code between lines but here is the code to open and read url
Code:
req = urllib2.Request(url)
req.add_header('User-Agent', USER_AGENT)
content = urllib2.urlopen(req)
data = content.read()
content.close()