- Timestamp:
- 08/31/17 22:56:38 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/mediathek/localhoster/thevideo.py
r40035 r40880 19 19 def __init__(self): 20 20 self.net = Net() 21 self.headers = {'User-Agent': common. IE_USER_AGENT}21 self.headers = {'User-Agent': common.ANDROID_USER_AGENT} 22 22 url = str(sys.argv[1]) 23 23 host = self.get_host_and_id(url)[0] … … 39 39 } 40 40 headers.update(self.headers) 41 h eaders = {'User-Agent': common.IE_USER_AGENT, 'Referer': web_url}41 html = self.net.http_GET(web_url, headers=headers).content 42 42 43 html = self.net.http_GET(web_url, headers=headers).content44 # print "111111111111", html.encode('utf-8').strip()45 old = 046 if old:47 vhash = re.search('\'_vhash\', value: \'(.*?)\'', html).group(1)48 gfk = re.search('\'gfk\', value: \'(.*?)\'', html).group(1)49 50 fname = re.search('name="fname" value="(.*?)"', html).group(1)51 op = re.search('name="op" value="(.*?)"', html).group(1)52 inhu = re.search('name="inhu" value="(.*?)"', html).group(1)53 usr_login = re.search('name="usr_login" value="(.*?)"', html).group(1)54 55 hash = re.search('name="hash" value="(.*?)"', html).group(1)56 fdata = {'_vhash': vhash,57 'gfk': gfk,58 'op': op,59 'usr_login': usr_login,60 'id': media_id,61 'fname': fname,62 'referer': '',63 'hash': hash,64 'imhuman': 'Proceed to video',65 'inhu': inhu}66 67 html = self.net.http_POST(url=web_url, form_data=fdata, headers=headers).content68 # print "2222222222", html.encode('utf-8').strip()69 70 #http://thevideo.me/jwv/LDonSU04MylZO1ZNSThGPUEK71 43 r = re.search('sources:\s*(\[.*?\])', html, re.DOTALL) 72 44 … … 80 52 max_label = int(re.sub('[^0-9]', '', source['label'])) 81 53 82 for match in re.finditer('(eval\(function.*?)</script>', html, re.DOTALL): 83 js_data = jsunpack.unpack(match.group(1)) 84 path = re.search('\'rc=".*(/.*?)\\\'.concat', js_data).group(1) 85 path = path.replace('\\', '') 86 if path: 87 break 54 varname = re.search('''concat\(\s*['"]/["']\s*\+([^\+]+?)\+''', html).group(1) 88 55 89 mpri_Key = re.search('var mpri_Key=\'(.*?)\'', html).group(1) 90 web_url = self.get_aturl(host, path, mpri_Key) 56 # authkey = re.search('''var lets_play_a_game=\'(.*)\'''', html).group(1) 57 # print "authkey2", authkey 58 59 authkey = re.search(r"=\'(.*)\'", html).group(1) 60 61 # my_regex = r"var " + re.escape(varname) + r"""\s*=\s*['"]([^'^"]+?)['"]""" 62 # my_regex = re.escape(varname) + r"""\s*=\s*['"]([^'^"]+?)['"]""" 63 # 64 # test = re.search(my_regex, html, re.IGNORECASE) 65 # print "test", test 66 67 web_url = "https://thevideo.me/vsign/player/" + authkey 91 68 html = self.net.http_GET(web_url, headers=headers).content 92 # print "3333333333", html.encode('utf-8').strip()93 69 94 70 js_data = jsunpack.unpack(html) 95 71 for match in re.finditer('(eval\(function.*?)\{\}\)\)', html, re.DOTALL): 96 72 js_data = jsunpack.unpack(match.group(1)) 73 ua = re.search('"ua=(.*?)"', js_data).group(1) 97 74 vt = re.search('"vt=(.*?)"', js_data).group(1) 98 print '%s?direct=false&ua=1&vt=%s' % (stream_url, vt) 75 print '%s?direct=false&ua=%s&vt=%s' % (stream_url, ua, vt) 76 99 77 100 78 def get_url(self, host, media_id): 101 return 'http://%s/%s' % (host, media_id) 102 103 def get_aturl(self, host, path, key): 104 return 'http://%s%s/%s' % (host, path, key) 79 return 'http://%s/embed-%s-640x360.html' % (host, media_id) 105 80 106 81 sys.stdout = TheVideoResolver()
Note: See TracChangeset
for help on using the changeset viewer.