Amanda94

live stream

Feb 21st, 2016
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <item>
  2. <title>http://livestream.com/accounts/16550960/events/4589741</title>
  3. <link>$doregex[get-url]</link>
  4.  
  5. <regex>
  6. <name>get-url</name>
  7. <expres><![CDATA[#$pyFunction
  8.  
  9. def GetLSProData(page_data,Cookie_Jar,m):
  10. import requests
  11. import re
  12. import urllib2
  13. url ='http://livestream.com/accounts/16550960/events/4589741'
  14. source = requests.get(url)
  15. url = re.findall('m3u8_url":"(https.*?hmac=.*?.*?)"', source.text)[-1]
  16. auth = re.findall('(&hdnea.*)', url)[0]
  17. print auth
  18.  
  19. class NoRedirection(urllib2.HTTPErrorProcessor):
  20. def http_response(self, request, response):
  21. return response
  22. https_response = http_response
  23.  
  24. opener = urllib2.build_opener(NoRedirection)
  25. location = opener.open(url).info().getheader('Location')
  26. location = location.replace('&__a__=off', '')
  27. source = requests.get(location)
  28. m3u8 = re.findall('RESOLUTION=1280x720.*?\n(.*)', source.text)[0]
  29. m3u8final = m3u8 + auth
  30. return m3u8final
  31.  
  32. ]]></expres>
  33. <page></page>
  34. <cookieJar></cookieJar>
  35. </regex>
  36. </item>
Add Comment
Please, Sign In to add comment