def multilinkselector(url): try: if len(url) == 1: url = url[0][1] else: sources = [] for i in url: smu_file = False try: if i[2]: smu_file=True except: pass if ( not smu_file ): c = client.request(i[1], output='headers') sources += [(i[0],kodi.convertSize(int(c['Content-Length'])),i[1])] else: try: pattern = r'''(?:)(?:http|https)(?:\:\/\/|\:\/\/www.)([^\.]+)''' domain = re.match(pattern,i[1]) domain = domain.group(1).title() except: domain = 'URL Resolver Link' sources += [(i[0],domain,i[1])] quals = [] srcs = [] for i in sources: qual = '%s - [ %s ]' % (i[0],i[1]) quals.append(kodi.giveColor(qual,'white',True)) srcs.append(i[2]) selected = kodi.dialog.select('Select a quality.',quals) if selected < 0: kodi.notify(msg='No option selected.') return 'quit' else: url = srcs[selected] kodi.busy() try: if resolveurl.HostedMediaFile(url).valid_url(): url = resolveurl.HostedMediaFile(url).resolve() except: pass kodi.idle() return url except: try: if resolveurl.HostedMediaFile(url[0][1]).valid_url(): url = resolveurl.HostedMediaFile(url[0][1]).resolve() return url except: pass
def I1IiiI(name, url, iconimage): if 44 - 44: O0oo0OO0.Oo0ooO0oo0oO / i11Ii11I1Ii1i + i1 iI111iI = xbmcgui.Dialog() o0o = [] O0OOoO00OO0o = [] I1111IIIIIi = [] O0O00o0OOO0 = Ii1iIIIi1ii(url) Iiii1i1 = re.compile('<title>' + re.escape(name) + '</title>(.+?)</item>', re.DOTALL).findall(O0O00o0OOO0)[0] iconimage = re.compile('<thumbnail>(.+?)</thumbnail>').findall(Iiii1i1)[0] O0OOO0OOoO0O = re.compile('<link>(.+?)</link>').findall(Iiii1i1) OO = 1 for oo000o in O0OOO0OOoO0O: iiIi1IIi1I = oo000o if '(' in oo000o: oo000o = oo000o.split('(')[0] o0OoOO000ooO0 = str(iiIi1IIi1I.split('(')[1].replace(')', '')) o0o.append(oo000o) O0OOoO00OO0o.append(o0OoOO000ooO0) else: o0o.append(oo000o) O0OOoO00OO0o.append('[COLOR aqua]Link ' + str(OO) + '[/COLOR]') OO = OO + 1 name = '[COLOR aqua]' + name + '[/COLOR]' iI111iI = xbmcgui.Dialog() o0o0o0oO0oOO = iI111iI.select(name, O0OOoO00OO0o) if o0o0o0oO0oOO < 0: quit() else: url = o0o[o0o0o0oO0oOO] print url if resolveurl.HostedMediaFile(url).valid_url(): o0OOOO00O0Oo = resolveurl.HostedMediaFile(url).resolve() elif liveresolver.isValid(url) == True: o0OOOO00O0Oo = liveresolver.resolve(url) else: o0OOOO00O0Oo = url o0O00oOoOO = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) o0O00oOoOO.setPath(o0OOOO00O0Oo) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, o0O00oOoOO) iI111iI.notification( iIiiiI1IiI1I1, '[COLOR red]Attempting To Resolve Link Now[/COLOR]', I1ii11iIi11i, 5000) time.sleep(1) xbmc.Player().play(o0OOOO00O0Oo) if 3 - 3: II
def get_source(self, movie_link, year): try: html = requests.get(movie_link).content year_confirm = re.compile('Release:(.+?)<br>', re.DOTALL).findall(html)[0] if year in year_confirm: Regex = re.compile("<ul id='serverul'(.+?)</ul>", re.DOTALL).findall(html) links = re.compile('<a href="(.+?)"', re.DOTALL).findall(str(Regex)) count = 0 for link in links: if urlresolver.HostedMediaFile(link): #xbmc.log('************ SOURCE'+repr(link),xbmc.LOGNOTICE) if '1080' in link: qual = '1080p' elif '720' in link: qual = '720p' else: qual = 'DVD' host = link.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() count += 1 self.sources.append({ 'source': host, 'quality': qual, 'scraper': self.name, 'url': link, 'direct': False }) if dev_log == 'true': end_time = time.time() - self.start_time send_log(self.name, end_time, count) except: pass
def get_source(self, movie_link, year, title, season, episode, start_time): try: html = self.scraper.get(movie_link).content qual = re.compile('<span class="calidad2">(.+?)</span>', re.DOTALL).findall(html)[0] links = re.compile('class="movieplay".+?src="(.+?)/"', re.DOTALL).findall(html) count = 0 for link in links: if urlresolver.HostedMediaFile(link).valid_url(): host = link.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() count += 1 self.sources.append({ 'source': host, 'quality': qual, 'scraper': self.name, 'url': link, 'direct': False }) if dev_log == 'true': end_time = time.time() - start_time send_log(self.name, end_time, count, title, year, season=season, episode=episode) except: pass #movie4k().scrape_movie('bright', '2017','')
def get_source(self, item_url, title, year, start_time): try: #print 'PASSEDURL >>>>>>'+item_url count = 0 headers = {'User-Agent': random_agent()} OPEN = requests.get(item_url, headers=headers, timeout=5).content #print '#1#1#1#1#1#1#1#1#1#1#1#11'+OPEN Endlinks1 = re.compile('id="content-embed".+?<iframe src="(.+?)"', re.DOTALL).findall(OPEN) for emfile in Endlinks1: OPENA = requests.get(emfile, headers=headers, timeout=5).content Endlinks = re.compile("//\$\(.+?addiframe\('(.+?)',", re.DOTALL).findall(OPENA) for link in Endlinks: #print 'scrapercheck - scrape_movie - link: '+str(link) if urlresolver.HostedMediaFile(link): count += 1 host = link.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() self.sources.append({ 'source': host, 'quality': 'DVD', 'scraper': self.name, 'url': link, 'direct': False }) if dev_log == 'true': end_time = time.time() - start_time send_log(self.name, end_time, count, title, year) except Exception, argument: if dev_log == 'true': error_log(self.name, argument) return []
def handle(self, link, item, download = False, popups = False, close = True, select = False, cloud = False): try: if item and 'direct' in item and item['direct'] == True: return link else: try: import resolveurl # Do not import at the start of the script, otherwise ResolveUrl will be loaded everytime handler.py is imported, drastically slowing down menus. except: pass # First check if a debrid resolver is available. resolvers = [i() for i in resolveurl.relevant_resolvers(order_matters = True) if i.isUniversal()] if len(resolvers) == 0: resolvers = [i() for i in resolveurl.relevant_resolvers(order_matters = True, include_universal = False) if 'rapidgator.net' in i.domains] for i in resolvers: try: i.login() host, id = i.get_host_and_id(link) linkNew = i.get_media_url(host, id) if linkNew: return debrid.Debrid.addResult(link = linkNew) except: pass # If not supported by debrid, try normal resolvers. media = resolveurl.HostedMediaFile(url = link, include_disabled = True, include_universal = False) if media.valid_url() == True: return debrid.Debrid.addResult(link = media.resolve(allow_popups = popups)) else: return debrid.Debrid.addResult(link = None) except: return debrid.Debrid.addResult(link = None)
def get_source(self,url): try: print 'checsspase '+url headers = {'User_Agent':User_Agent} links = requests.get(url,headers=headers,timeout=3).content LINK = re.compile('<iframe.+?src="(.+?)"',re.DOTALL).findall(links) count = 0 for final_url in LINK: host = final_url.split('//')[1].replace('www.','') host = host.split('/')[0].lower() if 'openload' in final_url: chk = requests.get(final_url).content rez = re.compile('"description" content="(.+?)"',re.DOTALL).findall(chk)[0] if '1080' in rez: res='1080p' elif '720' in rez: res='720p' else: res ='SD' else: res = 'SD' if urlresolver.HostedMediaFile(final_url).valid_url(): count +=1 self.sources.append({'source': host,'quality': res,'scraper': self.name,'url': final_url,'direct': False}) if dev_log=='true': end_time = time.time() - self.start_time send_log(self.name,end_time,count) except:pass
def get_source(self, item_url, title, year, start_time): try: print 'PASSEDURL >>>>>>' + item_url scraper = cfscrape.create_scraper() count = 0 headers = {'User-Agent': client.agent()} OPEN = scraper.get(item_url, headers=headers, timeout=10).content links = client.parseDOM(OPEN, 'div', attrs={'class': 'playex'})[0] links = client.parseDOM(links, 'iframe', ret='src') print '@#@LINKS: %s' % links for link in links: # print link +' ::::::::::::::::::::::' if 'sibeol' in link: print 'SIBEOL LINK??????????????' + link r = scraper.get(link, headers=headers, timeout=10).content # print get_link_page + 'UNJUICE?????????????????' # juicify = re.compile('>JuicyCodes.Run\("(.+?)\)\;\<',re.DOTALL).findall(get_link_page) data = unjuice.run(r) data = re.findall('sources:([^]]+\])', data, re.DOTALL)[0] data = json.loads(data) data = [(i['file'], i['label']) for i in data if data] for end_url, rez in data: if '/link/' in end_url: if '1080' in rez: qual = '1080p' elif '720' in rez: qual = '720p' else: qual = 'SD' count += 1 end_url = '%s|User_Agent=%s&Referer=%s' % ( end_url, client.agent(), item_url) self.sources.append({ 'source': 'DirectLink', 'quality': qual, 'scraper': self.name, 'url': end_url, 'direct': True }) else: if urlresolver.HostedMediaFile(link): count += 1 host = link.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() self.sources.append({ 'source': host, 'quality': 'DVD', 'scraper': self.name, 'url': link, 'direct': False }) if dev_log == 'true': end_time = time.time() - start_time send_log(self.name, end_time, count, title, year) except Exception, argument: if dev_log == 'true': error_log(self.name, argument) return []
def evaluate(host): try: host, referer = host.split('|') if 'openload' in host: from resources.resolvers import openload try: host = openload.get_video_openload(host) except BaseException: host = resolveurl.resolve(host) return host elif 'gamovideo' in host: r = client.request(host, referer=referer) #xbmc.log('@#@GAMO-DATA:%s' % r, xbmc.LOGNOTICE) from resources.modules import jsunpack source = re.findall('''(eval\(function\(p,a,c,k,e,(?:r|d).+?.split\('\|'\)\)\))''', r, re.DOTALL)[0] data = jsunpack.unpack(source) #xbmc.log('@#@GAMO-UNPACK:%s' % data, xbmc.LOGNOTICE) link = re.findall('''file:['"](http.+?v.mp4)['"]''', data, re.DOTALL)[0] #xbmc.log('@#@GAMO-link:%s' % link, xbmc.LOGNOTICE) return link elif 'hqq' in host or 'waaw' in host: from resources.resolvers import netutv media = netutv.get_video_url(host, referer) return media elif resolveurl.HostedMediaFile(host): host = resolveurl.resolve(host) return host else: return host except: return host
def get_source(self, item_url, title, year, start_time, res): try: #print 'PASSEDURL >>>>>>'+item_url count = 0 headers = {'User-Agent': random_agent()} OPEN = requests.get(item_url, headers=headers, timeout=5).content Endlinks = re.compile( 'class="movie_links"><li(.+?)<h3><b class="icon-share-alt"', re.DOTALL).findall(OPEN) #print 'scraperchk - scrape_movie - EndLinks: '+str(Endlinks) for block in Endlinks: link1 = re.compile('target="_blank" href="(.+?)"', re.DOTALL).findall(str(block)) #print 'scraperchk - scrape_movie - link: >>>>>>>>>>>>>>>>'+str(link1) for link in link1: if urlresolver.HostedMediaFile(link): count += 1 host = link.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() self.sources.append({ 'source': host, 'quality': res, 'scraper': self.name, 'url': link, 'direct': False }) if dev_log == 'true': end_time = time.time() - start_time send_log(self.name, end_time, count, title, year) except Exception, argument: if dev_log == 'true': error_log(self.name, argument) return []
def watchxxxfree(self, url): try: r = client.request(url) pattern = r"""data-lazy-src=['"]([^'"]+)""" e = re.findall(pattern, r) import resolveurl num = 0 u = [] a = [] b = [] c = [] if e: for i in e: if resolveurl.HostedMediaFile(i).valid_url(): num += 1 a.append('smu_file') b.append('Link %s' % str(num)) c.append(i) u = list(zip(b, c, a)) if u: return u else: return except: return
def play(self, url): try: hmf = resolveurl.HostedMediaFile(url, include_disabled=False, include_universal=True) if hmf.valid_url() is True: link = hmf.resolve() if link is None or link is False: link = url else: link = url if not 'User-Agent' in link: elements = urlparse.urlparse(link) domain = elements.scheme + '://' + elements.netloc uAgent = client.agent() link = '%s|User-Agent=%s&Referer=%s' % (link, uAgent, domain) title = control.infoLabel('listitem.label') icon = control.infoLabel('listitem.icon') li = control.item(title, path=link) li.setProperty("IsPlayable", "true") li.setArt({"thumb": icon, "icon": icon}) li.setInfo(type="video", infoLabels={"title": title}) control.resolve(handle=int(sys.argv[1]), succeeded=True, listitem=li) except Exception: pass
def get_source(self, movie_link, year): try: html = self.scraper.get(movie_link).content chkdate = re.compile( '<span itemprop="contentRating".+?rel="tag">(.+?)</a>', re.DOTALL).findall(html) for date in chkdate: if not year == date: continue links = re.compile('<a class="myButton" href="(.+?)"', re.DOTALL).findall(html) count = 0 for link in links: if urlresolver.HostedMediaFile(link).valid_url(): host = link.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() count += 1 self.sources.append({ 'source': host, 'quality': 'DVD', 'scraper': self.name, 'url': link, 'direct': False }) if dev_log == 'true': end_time = time.time() - self.start_time send_log(self.name, end_time, count) except: pass #ull4movies().scrape_movie('jungle', '2017','')
def get_source(self,url): try: headers={'User-Agent':User_Agent} OPEN = requests.get(url,headers=headers,timeout=10).content Regex = re.compile('class="metaframe rptss" src="(.+?)"',re.DOTALL).findall(OPEN) count = 0 for link in Regex: if not urlresolver.HostedMediaFile(link).valid_url(): continue host = link.split('//')[1].replace('www.','') host = host.split('/')[0].split('.')[0].title() #print 'm4u link > '+link if '1080' in link: rez = '1080p' elif '720' in link: rez = '720p' else: rez = 'SD' count +=1 self.sources.append({'source': host,'quality': rez,'scraper': self.name,'url': link,'direct': False}) if dev_log=='true': end_time = time.time() - self.start_time send_log(self.name,end_time,count) except: pass
def play_from_link_list(self, links): use_universal = True if addon.getSetting("universal_resolvers") == "true" else False sources = self._clean_urls([resolveurl.HostedMediaFile(x, title=x.split('/')[2], include_universal=use_universal) for x in links]) if not sources: notify('Oh oh','Could not find a supported link') return self._select_source(sources)
def links(self, url): out = [] html = requests.get(url).text try: img = re.findall('og\:image.+?content\s*=\s*[\"\']([^\"\']+)', html)[0] except: img = control.icon_path(info().icon) try: import resolveurl except: return [] iframe = re.findall('iframe.+?src\s*=\s*[\"\']([^\"\']+)', html) i = 1 for l in iframe: if l.startswith('//'): l = 'http:' + l hmf = resolveurl.HostedMediaFile(url=l) if hmf.valid_url(): title = 'Link %s' % i i += 1 out.append((l, title, img)) return out
def play_from_html(self, html): self.progress.update(50, "", "Searching for supported hosts", "") direct_links = None if self.direct_regex: direct_links = re.compile(self.direct_regex, re.DOTALL | re.IGNORECASE).findall(html) if direct_links: selected = 'https:' + direct_links[0] if direct_links[ 0].startswith('//') else direct_links[0] self.progress.update(50, "", "", "Playing from direct link") self.play_from_direct_link(selected) elif not self.regex: notify('Oh oh', 'Could not find a supported link') if self.regex and not direct_links: use_universal = True if addon.getSetting( "universal_resolvers") == "true" else False sources = self._clean_urls([ resolveurl.HostedMediaFile(x, title=x.split('/')[2], include_universal=use_universal) for x in resolveurl.scrape_supported(html, self.regex) ]) if not sources: notify('Oh oh', 'Could not find a supported link') return self._select_source(sources) if not self.direct_regex and not self.regex: raise ValueError("No regular expression specified")
def get_source(self, m_url): try: OPEN = requests.get(m_url).content match = re.compile('iframe src="(.+?)"').findall(OPEN) count = 0 for link in match: print link if not urlresolver.HostedMediaFile(link).valid_url(): continue label = link.split('//')[1].replace('www.', '') label = label.split('/')[0].split('.')[0].title() label = label.replace('Ul', 'Uploaded') if '720' in link: rez = '720p' elif '1080' in link: rez = '1080p' else: rez = 'DVD' count += 1 self.sources.append({ 'source': label, 'quality': rez, 'scraper': self.name, 'url': link, 'direct': False }) if dev_log == 'true': end_time = time.time() - self.start_time send_log(self.name, end_time, count) except: pass
def getdirect(hostname, url, quality, embed_id): if 'Stream.moe' in hostname: mp4 = resolveurl.resolve(url) if 'MP4Upload' in hostname: mp4 = resolveurl.resolve(url) if 'Vidstreaming' in hostname: mp4 = resolveurl.resolve(url) if 'Openload' in hostname: mp4 = resolveurl.resolve(url) if 'Drive.g' in hostname: mp4 = resolveurl.resolve(url) if 'Rapidvideo' in hostname: duration = 10000 message = "Cannot Play URL" stream_url = resolveurl.HostedMediaFile(url=url).resolve() if not stream_url: dialog = xbmcgui.Dialog() dialog.notification("ResolveURL Error", message, xbmcgui.NOTIFICATION_INFO, duration) else: mp4 = stream_url if 'Aika' in hostname: mp4 = url if 'Streamango' in hostname: mp4 = resolveurl.resolve(url) mp4 = str(mp4) return mp4
def play(self, url): try: hmf = resolveurl.HostedMediaFile(url, include_disabled=False, include_universal=True) if hmf.valid_url() == True: link = hmf.resolve() if link == None or link == False: link = url else: link = url if not 'User-Agent' in link: elements = urlparse.urlparse(link) domain = elements.scheme + '://' + elements.netloc uAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36' link = '%s|User-Agent=%s&Referer=%s' % (link, uAgent, domain) title = control.infoLabel('listitem.label') icon = control.infoLabel('listitem.icon') li = control.item(title, path=link) li.setProperty("IsPlayable", "true") li.setArt({"thumb": icon, "icon": icon}) li.setInfo(type="video", infoLabels={"title": title}) control.resolve(handle=int(sys.argv[1]), succeeded=True, listitem=li) except Exception: pass
def evaluate(host): try: if 'openload' in host: try: from resources.lib.resolvers import openload host = openload.get_video_openload(host) return host except: host = resolveurl.resolve(host) elif 'gamovideo' in host: cookie = client.request(host, output='cookie', close=False) OPEN = client.request(host, cookie=cookie, referer=BASEURL) host = re.compile('file: "(.+?)"', re.DOTALL).findall(OPEN)[1] return host elif 'streamin' in host: host = resolveurl.resolve(host) elif resolveurl.HostedMediaFile(host): host = resolveurl.resolve(host) return host except: pass
def play_link(link): logger.log('Playing Link: |%s|' % (link), log_utils.LOGDEBUG) hmf = resolveurl.HostedMediaFile(url=link) if not hmf: logger.log('Indirect hoster_url not supported by smr: %s' % (link)) kodi.notify('Link Not Supported: %s' % (link), duration=7500) return False logger.log('Link Supported: |%s|' % (link), log_utils.LOGDEBUG) try: stream_url = hmf.resolve() if not stream_url or not isinstance(stream_url, string_types): try: msg = stream_url.msg except: msg = link raise Exception(msg) except Exception as e: try: msg = str(e) except: msg = link kodi.notify('Resolve Failed: %s' % (msg), duration=7500) return False logger.log('Link Resolved: |%s|%s|' % (link, stream_url), log_utils.LOGDEBUG) listitem = xbmcgui.ListItem(path=stream_url) listitem.setContentLookup(False) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
def get_source(self,link): try: html = requests.get(link,timeout=5).content match = re.compile('var link_server.+?"(.+?)"',re.DOTALL).findall(html) count = 0 for link in match: if not link.startswith('http:'): link = 'http:' + link if 'vidnode' in link: if not 'load.php' in link: continue #print 'vidnodelink >>> '+link html = requests.get(link).content grab = re.compile("sources.+?file: '(.+?)',label: '(.+?)'",re.DOTALL).findall(html) for end_link,rez in grab: if '1080' in rez: res = '1080p' elif '720' in rez: res= '720p' else: res = 'SD' count +=1 self.sources.append({'source': 'Vidnode', 'quality': res, 'scraper': self.name, 'url': end_link, 'direct': False}) elif urlresolver.HostedMediaFile(link).valid_url(): host = link.split('//')[1].replace('www.','') host = host.split('/')[0].split('.')[0].title() count +=1 self.sources.append({'source': host, 'quality': 'SD', 'scraper': self.name, 'url': link, 'direct': False}) if dev_log=='true': end_time = time.time() - self.start_time send_log(self.name,end_time,count) except: pass
def get_source(self, url, title, year, season, episode, start_time): try: OPEN = requests.get(url).content Regex = re.compile(">Play:.+?window.open.+?'(/redirect/.+?)'", re.DOTALL).findall(OPEN) count = 0 for link in Regex: #print link link = self.base_link + link headers = {'User-Agent': User_Agent} r = requests.get(link, headers=headers, allow_redirects=False) stream_url = r.headers['location'] if not urlresolver.HostedMediaFile(stream_url).valid_url(): continue host = stream_url.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() count += 1 self.sources.append({ 'source': host, 'quality': 'SD', 'scraper': self.name, 'url': stream_url, 'direct': False }) if dev_log == 'true': end_time = time.time() - start_time send_log(self.name, end_time, count, title, year, season=season, episode=episode) except: pass
def play_link(link): logger.log('Playing Link: |%s|' % (link), log_utils.LOGDEBUG) if link.endswith('$$all'): hmf = resolveurl.HostedMediaFile(url=link[:-5], return_all=True) else: hmf = resolveurl.HostedMediaFile(url=link) if not hmf: logger.log('Indirect hoster_url not supported by smr: %s' % (link)) kodi.notify('Link Not Supported: %s' % (link), duration=7500) return False logger.log('Link Supported: |%s|' % (link), log_utils.LOGDEBUG) try: if link.endswith('$$all'): allfiles = hmf.resolve() names = [x.get('name') for x in allfiles] item = xbmcgui.Dialog().select('Select file to play', names, preselect=0) if item == -1: return False stream_url = allfiles[item].get('link') if resolveurl.HostedMediaFile(stream_url): stream_url = resolveurl.resolve(stream_url) else: stream_url = hmf.resolve() if not stream_url or not isinstance(stream_url, string_types): try: msg = stream_url.msg except: msg = link raise Exception(msg) except Exception as e: try: msg = str(e) except: msg = link kodi.notify('Resolve Failed: %s' % (msg), duration=7500) return False logger.log('Link Resolved: |%s|%s|' % (link, stream_url), log_utils.LOGDEBUG) listitem = xbmcgui.ListItem(path=stream_url) # listitem.setContentLookup(False) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
def router(link): if link.startswith(('acestream://', 'sop://')): if 'acestream' in link: stream = 'plugin://program.plexus/?url={0}&mode=1'.format( link.partition('://')[2]) else: stream = 'plugin://program.plexus/?url={0}&mode=2'.format(link) return stream elif 'youtu' in link: yt_mpd_enabled = control.addon(id='plugin.video.youtube').getSetting( 'kodion.video.quality.mpd') == 'true' streams = youtube_resolver.resolve(link) if yt_mpd_enabled: urls = streams else: urls = [s for s in streams if 'dash' not in s['title'].lower()] resolved = urls[0]['url'] return resolved elif 'v.redd.it' in link or 'reddit.com/video' in link: if 'reddit.com/video' in link: link = 'https://v.redd.it/' + link.partition('/')[2] try: dash_on = control.addon_details('inputstream.adaptive').get( 'enabled') except KeyError: dash_on = False if dash_on: stream = link + '/DASHPlaylist.mpd' else: stream = link + '/HLSPlaylist.m3u8' return stream elif resolveurl.HostedMediaFile(link).valid_url(): stream = resolveurl.resolve(link) return stream else: return link
def resolve(): select = dialog.select('[B][COLOR yellow]Choose A Source[/B][/COLOR]', playtitles) if select < 0: quit() url = playlinks[select] import resolveurl if resolveurl.HostedMediaFile(url).valid_url(): try: dialog.notification( AddonTitle, "[COLOR yellow][B]Resolving With ResolveUrl, Be Patient[/B][/COLOR]", icon, 10000) stream_url = resolveurl.HostedMediaFile(url).resolve() liz = xbmcgui.ListItem(AddonTitle) stream_url = str(stream_url) liz.setPath(stream_url) xbmc.Player().play(stream_url, liz, False) except: dialog.notification( AddonTitle, "[COLOR yellow][B]Seems The File Has Been Deleted At Source[/B][/COLOR]", icon, 5000) quit() elif '24hd.be' in url: dialog.notification( AddonTitle, "[COLOR yellow][B]Resolving Directly, Be Patient[/B][/COLOR]", icon, 10000) key = url.rsplit('/', 1)[1] ref = url headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', 'X-Requested-With': 'XMLHttpRequest', 'Referer': ref } link = requests.post('https://24hd.be/api/source/%s' % key, headers=headers).json() source = link['data'][0]['file'] xbmc.Player().play(source) else: dialog.notification( AddonTitle, "[COLOR yellow][B]Host %s Not Supported[/B][/COLOR]" % url, icon, 5000)
def streamingporn(self, url): dialog.notification('XXX-O-DUS', '[COLOR yellow]Getting Links Now[/COLOR]', xbmcgui.NOTIFICATION_INFO, 5000) r = scraper.get(url).content r = re.findall('<div class="entry-content">(.*?)</div>', r, flags=re.DOTALL)[0] pattern = r'''<a\s+href=['"]([^'"]+)['"].+?.>(.*?)<''' r = re.findall(pattern, r) names = [] srcs = [] found = 0 xbmc.executebuiltin("Dialog.Close(busydialog)") for url, name in r: if not 'image' in url: if not 'severeporn' in name: if resolveurl.HostedMediaFile(url).valid_url(): dialog.notification( 'XXX-O-DUS', '[COLOR yellow]Checking For Links Now, Be Patient[/COLOR]', xbmcgui.NOTIFICATION_INFO, 13000) try: found += 1 u = resolveurl.HostedMediaFile( url, include_popups=False).resolve() name = name.replace('Download', '').strip() names.append(kodi.giveColor(name, 'white', True)) srcs.append(u) except: pass if found >= 1: selected = kodi.dialog.select('Select a link.', names) if selected < 0: kodi.notify(msg='No option selected.') kodi.idle() quit() else: url2 = srcs[selected] return url2 else: dialog.notification( 'XXX-O-DUS', '[COLOR yellow]No Working Links Found Sorry[/COLOR]', xbmcgui.NOTIFICATION_INFO, 5000)
def nxgx(self, url): try: r = client.request(url) pattern = r"""iframe\s*src=['"]([^'"]+)""" u = re.findall(pattern, r)[0] u = resolveurl.HostedMediaFile(u).resolve() return u except: return
def PLAYLINK(name, url, iconimage): dialog.notification( AddonTitle, '[COLOR yellow]Getting Link By Order Of The Peaky Blinders[/COLOR]', icon, 5000) if resolveurl.HostedMediaFile(url).valid_url(): stream_url = resolveurl.HostedMediaFile(url).resolve() liz = xbmcgui.ListItem(name, iconImage=icon, thumbnailImage=icon) liz.setPath(stream_url) xbmc.Player().play(stream_url, liz, False) quit() else: stream_url = url liz = xbmcgui.ListItem(name, iconImage=icon, thumbnailImage=icon) liz.setPath(stream_url) xbmc.Player().play(stream_url, liz, False) quit()