Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <item>
- <title>http://livestream.com/accounts/16550960/events/4589741</title>
- <link>$doregex[get-url]</link>
- <regex>
- <name>get-url</name>
- <expres><![CDATA[#$pyFunction
- def GetLSProData(page_data,Cookie_Jar,m):
- import requests
- import re
- import urllib2
- url ='http://livestream.com/accounts/16550960/events/4589741'
- source = requests.get(url)
- url = re.findall('m3u8_url":"(https.*?hmac=.*?.*?)"', source.text)[-1]
- auth = re.findall('(&hdnea.*)', url)[0]
- print auth
- class NoRedirection(urllib2.HTTPErrorProcessor):
- def http_response(self, request, response):
- return response
- https_response = http_response
- opener = urllib2.build_opener(NoRedirection)
- location = opener.open(url).info().getheader('Location')
- location = location.replace('&__a__=off', '')
- source = requests.get(location)
- m3u8 = re.findall('RESOLUTION=1280x720.*?\n(.*)', source.text)[0]
- m3u8final = m3u8 + auth
- return m3u8final
- ]]></expres>
- <page></page>
- <cookieJar></cookieJar>
- </regex>
- </item>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement