def get_media_url(self, host, media_id): url = self.get_url(host, media_id) if 'vidembed' in url or 'vb.icdrama' in url: headers = self.headers headers['Referer'] = 'http://icdrama.to' response = requests.get(url, headers=headers) unwrapped_url = '' if 'videoredirect.php?' in url: #for current Openload source & other possible redirects unwrapped_url = response.url else: streams = self._extract_streams(response) if not auto_select.settings_is_set('auto_select_source'): # manually pick source unwrapped_url = helpers.pick_source( streams, auto_pick=False).decode("utf-8") if self._url_can_play_directly(unwrapped_url): return unwrapped_url return resolveurl.resolve(unwrapped_url) else: # automatically pick source streams.sort(key=auto_select.rank_url_by_preference) # perform auto-select (in the order of preference) for all streams until empty while len(streams) > 0: source = streams.pop(0) unwrapped_url = source[1].decode("utf-8") libcommon.notify(heading="Auto picked source", message=source[0]) if not self._url_can_play_directly(unwrapped_url): # further resolve with upstream resolver try: unwrapped_url = resolveurl.resolve( unwrapped_url) except ResolverError as e: xbmc.log("Resolver error: {}".format(e), level=xbmc.LOGDEBUG) if str( e ) == 'Daily view limit reached': # upstream resolver reports limit reached continue # try next stream raise e if not hmf.test_stream( unwrapped_url ): # unplayable (e.g. expired link) continue # try next stream return unwrapped_url else: try: html = self.net.http_GET(url, headers=self.headers).content iframe = BeautifulSoup(html, 'html5lib').find('iframe') return resolveurl.resolve(iframe['src']) except Exception as e: xbmc.log("Resolver error: {}".format(e), level=xbmc.LOGDEBUG) raise ResolverError(str(e)) raise ResolverError("Unable to resolve url from icdrama")
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 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_media_url(self, host, media_id): url = self.get_url(host, media_id) if 'vidembed' in url or 'vb.icdrama' in url: headers = self.headers headers['Referer'] = 'http://icdrama.to' response = requests.get(url, headers=headers) unwrapped_url = '' if 'videoredirect.php?' in url: #for current Openload source & other possible redirects unwrapped_url = response.url else: streams = self._extract_streams(response) unwrapped_url = helpers.pick_source(streams, auto_pick=False).decode('utf-8') if ('redirector.googlevideo.com' in unwrapped_url or 'blogspot.com' in unwrapped_url or 'fbcdn.net' in unwrapped_url): #for current Videobug source # Kodi can play directly, skip further resolve return unwrapped_url return resolveurl.resolve(unwrapped_url) else: try: html = self.net.http_GET(url, headers=self.headers).content iframe = BeautifulSoup(html, 'html5lib').find('iframe') return resolveurl.resolve(iframe['src']) except: return None
def docu_play(self, url): try: docu_page = client.request(url) docu_item = client.parseDOM(docu_page, 'meta', attrs={'itemprop': 'embedUrl'}, ret='content')[0] if 'http:' not in docu_item and 'https:' not in docu_item: docu_item = 'https:' + docu_item url = docu_item docu_title = client.parseDOM( docu_page, 'meta', attrs={'property': 'og:title'}, ret='content')[0].encode( 'utf-8', 'ignore').decode('utf-8').replace("&", "&").replace( ''', "'").replace('"', '"').replace( ''', "'").replace('–', ' - ').replace( '’', "'").replace('‘', "'").replace( '&', '&').replace('â', '') if 'youtube' in url: if 'videoseries' not in url: video_id = client.parseDOM( docu_page, 'div', attrs={'class': 'youtube-player'}, ret='data-id')[0] # url = 'plugin://plugin.video.youtube/play/?video_id=%s' % video_id ### crashing kodi url = resolveurl.resolve( 'https://www.youtube.com/watch?v=%s' % video_id) else: pass elif 'dailymotion' in url: #import web_pdb; web_pdb.set_trace() video_id = client.parseDOM(docu_page, 'div', attrs={'class': 'youtube-player'}, ret='data-id')[0] url = self.getDailyMotionStream(video_id) elif 'vimeo' in url: video_id = re.findall('\d+', url)[0] url = resolveurl.resolve('https://vimeo.com/%s' % video_id) else: log_utils.log('Play Documentary: Unknown Host: ' + str(url)) control.infoDialog('Unknown Host - Report To Developer: ' + str(url), sound=True, icon='INFO') control.execute('PlayMedia(%s)' % url) except Exception as e: log_utils.log('docu_play: Exception - ' + str(e)) pass
def resolveurl(): playable = None resolved = "" url = plugin.keyboard(default='', heading='Video Page URL') if url is not None: name = url if len(url) > 0: url = url.encode('utf-8', 'ignore') item = ListItem(label=name, label2=url, icon='DefaultVideo.png', thumbnail='DefaultVideo.png', path=plugin.url_for(endpoint=play, url=url)) item.playable = True item.set_info(info_type='video', info_labels={ 'Title': url, 'Plot': url }) item.add_stream_info(stream_type='video', stream_values={}) playable = play(url) try: resolved = urlresolver.resolve(url) except: resolved = "" plugin.notify(msg=resolved, title="Playing..") return plugin.play_video(playable) #plugin.redirect(plugin.url_for(index)) #plugin.clear_added_items() #plugin.end_of_directory() #return None return None
def playmovie(self, url): url_content = client.request(url) filmbeagyazas = client.parseDOM(url_content, 'div', attrs={'class': 'filmbeagyazas'}) if len(filmbeagyazas) > 0: filmbeagyazas = filmbeagyazas[0] else: filmbeagyazas = client.parseDOM(url_content, 'div', attrs={'class': 'beagyazas'})[0] source = client.parseDOM(filmbeagyazas, 'iframe', ret='src')[0] xbmc.log('Dmdamedia: resolving url: %s' % source, xbmc.LOGINFO) try: direct_url = urlresolver.resolve(source) if direct_url: direct_url = py2_encode(direct_url) except Exception as e: xbmcgui.Dialog().notification( urlparse.urlparse(url).hostname, str(e)) return if direct_url: xbmc.log('Dmdamedia: playing URL: %s' % direct_url, xbmc.LOGINFO) play_item = xbmcgui.ListItem(path=direct_url) xbmcplugin.setResolvedUrl(syshandle, True, listitem=play_item)
def mixdrop_after_resolve(browse_link, pdialog): resolved = False subtitles = None if ('sub=' in browse_link): pdialog.update(25, 'Fetching Subtitles') subtitles = browse_link.split('sub=')[1] r = http_GET(subtitles, 7) subtitles = r.content pdialog.update(50, 'Parsing JS ...') try: resolved = resolveurl.resolve(browse_link) print("Link Resolved ---> " + resolved) except: mensagemok("Video", "Video não disponivel.") return 0 if (resolved != False): play_item = xbmcgui.ListItem(path=resolved) # Mixdrop as small download subs if (not subtitles): pdialog.update(65, 'Fetching Subtitles') subtitles = mixdrop_subs_getter(browse_link) if (subtitles): pdialog.update(75, 'Adding Subtitles') write_file(__LEGENDAS__, subtitles) play_item.setSubtitles([__LEGENDAS__]) _player_ = xbmc.Player() print("Starting mixdrop VPlayer --->") pdialog.update(95, 'Enjoy') pdialog.close() _player_.play(resolved, play_item)
def get_link_dailymotion(self): try: import resolveurl stream_url = resolveurl.resolve(self.url) return stream_url, '720' except: return None
def evaluate(host): try: if 'openload' in host: try: from resources.lib.resolvers import openload oplink = openload.get_video_openload(host) host = resolveurl.resolve(oplink) if oplink == '' else oplink except BaseException: host = resolveurl.resolve(host) elif resolveurl.HostedMediaFile(host): host = resolveurl.resolve(host) return host except BaseException: pass
def get_link_openload(self): try: import resolveurl stream_url = resolveurl.resolve(self.url) return stream_url, '720' except: return None
def download(title, img, url): from resources.lib.modules import control control.busy() import json if url is None: return try: import resolveurl url = resolveurl.resolve(url) except Exception: control.idle() xbmcgui.Dialog().ok(NAME, 'Download failed', 'Your service can\'t resolve this hoster', 'or Link is down') return try: headers = dict(parse_qsl(url.rsplit('|', 1)[1])) except: headers = dict('') content = re.compile(r'(.+?)\s+[\.|\(|\[]S(\d+)E\d+[\.|\)|\]]', re.I).findall(title) transname = title.translate(None, r'\/:*?"<>|').strip('.') transname = re.sub(r'\[.+?\]', '', transname) levels = ['../../../..', '../../..', '../..', '..'] if len(content) == 0: dest = control.setting('movie.download.path') dest = control.transPath(dest) for level in levels: try: control.makeFile(os.path.abspath(os.path.join(dest, level))) except: pass control.makeFile(dest) dest = os.path.join(dest, transname) control.makeFile(dest) else: dest = control.setting('tv.download.path') dest = control.transPath(dest) for level in levels: try: control.makeFile(os.path.abspath(os.path.join(dest, level))) except: pass control.makeFile(dest) tvtitle = re.sub(r'\[.+?\]', '', content[0]) transtvshowtitle = tvtitle.translate(None, r'\/:*?"<>|').strip('.') dest = os.path.join(dest, transtvshowtitle) control.makeFile(dest) dest = os.path.join(dest, 'Season %01d' % int(content[0][1])) control.makeFile(dest) ext = os.path.splitext(urlparse(url).path)[1][1:] if ext not in ['mp4', 'mkv', 'flv', 'avi', 'mpg']: ext = 'mp4' dest = os.path.join(dest, transname + '.' + ext) headers = quote_plus(json.dumps(headers)) from resources.lib.modules import downloader control.idle() downloader.doDownload(url, dest, title, img, headers)
def resolveurl_kvid(vid_url): req = urllib2.Request(vid_url) req.add_header('User-Agent', UserAgent) req.add_header('Referer', 'http://www.marutv.org/') resp = urllib2.urlopen(req) doc = resp.read() resp.close() soup = BeautifulSoup(doc, from_encoding='utf-8') embedVids = soup.findAll("li", {"class":"linkserver"}) soup = None if embedVids: urlsFound = {} for embedVid in embedVids: datavideo = embedVid['data-video'] if datavideo: urlsFound[embedVid.text] = datavideo if urlsFound: dialog = xbmcgui.Dialog() ret = dialog.select('Choose source', urlsFound.keys()) if ret >= 0: resolved = resolveurl.resolve(urlsFound.values()[ret]) if resolved: return resolved else: return tryresolveurl(urlsFound.values()[ret]) return vid_url
def extract_video_url(url): vid_url = None req = urllib2.Request(url) req.add_header('User-Agent', UserAgent) req.add_header('Referer', 'http://www.marutv.org/') resp = urllib2.urlopen(req) doc = resp.read() resp.close() soup = BeautifulSoup(doc, from_encoding='utf-8') player = soup.find("div", {"class":"player"}) vid_url = '' if player: iframe = player.find('iframe') if iframe: vid_url = iframe['src'] else: btn = player.find('a') if btn: vid_url = btn['href'] # normalize url soup = None resolved = resolveurl.resolve(vid_url) if not resolved: return tryresolveurl(vid_url) return resolved
def router(url): try: add_plugin_dirs( [control.join(control.addonPath, 'resources', 'lib', 'resolvers')]) forced_host = control.setting('force_host') rr = relevant_resolvers() domains = [r.domains for r in rr][1:] domain_list = [d for dm in domains for d in dm] if forced_host in domain_list: stream = HostedMediaFile(media_id=url, host=forced_host).resolve() return stream elif HostedMediaFile(url).valid_url(): stream = resolve(url) return stream else: return url except ResolverError: return url
def _(): (path, serverlist, titlelist, title) = request.parse(plugin.path, 'ServerListParser') position = Dialog().select(_addon.getLocalizedString(33500), titlelist) item = ListItem(title) url = False if position != -1: xbmc.executebuiltin('ActivateWindow(busydialognocancel)') resolveurl.add_plugin_dirs(_plugins) try: url = resolveurl.resolve(serverlist[position]) if url: edb.connect() edb.add(path) edb.close() item.setPath(url) subtitle = request.subtitle(serverlist[position]) if subtitle: item.setSubtitles([subtitle]) else: Dialog().notification(_addon.getLocalizedString(33502), '') except: Dialog().notification(_addon.getLocalizedString(33501), '') xbmc.executebuiltin('Dialog.Close(busydialognocancel)') else: xbmc.executebuiltin('Playlist.Clear') xbmc.sleep(500) xbmcplugin.setResolvedUrl(plugin.handle, isinstance(url, str), item)
def player(p): pl = p[0] link = p[1] l = common.solveCFP(link) stream_url = '' if not l == None: try: iframesrc = re.compile('<iframe src=\"(.*?)\" ', re.DOTALL).findall( l.text.encode('utf-8'))[0] common.log(l.text.encode('utf-8')) if iframesrc.startswith('//'): iframesrc = 'http:' + iframesrc try: stream_url = urlresolve.resolve(iframesrc) except Exception, e: stream_url = '' s = xbmcgui.Dialog().ok( '[COLOR red]Problem[/COLOR]', 'Może inny stream_url będzie działał?', 'Urlresolver ERROR: [%s]' % str(e)) except: common.log('no iframe found: ' + link) if stream_url: xbmcplugin.setResolvedUrl(common.addon_handle, True, xbmcgui.ListItem(path=stream_url)) else: return False xbmcplugin.endOfDirectory(common.addon_handle)
def playmovie(self, url): self.Login() xbmc.log('NetMozi: Try to play from URL: %s' % url, xbmc.LOGINFO) final_url = client.request(url, cookie=self.logincookie, output="geturl") xbmc.log('NetMozi: final URL: %s' % final_url, xbmc.LOGINFO) try: direct_url = urlresolver.resolve(final_url) if direct_url: xbmc.log('NetMozi: URLResolver resolved URL: %s' % direct_url, xbmc.LOGINFO) direct_url = py2_encode(direct_url) else: xbmc.log( 'NetMozi: URLResolver could not resolve url: %s' % final_url, xbmc.LOGINFO) xbmcgui.Dialog().notification( "URL feloldás hiba", "URL feloldása sikertelen a %s host-on" % urlparse.urlparse(final_url).hostname) except Exception as e: xbmc.log('NetMozi: URLResolver resolved URL: %s' % final_url, xbmc.LOGINFO) xbmcgui.Dialog().notification( urlparse.urlparse(url).hostname, str(e)) return if direct_url: xbmc.log('NetMozi: playing URL: %s' % direct_url, xbmc.LOGINFO) play_item = xbmcgui.ListItem(path=direct_url) xbmcplugin.setResolvedUrl(syshandle, True, listitem=play_item)
def get_media_url(self, host, media_id): url = self.get_url(host, media_id) cmn.debug('Icdrama: ' + url) if 'vidembed' in url or 'vb.icdrama' in url: headers = self.headers headers['Referer'] = 'http://adrama.to' response = requests.get(url, headers=headers) unwrapped_url = '' streams = self._extract_streams(response) cmn.debug("Icdrama: Extracted links... " + str(streams)) unwrapped_url = '' if xbmcaddon.Addon().getSetting('auto_select_source') == 'true': unwrapped_url = sourceutil.pick_source(streams) else: unwrapped_url = helpers.pick_source(streams, False) if ('redirector.googlevideo.com' in unwrapped_url or 'blogspot.com' in unwrapped_url or 'googleusercontent.com' in unwrapped_url or 'fbcdn.net' in unwrapped_url): # for current Videobug source # Kodi can play directly, skip further resolve return unwrapped_url return resolveurl.resolve(unwrapped_url) else: try: html = self.net.http_GET(url, headers=self.headers).content iframe = BeautifulSoup(html, 'html5lib').find(id='iframeplayer') if iframe: iframe_url = urljoin(self.get_url(host, ''), iframe['src']) return resolveurl.resolve(iframe_url) else: cmn.popup(loc.getLocalizedString(33305)) return '' except Exception as e: if 'No link selected' in str(e): return '' raise ResolverError('Icdrama resolver: ' + str(e) + ' : ' + self.get_url(host, media_id))
def resolveOTHER(l): link='' try: link=urlresolve.resolve("https://"+l) except: common.info('cos wiecej w logu','Blad resolveurl') if link: xbmcplugin.setResolvedUrl(common.addon_handle, True, xbmcgui.ListItem(path=link))
def play_video(path): try: resolved_url = resolveurl.resolve(path) listitem = xbmcgui.ListItem(path=resolved_url) xbmcplugin.setResolvedUrl(handle, True, listitem) except: play_item = xbmcgui.ListItem(path=path) xbmcplugin.setResolvedUrl(handle, True, listitem=play_item)
def Big_Resolve(name,url): import resolveurl try: resolved_url = resolveurl.resolve(url) xbmc.Player().play(resolved_url, xbmcgui.ListItem(name)) except: xbmc.Player().play(url, xbmcgui.ListItem(name)) xbmcplugin.endOfDirectory(int(sys.argv[1]))
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 get_youtube(self): self.url = self.url.replace(re.search('^http.*(\?.*)', self.url).group(1), '') try: import resolveurl re.sub('(^http.*)\?', '\1', self.url) stream_url = resolveurl.resolve(self.url) return stream_url, '720' except: return None
def resolve(self, url): import resolveurl try: res = resolveurl.resolve(url) except: res = ' ' if not res: res = ' ' return res
def evaluate(host): try: host, referer = host.split('|') if 'openload' in host: from resources import openload if openload.test_video(host): host = openload.get_video_openload(host) else: host = resolveurl.resolve(host) return host elif resolveurl.HostedMediaFile(host): host = resolveurl.resolve(host) return host else: return host except: return host
def playItem(self, slug, url): control.busy() resolve_dialog = xbmcgui.DialogProgress() link_list = cache.get(scraper().scrapeLinks, 24, slug, url) control.idle() if len(link_list) == 0: dialog = xbmcgui.Dialog() dialog.notification('Anime Incursion', 'No Links Available', xbmcgui.NOTIFICATION_INFO, 5000) else: resolve_dialog.create('Anime Incursion', '') resolve_dialog.update(0) link_list = sorted(link_list, key=lambda x: (x['quality']), reverse=True) link_total = len(link_list) progress = 0 path = '' for i in link_list: # if resolve_dialog.iscanceled() == True: # return progress += 1 resolve_dialog.update( int((100 / float(link_total)) * progress), str(progress) + ' | [B]Host: ' + i['name'].upper() + "[/B] | [B]Resolution: " + str(i['quality']) + "p[/B]") try: if i['direct'] == False: import resolveurl path = resolveurl.resolve(i['url']).encode('utf-8') break else: path = i['url'] break except: continue if path != '': play_item = xbmcgui.ListItem(path=path) print('INFO - ' + str(sys.argv[1])) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem=play_item) else: dialog = xbmcgui.Dialog() dialog.notification('Anime Incursion', 'Unable to Resolve Links', xbmcgui.NOTIFICATION_INFO, 5000)
def get_resolved(url): import xbmcvfs resolved = daddyFind(url) if resolved: return resolved else: logga("NO RESOLVER DADDY") resolved = wizhdFind(url) if resolved: return resolved else: logga("NO RESOLVER WIZHD") resolved = assiaFind(url) if resolved: return resolved else: logga("NO RESOLVER ASSIA") resolved = GetLSProData(url) if resolved: return resolved else: logga("NO RESOLVER DATA") try: import resolveurl except: dialog = xbmcgui.Dialog() mess = "Lo script 'script.module.resolveurl' non risulta installato." dialog.ok("Mandrakodi", mess) return url logga("TRY TO RESOLVE: " + url) xxx_plugins_path = 'special://home/addons/script.module.resolveurl.xxx/resources/plugins/' if xbmcvfs.exists(xxx_plugins_path): logging.warning("OK XXX RESOLVER ") if sys.version_info[0] > 2: xxxp = xbmcvfs.translatePath(xxx_plugins_path) else: import xbmc xxxp = xbmc.translatePath(xxx_plugins_path) resolveurl.add_plugin_dirs(xxxp) try: resolved = resolveurl.resolve(url) if resolved: logga("OK RESOLVER: " + resolved) return resolved except Exception as e: logga("NO RESOLVER") return url
def Play(url): Play = xbmc.Player() host = RESOLVE.HostedMediaFile(url) ValidUrl = host.valid_url() if ValidUrl == True: playlink = RESOLVE.resolve(url) else: playlink = url try: Play.play(playlink) except: pass
def resolver(url, subtitle): try: resolved = resolveurl.resolve(url) except: resolved = '' sub = [] if subtitle > '': sub.append(subtitle) if resolved > '': player('', resolved, sub) else: notify('Não foi possivel reproduzir o video.')
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 #TO BE REMOVED SOON if 'Aika' in hostname: mp4 = url if 'Streamango' in hostname: mp4 = resolveurl.resolve(url) if 'Mystream' in hostname: link = requests.get(url) link = (link.text).encode('utf-8') link = link.split('<source src="', 1)[1] link = link.split('" type="video/mp4"', 1)[0] mp4 = link mp4 = str(mp4) return mp4
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 getdirect(hostname, url, quality, embed_id): if 'Stream.moe' in hostname: mp4 = resolveurl.resolve(url) if 'MP4Upload' in hostname: mp4 = resolveurl.resolve(url) if 'Bakavideo' in hostname: #Couldn't actually find any instances of bakavideo on Masterani so I'll assume the original way works. #Actually believe that the site doesn't exist anymore content = re.compile("go\((.+?)\)").findall(client.request(url))[0] content = content.replace("'", "").replace(", ", "/") content = "https://bakavideo.tv/" + content content = client.request(content) content = json.loads(content) content = content['content'] content = base64.b64decode(content) mp4s = client.parsedom(content, 'source', ret='src') mp4 = "" for link in mp4s: if str(quality) in link: mp4 = link if mp4 is "": mp4 = mp4s[0] if 'Beta' in hostname: #Same as Bakavideo, I couldn't actually find any Aniupload on the site, but if it is still there I'll assume the original way works. mp4 = embed_id if 'Vidstreaming' in hostname: mp4 = resolveurl.resolve(url) if 'Aniupload' in hostname: #Same as Bakavideo, I couldn't actually find any Aniupload on the site, but if it is still there I'll assume the original way works. mp4 = re.compile("\(\[\{src: \"(.+?)\"").findall(client.request(url))[0] if 'Openload' in hostname: mp4 = resolveurl.resolve(url) if 'Drive.g' in hostname: mp4 = resolveurl.resolve(url) if 'Rapidvideo' in hostname: duration=10000 #in milliseconds message = "Cannot Play URL" stream_url = resolveurl.HostedMediaFile(url=url).resolve() # If urlresolver returns false then the video url was not resolved. 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 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 #TO BE REMOVED SOON if 'Aika' in hostname: mp4 = url if 'Streamango' in hostname: mp4 = resolveurl.resolve(url) if 'Mystream' in hostname: link = requests.get(url) link = (link.text).encode('utf-8') link = link.split('<source src="', 1)[1] link = link.split('" type="video/mp4"', 1)[0] mp4 = link if 'Tiwi.kiwi' in hostname: viewpage = client.request("https://tiwi.kiwi/" + embed_id + "#") hashsnip = re.compile("(?<=\,\\')(.*)(?=\\')").findall(viewpage)[0] # find hash qualitynum = "o" # original if quality is 720: qualitynum = "n" # normal (720p) elif quality is 480: qualitynum = "l" # low (480p) urlsnip = "dl?op=download_orig&id=" + embed_id + "&mode=" + qualitynum + "&hash=" + hashsnip downloadpage = client.request("https://tiwi.kiwi/" +urlsnip) mp4Raw = re.compile("href=\"(.+?mp4)").findall(downloadpage)[0] try: from urllib import quote except: pass mp4 = quote(mp4Raw, safe="%/:=&?~#+!$,;'@()*[]") mp4 = str(mp4) return mp4
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: rv = requests.get(url + '&q=%sp' % quality) link = (rv.text).encode('utf-8') link = link.split('<source src="', 1)[1] link = link.split('" type="video/mp4"', 1)[0] mp4 = link #AIKA TO BE REMOVED SOON if 'Aika' in hostname: mp4 = url if 'Streamango' in hostname: mp4 = resolveurl.resolve(url) if 'Mystream' in hostname: link = requests.get(url) link = (link.text).encode('utf-8') link = link.split('<source src="', 1)[1] link = link.split('" type="video/mp4"', 1)[0] mp4 = link if 'Tiwi.kiwi' in hostname: viewpage = client.request("https://tiwi.kiwi/" + embed_id + "#") hashsnip = re.compile("(?<=\,\\')(.*)(?=\\')").findall(viewpage)[0] # find hash qualitynum = "o" # original if quality is 720: qualitynum = "n" # normal (720p) elif quality is 480: qualitynum = "l" # low (480p) urlsnip = "dl?op=download_orig&id=" + embed_id + "&mode=" + qualitynum + "&hash=" + hashsnip downloadpage = client.request("https://tiwi.kiwi/" +urlsnip) mp4Raw = re.compile("href=\"(.+?mp4)").findall(downloadpage)[0] try: from urllib import quote except: pass mp4 = quote(mp4Raw, safe="%/:=&?~#+!$,;'@()*[]") mp4 = str(mp4) return mp4