def parse_link(self, url): r = re.search('getLinkSimple', url) if r: res = Request() res.get(url) url = res.get_request().url return url
def __get_fptplay_stream(self, url, base_url): response = Request().get(url) matches = re.findall('(media_.*)', response) for m in matches: stream_url = base_url + '/' + m response = response.replace(m, stream_url) url = PasteBin().dpaste(response, name=url, expire=60) return url
def get_fptplay(self): base_url = self.url.rpartition('/')[0] response = Request().get(self.url) matches = re.findall('(chunklist_.*)', response) for m in matches: stream_url = base_url + '/' + m response = response.replace(m, self.__get_fptplay_stream(stream_url, base_url)) url = PasteBin().dpaste(response, name=self.url, expire=60) return url, '1080'
class Phimmoi: domain = "http://www.phimmoi.net/" def __init__(self): self.request = Request(h, session=True) self.request.get('http://www.phimmoi.net/vn.php') def getCategory(self): response = self.request.get(self.domain) return Category().get(response) def getChannel(self, channel, page=1): channel = channel.replace(self.domain, "") if page > 1: url = '%s%spage-%d.html' % (self.domain, channel, page) else: url = '%s%s' % (self.domain, channel) response = self.request.get(url, headers=h) return Channel().get(response, page) def getMovie(self, id): url = "%s%sxem-phim.html" % (self.domain, id) response = self.request.get(url, headers=h) return Movie().get(response, url) def getLink(self, movie): url = "%s%s" % (self.domain, movie['link']) response = self.request.get(url, headers=h) return Movie().get(response, url, True) def search(self, text): url = "%stim-kiem/%s/" % (self.domain, urllib.quote_plus(text)) response = self.request.get(url, headers=h) return Channel().get(response, 1)
def get_stream(self, url): req = Request() r = req.get(url) str = "" links = [] for line in r.splitlines(): if len(line) > 0: if re.match('http', line): links.append(line) str += '%s\n' % line arequest = AsyncRequest(request=req) results = arequest.head(links) for i in range(len(links)): str = str.replace(links[i], results[i].headers['Location ']) url = PasteBin().dpaste(str, name='animiehay', expire=60) return url
def create_stream(self, url, base_url): retry = 5 res = Request() response = None while retry >= 0: try: print('Retry %d: %s' % (retry, url)) response = res.get(url) if response != 'error': break except: pass finally: retry -= 1 if response: matches = re.findall('(/drive/hls/.*)', response) for m in matches: stream_url = base_url + m response = response.replace(m, stream_url) url = PasteBin().dpaste(response, name=url, expire=60) return url
def get_hls_playlist_stream(self, url): req = Request() response = req.get(url) links = re.findall('(https?://(?!so-trym).*)\r', response) if links: arequest = AsyncRequest(request=req) results = arequest.head(links, headers={ 'origin': 'http://www.phimmoi.net', 'referer': self.originURL }, redirect=False) for i in range(len(links)): response = response.replace(links[i], results[i].headers['location']) links = re.findall('(http://so-trym.*)\r', response) if links: for i in range(len(links)): url = '%s|referer=%s' % (links[i], self.originURL) response = response.replace(links[i], url) url = PasteBin().dpaste(response, name=url, expire=60) return url
def getMovie(self, id): id = id.replace(self.domain, '') url = "%s%s" % (self.domain, id) response = Request().get(url) return Movie().get(response, url)
def getMovie(self, id): url = '%s%s' % (self.domain, id.replace('/phim/', '/xem-phim-online/')) response = Request().get(url) return Movie().get(response)
def getMovie(self, id): url = '%s/xem-phim.html' % id response = Request().get(url) return Movie().get(response, url)
def getCategory(self): response = Request().get(self.domain) return Category().get(response)
def getLink(self, movie): r = Request() response = r.get(movie['link']) return Movie().get_link(response, movie['link'], self.domain, r)
def search(self, text): # http://phimbathu.org/tim-kiem/(keywords).html url = "%s/tim-kiem/%s.html" % (self.domain, urllib.quote_plus(text)) response = Request().get(url) return Channel().get(response, 1)
class Hdvietnam: domain = "http://www.hdvietnam.com" def __init__(self): if not helper.getSetting('hdvietnam.username'): self.username = '******' self.password = '******' else: self.username = helper.getSetting('hdvietnam.username') self.password = helper.getSetting('hdvietnam.password') self.request = Request(session=True) def login(self, redirect=None): params = { 'login': self.username, 'password': self.password, 'register': 0, 'cookie_check': 1, '_xfToken': '', 'redirect': redirect } self.request.get('%s/login' % self.domain) response = self.request.post('%s/login/login' % self.domain, params) return response def thank(self, id, token, postLink): params = { '_xfRequestUri': id, '_xfToken': token, '_xfNoRedirect': 0, '_xfResponseType': 'json' } map(lambda v: self.request.post('%s/%s' % (self.domain, v), params), postLink) def getCategory(self): return Category().get(), None def getChannel(self, channel, page=1): channel = channel.replace(self.domain, "") if page > 1: url = '%s%spage-%d' % (self.domain, channel, page) else: url = '%s%s' % (self.domain, channel) response = Request().get(url) return Channel().get(response, page=page, domain=self.domain) def getMovie(self, movie): url = '%s/%s' % (self.domain, movie) response = self.login(redirect=url) parser = Movie() result, postLinks = parser.is_block(response) if result is True: token = re.findall(r'name="_xfToken"\svalue="(.*?)"\s', response) self.thank(movie, token[0], postLinks) response = self.request.get(url) result = parser.get(response, url) return result def search(self, text): text = urllib.quote_plus(text) params = { 'keywords': text, 'nodes[]': [337, 116, 150, 33, 57, 123], 'type': 'post', 'order': 'date', 'child_nodes': 1 } url = "%s/search/search" % self.domain response = Request().post(url, params=params) # print('77777777777777777777777777777777777777') # print(helper.write_file('test.html', response.encode('utf-8'))) return Channel().get_search(response)
class Tvhay: domain = "http://tvhay.org/" cookie = {} def __init__(self): self.request = Request(session=True) try: body = self.request.get(self.domain) cookie = SucuriCloudProxy.get_cookie(body) body = self.request.get( self.domain, cookies=cookie, headers={ 'Referer': 'http://tvhay.org/', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36' }) self.cookie = SucuriCloudProxy.get_cookie(body) except: pass def getCategory(self): response = self.request.get( self.domain, cookies=self.cookie, headers={ 'Referer': 'http://tvhay.org/', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36' }) return Category().get(response) def getChannel(self, channel, page=1): channel = channel.replace(self.domain, "") if page > 1: url = '%s%spage/%d' % (self.domain, channel, page) else: url = '%s%s' % (self.domain, channel) response = self.request.get( url, cookies=self.cookie, headers={ 'Referer': 'http://tvhay.org/', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36' }) return Channel().get(response, page) def getMovie(self, id): url = Movie().get_movie_link( self.request.get( id, cookies=self.cookie, headers={ 'Referer': 'http://tvhay.org/', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36' })) response = self.request.get( url, cookies=self.cookie, headers={ 'Referer': 'http://tvhay.org/', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36' }) return Movie().get(response) def getLink(self, movie): response = self.request.get( movie['link'], cookies=self.cookie, headers={ 'Referer': 'http://tvhay.org/', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36' }) return Movie().get_link(response) def search(self, text): url = "%ssearch/%s" % (self.domain, urllib.quote_plus(text)) response = self.request.get( url, cookies=self.cookie, headers={ 'Referer': 'http://tvhay.org/', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36' }) return Channel().get(response, 1)
def get_link(self, response): movie = { 'group': {}, 'episode': [], 'links': [], } sources = re.search(r"this.urls\s?=\s?(\[.*?\]);", response) username = re.search(r'username\s?:\s?[\'|"](\w+)[\'|"]', response).group(1) item_id = re.search(r'item_id\s?:\s?[\'|"](\w+)[\'|"]', response).group(1) prefers = json.loads( re.search(r'this.checkBestProxy\(\s?(\[.*?\])', response).group(1)) if sources: source = json.loads(sources.group(1))[0] params = { 'v': 2, 'url': source['url'], 'bk_url': source['burl'], 'pr_url': source['purl'], 'ex_hls[]': source['exhls'], 'prefer': prefers[0], 'ts': 1556547428839, 'item_id': item_id, 'username': username, } response = Request().get('http://dongphim.net/content/parseUrl', params=params) response = json.loads(response) if not response['hls']: self.get_media_url(response, movie['links']) params_alt = { 'v': 2, 'url': source['url'], 'bk_url': source['burl'], 'pr_url': source['purl'], 'ex_hls[]': source['exhls'], 'prefer': prefers[0], 'ts': 1556547428839, 'item_id': item_id, 'username': username, 'err[pr][ended]': 'true', 'err[eh][num]': 1, 'err[eh][dr][]': 'https://ok.ru', } response = json.loads(Request().get( 'http://dongphim.net/content/parseUrl', params=params_alt)) self.get_media_url(response, movie['links']) if len(movie['links']) > 1: try: movie['links'] = sorted( movie['links'], key=lambda elem: int( re.search(r'(\d+)', elem['title']).group(1)), reverse=True) except Exception as e: print(e) return movie
def get(self, response, skipEps=False): movie = { 'group': {}, 'episode': [], 'links': [], } # get all server list mid = None try: mid = re.search(r'drt:direction,mid:"(.*)",idx:idx,', response).group(1) except: pass if not mid: mid = re.search(r'mid:\s?"(.*?)",', response).group(1) list_eps = re.search( r'div class="movie-eps-nav" data-min="(\d+)" data-max="(\d+)"', response) # http://dongphim.net/content/subitems?drt=down&mid=8ghRyAh1&idx=400 request = Request() idx = int(list_eps.group(1)) eps = "" while True: if idx < 11: break else: url = "http://dongphim.net/content/subitems?drt=down&mid=%s&idx=%s" % ( mid, idx) data = json.loads(request.get(url)) eps += data['data'] idx = data['idx'] eps = eps.replace('\t\n\t', '') eps = eps.replace('\n\t\t', '') eps = eps.replace('\\\"', '"') eps = eps.replace('\n\t', '') eps = eps.replace('\t', '') soup = BeautifulSoup(eps, "html.parser") movie['group']['Dongphim'] = [] eps = soup.select('a.movie-eps-item') for i in reversed(range(len(eps))): ep = eps[i] if 'disabled' in ep.get('class'): continue movie['group']['Dongphim'].append({ 'link': ep.get('href').encode('utf-8'), 'title': ep.get('title').encode('utf-8'), }) soup = BeautifulSoup(response, "html.parser") eps = soup.select('a.movie-eps-item') for i in reversed(range(len(eps))): ep = eps[i] if 'disabled' in ep.get('class'): continue movie['group']['Dongphim'].append({ 'link': ep.get('href').encode('utf-8'), 'title': ep.get('title').encode('utf-8'), }) return movie
class Fcine: domain = "https://fcine.net" token = None member_id = None def __init__(self): if not helper.getSetting('fcine.username'): # helper.message('Please login to fcine.net', 'Login Required') self.username = '******' self.password = '******' else: self.username = helper.getSetting('fcine.username'), self.password = helper.getSetting('fcine.password'), self.request = Request(header={ 'User-Agent': 'Mozilla/5.0', 'origin': 'https://fcine.net', 'referer': 'https://fcine.net/login/', }, session=True) if helper.has_file_path( 'fcine.bin' ) and helper.get_last_modified_time_file('fcine.bin') + 43200 < int( time.time()): helper.remove_file('fcine.bin') if helper.has_file_path('fcine.bin'): self.request.set_session( pickle.loads(helper.read_file('fcine.bin', True))) else: self.login() def updateSession(self): helper.write_file('fcine.bin', pickle.dumps(self.request.get_request_session()), True) def get_token(self, response=None): if not response: response = self.request.get('%s/page/help/' % self.domain) self.token = re.search('csrfKey: "(.*)",', response).group(1) self.member_id = re.search('memberID: (\d+)', response).group(1) return self.token, self.member_id def login(self): self.get_token() params = { 'login__standard_submitted': 1, 'csrfKey': self.token, 'auth': self.username, 'password': self.password, 'remember_me': 1, 'remember_me_checkbox': 1 } response = self.request.post('%s/login/' % self.domain, params) self.updateSession() return response def getCategory(self): response = self.request.get(self.domain) movies = Channel().get(response, 1) movies['page'] = 1 return Category().get(response), movies def getChannel(self, channel, page=1): url = '%s?alphabet=all&page=%d' % (channel, page) response = self.request.get(url) return Channel().get(response, page) def getMovie(self, url): # self.get_token() # response = self.login( # self.username, # self.password, # {'referer': id}) return Movie().get(self.request.get(url)) def getLink(self, url): response = self.request.get(url) return Movie().get_link(response) def search(self, text): url = "%s/findContent/" % self.domain params = {'term': text} response = self.request.post(url, params) return Channel().get(response, 1)
def get_link(self, response, url, request): helper.log("***********************Get Movie Link*****************************") movie = { 'group': {}, 'episode': [], 'links': [], } self.originURL = url url = self.get_token_url(response) response = Request().get(url) self.key = self.get_decrypt_key(response) self.key if not self.key: return movie jsonresponse = re.search("_responseJson='(.*)';", response).group(1) jsonresponse = json.loads(py2_decode(jsonresponse)) # if jsonresponse['medias']: # media = sorted(jsonresponse['medias'], key=lambda elem: elem['resolution'], reverse=True) # for item in media: # url = CryptoAES().decrypt(item['url'], bytes(self.key.encode('utf-8'))) # if not re.search('hls.phimmoi.net', url): # movie['links'].append({ # 'link': url, # 'title': 'Link %s' % item['resolution'], # 'type': item['resolution'], # 'resolve': False, # 'originUrl': self.originURL # }) # else: # # hls.phimmoi.net # movie['links'].append({ # 'link': url, # 'title': 'Link hls', # 'type': 'hls', # 'resolve': False, # 'originUrl': self.originURL # }) # if jsonresponse.get('embedUrls'): # for item in jsonresponse.get('embedUrls'): # url = self.get_url(CryptoAES().decrypt(item, bytes(self.key.encode('utf-8')))) # if not re.search('hydrax', url): # movie['links'].append({ # 'link': url, # 'title': 'Link Unknow', # 'type': 'mp4', # 'resolve': False, # 'originUrl': self.originURL # }) # else: # movie['links'].append({ # 'link': url, # 'title': 'Link hydrax', # 'type': 'hls', # 'resolve': False, # 'originUrl': self.originURL # }) if jsonresponse['thirdParty']: jobs = [] self.key = "@@@3rd" for item in jsonresponse['thirdParty']: movie_url = self.get_url(CryptoAES().decrypt(item.get('embed'), self.key)) if 'hydrax.html' not in movie_url: movie['links'].append({ 'link': movie_url, 'title': 'Link {}'.format(item.get('label', 'HD')), 'type': item.get('type'), 'resolve': False, 'originUrl': self.originURL }) return movie
def get_link(self, response, originUrl, domain, request): movie = { 'group': {}, 'episode': [], 'links': [], } sources = re.search('"sourceLinks": (\[.*\]),', response) if sources: sources = sources.group(1) for source in json.loads(sources): for link in source['links']: movie['links'].append({ 'link': link['file'].replace('\\', ''), 'title': 'Link %s' % link['label'].encode('utf-8'), 'type': link['label'].encode('utf-8'), 'resolve': False }) sources = re.search("var urlPlay = '(.*)';", response) if sources: sources = sources.group(1) response = Request().get(sources) sources = re.search("var sources = (.*);", response) if sources: sources = json.loads(sources.group(1)) if type(sources) is dict: if 'file' in sources: movie['links'].append({ 'link': sources['file'].replace('\\', ''), 'title': 'Link %s' % sources['type'].encode('utf-8'), 'type': sources['type'].encode('utf-8'), 'originUrl': originUrl, 'resolve': False }) else: for source in sources: movie['links'].append({ 'link': source['file'].replace('\\', ''), 'title': 'Link %s' % source['type'].encode('utf-8'), 'type': source['type'].encode('utf-8'), 'originUrl': originUrl, 'resolve': False }) return movie sources = re.search("<iframe.*src=\"(.*)\"", response) if sources: source = sources.group(1) title = 'movie3s.net' in source and 'Movie3s' or 'Unknow' movie['links'].append({ 'link': source, 'title': 'Link %s' % title, 'type': 'file', 'originUrl': originUrl, 'resolve': False }) return movie soup = BeautifulSoup(response, "html.parser") # get all server list servers = soup.select("span.btn-link-backup.episode-link") if len(servers) > 0: jobs = [] links = [] m_id = re.search(r'var\s?MovieID\s?=\s?(\d+);', response).group(1) ep_id = re.search(r'var\s?EpisodeID\s?=\s?(\d+);', response).group(1) csrf = re.search(r'name="csrf-token"\s?content="(.*)">', response).group(1) for server in servers: sv_id = server.get('data-index') url = "%s/api/player.html" % domain params = {'id': m_id, 'ep': ep_id, 'sv': sv_id} jobs.append({ 'url': url, 'params': params, 'headers': { 'X-CSRF-TOKEN': csrf }, 'parser': Parser.extract_link }) AsyncRequest(request=request).post(jobs, args=links) for link in links: title = 'movie3s.net' in link[0] and 'Movie3s' or link[1] movie['links'].append({ 'link': link[0], 'title': 'Link %s' % title, 'type': 'file', 'originUrl': originUrl, 'resolve': False }) return movie
def search(self, text): url = "%s/film/search?keyword=%s" % (self.domain, urllib.quote_plus(text)) response = Request().get(url) return Channel().get(response, 1, self.domain)
def getCategory(self): channel = Channel.get(Request().get(self.domain)) return [], channel
def getLink(self, movie): url = "%s/ajax/player/" % self.domain data = movie['link'].split(",") params = {'id': data[0], 'ep': data[1], 'sv': data[2]} response = Request().post(url, params) return Movie().get_link(response)
def search(self, text, page=1): url = "%s/tim-kiem/%s.html" % (self.domain, urllib.quote_plus(text)) response = Request().get(url) return Channel().get(response)
def getMovie(self, id): url = "%s/phim-0-%s.html" % (self.domain, id) response = Request().get(url) url = Movie().get_movie_link(response) response = Request().get(url) return Movie().get(response)
def search(self, text, page=1): url = "%s/index.php?keyword=%s&do=phim&act=search&page=%s" % (self.domain, urllib.quote_plus(text), page) response = Request().get(url) return Channel().get(response)
def getMovie(self, id): r = Request() url = '%s/xem-phim.html' % id response = r.get(url) return Movie().get(response, url, self.domain, r)
def __init__(self): self.request = Request(header={ 'User-Agent': 'Mozilla/5.0', 'origin': 'https://fcine.net', 'referer': 'https://fcine.net/login/', }, session=True)
def search(self, text): url = "%s/tim-kiem-phim/%s/" % (self.domain, text.replace(' ', '-')) response = Request().get(url) return Channel().get(response, 1)
def getLink(self, movie): response = Request().get(movie['link']) return Movie().get(response, True)
def getMovie(self, id): url = "%sxem-online.html" % id response = Request().get(url) return Movie().get(response)
def __init__(self): self.request = Request(h, session=True) self.request.get('http://www.phimmoi.net/vn.php')
def getMovie(self, id): url = '%s%s' % (self.domain, id) url = Movie().get_movie_link(Request().get(url)) response = Request().get(url) return Movie().get(response)
class Hdvietnam: domain = "http://www.hdvietnam.com" def __init__(self): if not helper.getSetting('hdvietnam.username'): self.username = '******' self.password = '******' else: self.username = helper.getSetting('hdvietnam.username') self.password = helper.getSetting('hdvietnam.password') self.request = Request(header={ 'User-Agent': 'Mozilla/5.0', 'Origin': self.domain, 'Referer': self.domain }, session=True) if helper.has_file_path( 'hdvietnam.bin' ) and helper.get_last_modified_time_file('hdvietnam.bin') + 3600 < int( time.time()): helper.remove_file('hdvietnam.bin') if helper.has_file_path('hdvietnam.bin'): self.request.set_session( pickle.loads(helper.read_file('hdvietnam.bin', True))) else: self.login() def login(self, redirect='/'): params = { 'login': self.username, 'register': 0, 'password': self.password, 'remember': 1, 'cookie_check': 1, '_xfToken': '', 'redirect': redirect } response = self.request.post('%s/login/login' % self.domain, params) helper.write_file('hdvietnam.bin', pickle.dumps(self.request.get_request_session()), True) return response def thank(self, mid, token, postLink): params = { '_xfRequestUri': '/%s' % mid, '_xfToken': token, '_xfNoRedirect': 1, '_xfResponseType': 'json' } for v in postLink: url = '{}/{}'.format(self.domain, v) url = url.replace('likes', 'like') self.request.post(url, params=params) def getCategory(self): return Category().get(), None def getChannel(self, channel, page=1): channel = channel.replace(self.domain, "") if page > 1: url = '%s%spage-%d' % (self.domain, channel, page) else: url = '%s%s' % (self.domain, channel) response = Request().get(url) return Channel().get(response, page=page, domain=self.domain) def getMovie(self, movie): url = '%s/%s' % (self.domain, movie) self.login(url) response = self.request.get(url) parser = Movie() result, postLinks = parser.is_block(response) if result is True: token = re.findall(r'name="_xfToken"\svalue="(.*?)"\s', response) self.thank(movie, token[0], postLinks) response = self.request.get(url) parser.is_block(response) result = parser.get(response, url) return result def search(self, text): text = quote_plus(text) params = { 'keywords': text, 'nodes[]': [337, 116, 150, 33, 57, 123], 'type': 'post', 'order': 'date', 'child_nodes': 1 } url = "%s/search/search" % self.domain response = Request().post(url, params=params) return Channel().get_search(response)
def getLink(self, movie): url = '%s%s' % (self.domain, movie['link']) response = Request().get(url) return Movie().get_link(response, self.domain)
def search(self, text): text = urllib.quote_plus(text) url = "%s/search-phim-%s.html" % (self.domain, text) response = Request().get(url) return Channel().get(response, 1)
class Fcine: domain = "https://fcine.net" token = None member_id = None def __init__(self): self.request = Request(header={ 'User-Agent': 'Mozilla/5.0', 'origin': 'https://fcine.net', 'referer': 'https://fcine.net/login/', }, session=True) def get_token(self, response=None): if not response: response = self.request.get('%s/page/help/' % self.domain) self.token = re.search('csrfKey: "(.*)",', response).group(1) self.member_id = re.search('memberID: (\d+)', response).group(1) return self.token, self.member_id def login(self, username, password, header): params = { 'login__standard_submitted': 1, 'csrfKey': self.token, 'auth': username, 'password': password, 'remember_me': 1, 'remember_me_checkbox': 1 } return self.request.post('%s/login/' % self.domain, params, headers=header) def getCategory(self): response = self.request.get(self.domain) return Category().get(response) def getChannel(self, channel, page=1): url = '%s?alphabet=all&page=%d' % (channel, page) response = self.request.get(url) return Channel().get(response, page) def getMovie(self, id): self.get_token() response = self.login( helper.getSetting('fcine.username'), helper.getSetting('fcine.password'), {'referer': id}) return Movie().get(response) def getLink(self, url): response = self.request.get(url) return Movie().get_link(response) def search(self, text): url = "%s/findContent/" % (self.domain) params = { 'term': text } response = self.request.post(url, params) return Channel().get(response, 1)
def get_link(self, response, url, request): print("***********************Get Movie Link*****************************") movie = { 'group': {}, 'episode': [], 'links': [], } self.originURL = url url = self.get_token_url(response) response = Request().get(url) self.key = self.get_decrypt_key(response) if not self.key: return movie jsonresponse = re.search("_responseJson='(.*)';", response).group(1) jsonresponse = json.loads(jsonresponse.decode('utf-8')) # if jsonresponse['medias']: # media = sorted(jsonresponse['medias'], key=lambda elem: elem['resolution'], reverse=True) # for item in media: # url = CryptoAES().decrypt(item['url'], bytes(self.key.encode('utf-8'))) # if not re.search('hls.phimmoi.net', url): # movie['links'].append({ # 'link': url, # 'title': 'Link %s' % item['resolution'], # 'type': item['resolution'], # 'resolve': False, # 'originUrl': self.originURL # }) # else: # # hls.phimmoi.net # movie['links'].append({ # 'link': url, # 'title': 'Link hls', # 'type': 'hls', # 'resolve': False, # 'originUrl': self.originURL # }) if jsonresponse.get('embedUrls'): for item in jsonresponse.get('embedUrls'): url = self.get_url(CryptoAES().decrypt(item, bytes(self.key.encode('utf-8')))) if not re.search('hydrax', url): movie['links'].append({ 'link': url, 'title': 'Link Unknow', 'type': 'mp4', 'resolve': False, 'originUrl': self.originURL }) else: movie['links'].append({ 'link': url, 'title': 'Link hydrax', 'type': 'hls', 'resolve': False, 'originUrl': self.originURL }) if jsonresponse['thirdParty']: jobs = [] for item in jsonresponse['thirdParty']: if 'hydrax.html' not in item.get('embed'): jobs.append({'url': item.get('embed'), 'headers': { "Referer": self.originURL }, 'parser': self.parse_thirdparty_link}) AsyncRequest(request=request).get(jobs, args=movie['links']) return movie
def __init__(self): self.request = Request()