source: titan/mediathek/localhoster/mixdrop.py

Last change on this file was 44733, checked in by obi, 2 years ago

fix gold esel

File size: 4.4 KB
Line 
1
2import re
3import sys
4import time
5from lib.net import Net
6import re, urllib, json
7from lib import helpers
8import lib.common as common
9from lib import jsunpack
10
11class MixdropResolver(object):
12    name = "mixdrop"
13    domains = ["mixdrop.co", "mixdrop.to"]
14    pattern = r'(?://|\.)(mixdrop\.[ct]o)/(?:f|e)/(\w+)'
15
16    def __init__(self):
17        self.net = Net()
18        url = str(sys.argv[1])
19        host = self.get_host_and_id(url)[0]
20        media_id = self.get_host_and_id(url)[1]
21
22        return self.get_media_url(host, media_id)
23
24    def get_host_and_id(self, url):
25        r = re.search(self.pattern, url, re.I)
26        if r:
27            return r.groups()
28        else:
29            return False
30
31    def get_media_url(self, host, media_id):
32        web_url = self.get_url(host, media_id)
33        headers = {'User-Agent': common.FF_USER_AGENT}
34        response = self.net.http_GET(web_url, headers=headers)
35
36        html = self.net.http_GET(web_url, headers=headers).content
37#        print "html", html
38        js_data = re.findall('(eval\(function.*?)</script>', html.replace('\n', ''))
39#        print "js_data1", js_data
40        for i in js_data:
41            html += jsunpack.unpack(i)
42#        print "html", html
43
44        #MDCore.poster="//s-delivery10.mxdcontent.net/thumbs/18a6675ac1932f50e07887c3daf25a8b.jpg";MDCore.furl="//s-delivery10.mxdcontent.net/v/18a6675ac1932f50e07887c3daf25a8b.mp4?s=1W53dLLMYoBJ_x-Nv73_FA&e=1578351242";MDCore.vfile="18a6675ac1932f50e07887c3daf25a8b.mp4";MDCore.vserver="s-delivery10";MDCore.remotesub="";MDCore.chromeInject="0";MDCore.referrer="";$(document).ready(function(){setTimeout(function(){$("body").append("<iframe width=\\"1366\\" height=\\"768\\" src=\\"https://www.gearbest.com/smart-watch-phone/pp_009309925869.html?lkid=74203065\\" style=\\"display:none\\" sandbox=\\"allow-same-origin allow-scripts allow-popups allow-forms\\"></iframe>")},120000);setTimeout(function(){$("body").append("<iframe width=\\"1366\\" height=\\"768\\" src=\\"https://zap.buzz/6kr3yJp\\" style=\\"display:none\\" sandbox=\\"allow-same-origin allow-scripts allow-popups allow-forms\\"></iframe>")},120000);setTimeout(function(){$("body").append("<iframe width=\\"1366\\" height=\\"768\\" src=\\"https://uthorner.info/redirect?tid=814005&ref=mixdrop.co\\" style=\\"display:none\\" sandbox=\\"allow-same-origin allow-scripts allow-popups allow-forms\\"></iframe>")},120000);setTimeout(function(){$("body").append("<iframe width=\\"1366\\" height=\\"768\\" src=\\"https://pmzer.com/213479/9189\\" style=\\"display:none\\" sandbox=\\"allow-same-origin allow-scripts allow-popups allow-forms\\"></iframe>")},120000);setTimeout(function(){$("body").append("<iframe width=\\"1366\\" height=\\"768\\" src=\\"https://dynamicadx.com/213480/9190\\" style=\\"display:none\\" sandbox=\\"allow-same-origin allow-scripts allow-popups allow-forms\\"></iframe>")},120000);setTimeout(function(){$("body").append("<iframe width=\\"1366\\" height=\\"768\\" src=\\"https://zap.buzz/Y79rkqR\\" style=\\"display:none\\" sandbox=\\"allow-same-origin allow-scripts allow-popups allow-forms\\"></iframe>")},120000)});
45        match = re.search('MDCore.furl="([^"].*)";MDCore.vfile=', html)
46        if match:
47             match = re.search('MDCore.wurl="([^"].*)";MDCore.vfile=', html).group(1)
48             if match:
49                  headers = {'User-Agent': common.RAND_UA}
50                  if 'http:' not in match:
51                       print "https:%s" % (match) + helpers.append_headers(headers)
52                  else:
53                       print "%s" % (match) + helpers.append_headers(headers)
54                  return
55             match = re.search('MDCore.furl="([^"].*)";MDCore.vfile=', html).group(1)
56             if match:
57                  headers = {'User-Agent': common.RAND_UA}
58                  if 'http:' not in match:
59                       print "https:%s" % (match) + helpers.append_headers(headers)
60                  else:
61                       print "%s" % (match) + helpers.append_headers(headers)
62                  return
63
64        if '(p,a,c,k,e,d)' in html:
65            html = helpers.get_packed_data(html)
66        r = re.search(r'vsr[^=]+=\s*"([^"]+)', html)
67        if r:
68            headers = {'User-Agent': common.RAND_UA}
69            print "https:" + r.group(1) + helpers.append_headers(headers)
70        else:
71            print 'errormsg=File Not Found or removed'
72
73
74    def get_url(self, host, media_id):
75        return 'https://%s/e/%s' % (host, media_id)
76
77sys.stdout = MixdropResolver()
Note: See TracBrowser for help on using the repository browser.