def sources(self, url, hostDict, hostprDict): try: sources = [] if url == None: return sources content = 'episode' if 'episode' in url else 'movie' result = client.request(url) try: url = re.findall(r"class\s*=\s*'play_container'\s+href\s*=\s*'([^']+)", result)[0] result = client.request(url, timeout='10') except: pass try: url = re.compile('ajax\(\{\s*url\s*:\s*[\'"]([^\'"]+)').findall(result)[0] post = 'post' except: url = re.compile(r'onclick=.*?show_player.*?,.*?"([^\\]+)').findall(result)[0] post = None if content <> 'movie': try: if post == 'post': id, episode = re.compile('id=(\d+).*?&e=(\d*)').findall(url)[0] post = {'id': id, 'e': episode, 'cat': 'episode'} except: pass else: if post == 'post': id = re.compile('id=(\d+)').findall(url)[0] post = {'id': id, 'cat': 'movie'} if post <> None: result = client.request(url, post=post) url = re.findall(r"(https?:.*?)'\s+id='avail_links", result)[0] try: if 'google' in url: valid, hoster = source_utils.is_host_valid(url, hostDict) urls, host, direct = source_utils.check_directstreams(url, hoster) for x in urls: sources.append( {'source': host, 'quality': x['quality'], 'language': 'en', 'url': x['url'], 'direct': direct, 'debridonly': False}) else: valid, hoster = source_utils.is_host_valid(url, hostDict) sources.append({'source': hoster, 'quality': 'SD', 'language': 'en', 'url': url, 'direct': False, 'debridonly': False}) except: pass return sources except: return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url == None: return sources url = urlparse.urljoin(self.base_link, url) for i in range(3): result = client.request(url, timeout=10) if not result == None: break dom = dom_parser.parse_dom(result, 'div', attrs={'class': 'links', 'id': 'noSubs'}) result = dom[0].content links = re.compile( '<tr\s*>\s*<td><i\s+class="fa fa-youtube link-logo"></i>([^<]+).*?href="([^"]+)"\s+class="watch', re.DOTALL).findall(result) for link in links[:5]: try: url2 = urlparse.urljoin(self.base_link, link[1]) for i in range(2): result2 = client.request(url2, timeout=3) if not result2 == None: break r = re.compile('href="([^"]+)"\s+class="action-btn').findall(result2)[0] valid, hoster = source_utils.is_host_valid(r, hostDict) if not valid: continue # log_utils.log('JairoxDebug1: %s - %s' % (url2,r), log_utils.LOGDEBUG) urls, host, direct = source_utils.check_directstreams(r, hoster) for x in urls: sources.append( {'source': host, 'quality': x['quality'], 'language': 'en', 'url': x['url'], 'direct': direct, 'debridonly': False}) except: # traceback.print_exc() pass # log_utils.log('JairoxDebug2: %s' % (str(sources)), log_utils.LOGDEBUG) return sources except: return sources
def sources(self, url, hostDict, locDict): sources = [] try: if url == None: return sources url = url[0] year = url[1] data = urlparse.parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data[ 'title'] aliases = eval(data['aliases']) # cookie = '; approve_search=yes' query = self.search_link % (urllib.quote_plus(title)) query = urlparse.urljoin(self.base_link, query) result = client.request(query) # , cookie=cookie) try: if 'episode' in data: r = client.parseDOM(result, 'div', attrs={'class': 'ml-item'}) r = zip(client.parseDOM(r, 'a', ret='href'), client.parseDOM(r, 'a', ret='title')) r = [(i[0], i[1], re.findall('(.*?)\s+-\s+Season\s+(\d+)', i[1])) for i in r] r = [(i[0], i[1], i[2][0]) for i in r if len(i[2]) > 0] url = [ i[0] for i in r if self.matchAlias(i[2][0], aliases) and i[2][1] == data['season'] ][0] url = '%swatch' % url result = client.request(url) url = re.findall( 'a href=\"(.+?)\" class=\"btn-eps first-ep \">Episode %02d' % int(data['episode']), result)[0] else: r = client.parseDOM(result, 'div', attrs={'class': 'ml-item'}) r = zip(client.parseDOM(r, 'a', ret='href'), client.parseDOM(r, 'a', ret='title')) results = [(i[0], i[1], re.findall('\((\d{4})', i[1])) for i in r] try: r = [(i[0], i[1], i[2][0]) for i in results if len(i[2]) > 0] url = [ i[0] for i in r if self.matchAlias(i[1], aliases) and ( year == i[2]) ][0] except: url = None pass if (url == None): url = [ i[0] for i in results if self.matchAlias(i[1], aliases) ][0] url = '%s/watch' % url url = client.request(url, output='geturl') if url == None: raise Exception() except: return sources url = url if 'http' in url else urlparse.urljoin( self.base_link, url) result = client.request(url) src = re.findall('src\s*=\s*"(.*streamdor.co\/video\/\d+)"', result)[0] if src.startswith('//'): src = 'http:' + src episodeId = re.findall('.*streamdor.co/video/(\d+)', src)[0] p = client.request(src, referer=url) try: p = re.findall(r'JuicyCodes.Run\(([^\)]+)', p, re.IGNORECASE)[0] p = re.sub(r'\"\s*\+\s*\"', '', p) p = re.sub(r'[^A-Za-z0-9+\\/=]', '', p) p = base64.b64decode(p) p = jsunpack.unpack(p) p = unicode(p, 'utf-8') post = {'id': episodeId} p2 = client.request('https://embed.streamdor.co/token.php?v=5', post=post, referer=src, XHR=True) js = json.loads(p2) tok = js['token'] quali = 'SD' try: quali = re.findall(r'label:"(.*?)"', p)[0] except: pass p = re.findall(r'var\s+episode=({[^}]+});', p)[0] js = json.loads(p) ss = [] # if 'eName' in js and js['eName'] != '': # quali = source_utils.label_to_quality(js['eName']) if 'fileEmbed' in js and js['fileEmbed'] != '': ss.append([js['fileEmbed'], quali]) if 'fileHLS' in js and js['fileHLS'] != '': ss.append([ 'https://hls.streamdor.co/%s%s' % (tok, js['fileHLS']), quali ]) except: return sources for link in ss: try: if 'google' in url: valid, hoster = source_utils.is_host_valid( url, hostDict) urls, host, direct = source_utils.check_directstreams( url, hoster) for x in urls: sources.append({ 'source': host, 'quality': x['quality'], 'language': 'en', 'url': x['url'], 'direct': direct, 'debridonly': False }) else: try: valid, hoster = source_utils.is_host_valid( link[0], hostDict) direct = False if not valid: hoster = 'CDN' direct = True sources.append({ 'source': hoster, 'quality': link[1], 'language': 'en', 'url': link[0], 'direct': direct, 'debridonly': False }) except: pass except: pass return sources except: failure = traceback.format_exc() print('CMoviesHD - Exception: \n' + str(failure)) return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url == None: return sources hostDict += [ 'akamaized.net', 'google.com', 'picasa.com', 'blogspot.com' ] result = client.request(url, timeout=10) dom = dom_parser.parse_dom(result, 'a', req='data-video') urls = [ i.attrs['data-video'] if i.attrs['data-video'].startswith('https') else 'https:' + i.attrs['data-video'] for i in dom ] for url in urls: dom = [] if 'vidnode.net' in url: result = client.request(url, timeout=10) dom = dom_parser.parse_dom(result, 'source', req=['src', 'label']) dom = [ (i.attrs['src'] if i.attrs['src'].startswith('https') else 'https:' + i.attrs['src'], i.attrs['label']) for i in dom if i ] elif 'ocloud.stream' in url: result = client.request(url, timeout=10) base = re.findall('<base href="([^"]+)">', result)[0] hostDict += [base] dom = dom_parser.parse_dom(result, 'a', req=['href', 'id']) dom = [(i.attrs['href'].replace('./embed', base + 'embed'), i.attrs['id']) for i in dom if i] dom = [(re.findall("var\s*ifleID\s*=\s*'([^']+)", client.request(i[0]))[0], i[1]) for i in dom if i] if dom: try: for r in dom: valid, hoster = source_utils.is_host_valid( r[0], hostDict) if not valid: continue quality = source_utils.label_to_quality(r[1]) urls, host, direct = source_utils.check_directstreams( r[0], hoster) for x in urls: if direct: size = source_utils.get_size(x['url']) if size: sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': x['url'], 'direct': direct, 'debridonly': False, 'info': size }) else: sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': x['url'], 'direct': direct, 'debridonly': False }) except: pass else: valid, hoster = source_utils.is_host_valid(url, hostDict) if not valid: continue try: url.decode('utf-8') sources.append({ 'source': hoster, 'quality': 'SD', 'language': 'en', 'url': url, 'direct': False, 'debridonly': False }) except: pass return sources except: return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url == None: return sources data = urlparse.parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) aliases = eval(data['aliases']) headers = {} if 'tvshowtitle' in data: year = re.compile('(\d{4})-(\d{2})-(\d{2})').findall(data['premiered'])[0][0] episode = '%01d' % int(data['episode']) url = self.searchShow(data['tvshowtitle'], data['season'], aliases, headers) else: episode = None year = data['year'] url = self.searchMovie(data['title'], data['year'], aliases, headers) referer = url r = client.request(url) if episode == None: y = re.findall('Released\s*:\s*.+?\s*(\d{4})', r)[0] if not year == y: raise Exception() r = client.parseDOM(r, 'div', attrs={'class': 'sli-name'}) r = zip(client.parseDOM(r, 'a', ret='href'), client.parseDOM(r, 'a')) if not episode == None: r = [i[0] for i in r if i[1].lower().startswith('episode %02d:' % int(data['episode'])) or i[1].lower().startswith( 'episode %d:' % int(data['episode']))] else: r = [i[0] for i in r] for u in r: try: p = client.request(u, referer=referer, timeout='10') quali = re.findall(r'Quality:\s*<.*?>([^<]+)', p)[0] quali = quali if quali in ['HD', 'SD'] else source_utils.label_to_quality(quali) src = re.findall('src\s*=\s*"(.*streamdor.co/video/\d+)"', p)[0] if src.startswith('//'): src = 'http:' + src episodeId = re.findall('.*streamdor.co/video/(\d+)', src)[0] p = client.request(src, referer=u) try: p = re.findall(r'JuicyCodes.Run\(([^\)]+)', p, re.IGNORECASE)[0] p = re.sub(r'\"\s*\+\s*\"', '', p) p = re.sub(r'[^A-Za-z0-9+\\/=]', '', p) p = base64.b64decode(p) p = jsunpack.unpack(p) p = unicode(p, 'utf-8') except: continue try: fl = re.findall(r'file"\s*:\s*"([^"]+)', p) if len(fl) > 0: fl = fl[0] post = {'episodeID': episodeId, 'file': fl, 'subtitle': 'false', 'referer': urllib.quote_plus(u)} p = client.request(self.source_link, post=post, referer=src, XHR=True) js = json.loads(p) src = js['sources'] p = client.request('http:' + src, referer=src) js = json.loads(p)[0] ss = js['sources'] ss = [(i['file'], i['label']) for i in ss if 'file' in i] else: try: post = {'id': episodeId} p2 = client.request('https://embed.streamdor.co/token.php?v=5', post=post, referer=src, XHR=True) js = json.loads(p2) tok = js['token'] p = re.findall(r'var\s+episode=({[^}]+});', p)[0] js = json.loads(p) ss = [] if 'eName' in js and js['eName'] != '': quali = source_utils.label_to_quality(js['eName']) if 'fileEmbed' in js and js['fileEmbed'] != '': ss.append([js['fileEmbed'], quali]) if 'fileHLS' in js and js['fileHLS'] != '': ss.append(['https://hls.streamdor.co/%s%s' % (tok, js['fileHLS']), quali]) except: pass for i in ss: try: valid, hoster = source_utils.is_host_valid(i[0], hostDict) direct = False if not valid: hoster = 'CDN' direct = True sources.append({'source': hoster, 'quality': quali, 'language': 'en', 'url': i[0], 'direct': direct, 'debridonly': False}) except: pass except: url = re.findall(r'embedURL"\s*:\s*"([^"]+)', p)[0] valid, hoster = source_utils.is_host_valid(url, hostDict) if not valid: continue urls, host, direct = source_utils.check_directstreams(url, hoster) for x in urls: sources.append( {'source': host, 'quality': 'SD', 'language': 'en', 'url': x['url'], 'direct': direct, 'debridonly': False}) except: pass return sources except: return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url == None: return sources req = urlparse.urljoin(self.base_link, url) for i in range(4): result = client.request(req, timeout=3) if not result == None: break dom = dom_parser.parse_dom(result, 'div', attrs={ 'class': 'links', 'id': 'noSubs' }) result = dom[0].content links = re.compile( '<i class="fa fa-youtube link-logo"></i>([^<]+).*?href="([^"]+)"\s+class="watch', re.DOTALL).findall(result) random.shuffle(links) if debrid.status() == True: debrid_links = [] for pair in links: for r in debrid.debrid_resolvers: if r.valid_url('', pair[0].strip()): debrid_links.append(pair) links = debrid_links + links hostDict = hostDict + hostprDict conns = 0 for pair in links: if conns > self.max_conns and len(sources) > self.min_srcs: break host = pair[0].strip() link = pair[1] valid, host = source_utils.is_host_valid(host, hostDict) if not valid: continue link = urlparse.urljoin(self.base_link, link) for i in range(2): result = client.request(link, timeout=3) conns += 1 if not result == None: break try: link = re.compile('href="([^"]+)"\s+class="action-btn' ).findall(result)[0] except: continue try: u_q, host, direct = source_utils.check_directstreams( link, host) except: continue link, quality = u_q[0]['url'], u_q[0]['quality'] sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': link, 'direct': direct, 'debridonly': False }) return sources except: return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url == None: return sources if not str(url).startswith('http'): data = urlparse.parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) if 'tvshowtitle' in data: url = '%s/episode/%s-s%02de%02d/' % ( self.base_link, cleantitle.geturl(data['tvshowtitle']), int(data['season']), int(data['episode'])) year = re.findall('(\d{4})', data['premiered'])[0] url = client.request(url, output='geturl') if url == None: raise Exception() r = client.request(url) y = client.parseDOM(r, 'span', attrs={'class': 'date'}) y += [ i for i in client.parseDOM( r, 'div', attrs={'class': 'metadatac'}) if 'date' in i ] y = re.findall('(\d{4})', y[0])[0] if not y == year: raise Exception() else: url = '%s/movie/%s-%s/' % ( self.base_link, cleantitle.geturl( data['title']), data['year']) url = client.request(url, output='geturl') if url == None: raise Exception() r = client.request(url) else: url = urlparse.urljoin(self.base_link, url) r = client.request(url) links = client.parseDOM(r, 'iframe', ret='src') for link in links: try: valid, hoster = source_utils.is_host_valid(link, hostDict) if not valid: continue urls, host, direct = source_utils.check_directstreams( link, hoster) for x in urls: if x['quality'] == 'SD': try: if 'HDTV' in x['url'] or '720' in x['url']: x['quality'] = 'HD' if '1080' in x['url']: x['quality'] = '1080p' except: pass sources.append({ 'source': host, 'quality': x['quality'], 'language': 'en', 'url': x['url'], 'direct': direct, 'debridonly': False }) except: pass return sources except: return sources