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 = 'Resolve URL 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 hmf.HostedMediaFile(url).valid_url(): url = hmf.HostedMediaFile(url).resolve() except: pass kodi.idle() return url except: try: if hmf.HostedMediaFile(url[0][1]).valid_url(): url = hmf.HostedMediaFile(url[0][1]).resolve() return url except: pass
def __parse_gplus(self, html): sources = [] match = re.search('<c-wiz.+?track:impression,click".*?jsdata\s*=\s*".*?(http[^"]+)"', html, re.DOTALL) if match: source = match.group(1).replace('&', '&').split(';')[0] resolved = hmf.HostedMediaFile(url=source).resolve() if resolved: sources.append(('Unknown Quality', resolved)) return sources
def find(url, name=None, iconimage=None, pattern=None): kodi.busy() try: url, site = url.split('|SPLIT|') except: site = 'Unknown' log_utils.log('Error getting site information from :: %s' % (url), xbmc.LOGERROR) try: if 'streamingporn.xyz' in url: c = client.request(url) r = dom_parser2.parse_dom(c, 'a', req=['href', 'class', 'rel', 'target']) r = [i for i in r if i.attrs['class'] == 'external'] r = [client.request(i.attrs['href'], output='geturl') for i in r] r = [i for i in r if hmf.HostedMediaFile(i).valid_url()] url = multi(r) elif 'spreadporn.org' in url: c = client.request(url) r = dom_parser2.parse_dom(c, 'li', req=['data-show', 'data-link']) r = [(i.attrs['data-link']) for i in r] url = multi(r) elif 'pandamovie.eu' in url: c = client.request(url) r = dom_parser2.parse_dom(c, 'a', req='id') r = [(i.attrs['href']) for i in r] url = multi(r) elif 'xtheatre.net' in url: c = client.request(url) pattern = '''<iframe\s*src=['"](?:[^'"]+)['"]\s*data-lazy-src=['"]([^'"]+)''' r = re.findall(pattern, c) url = multi(r) elif 'sexkino.to' in url: c = client.request(url) u = dom_parser2.parse_dom(c, 'iframe', {'class': ['metaframe', 'rptss']}) r = dom_parser2.parse_dom(c, 'tr') r = [dom_parser2.parse_dom(i, 'a', req='href') for i in r] r = [client.request(i[0].attrs['href']) for i in r if i] r = [i.attrs['src'] for i in u] + [ re.findall("window.location.href='([^']+)", i)[0] for i in r ] url = multi(r) except: kodi.idle() kodi.notify(msg='Error getting link for (Link Finer) %s' % name) kodi.idle() quit() url += '|SPLIT|%s' % site kodi.idle() player.resolve_url(url, name, iconimage)
def multi(r): r = [(re.findall('(?://)(?:www.)?([^.]+).', i)[0].title(), i) for i in r if hmf.HostedMediaFile(i).valid_url()] names = [] srcs = [] if len(r) > 1: for i in sorted(r, reverse=True): names.append(kodi.giveColor(i[0], 'white', True)) srcs.append(i[1]) selected = kodi.dialog.select('Select a link.', names) if selected < 0: kodi.notify(msg='No option selected.') kodi.idle() quit() else: url = srcs[selected] return url else: return r[0][1]
def find_link(url, name, iconimage, downloadableLink=False): xbmc.executebuiltin("ActivateWindow(busydialog)") if '|SPLIT|' in url: url = url.split('|SPLIT|')[0] if 'site=' in url: url = url.split('site=')[0] if '|' in url: url = url.split('|User-Agent')[0] c = client.request(url, output='headers') checks = ['video', 'mpegurl'] exts = ['.mp4', '.flv', '.m3u8'] try: if any(f for f in checks if f in c['Content-Type']): downloadableLink = True except: if any(f for f in exts if f in url): downloadableLink = True else: xbmc.executebuiltin("Dialog.Close(busydialog)") kodi.notify(msg='Error downloading video.') quit() name = kodi.stripColor(name) if '] -' in name: name = name.split('] -')[1] if downloadableLink: dest = getDest() dest = os.path.join(dest, '%s.mp4' % quote_plus(name)) download(url, name, iconimage, dest) else: u = None log_utils.log('Sending %s to XXX Resolver' % (url), xbmc.LOGNOTICE) if hmf.HostedMediaFile(url).valid_url(): log_utils.log( '%s is a valid SMR resolvable URL. Attempting to resolve.' % (url), xbmc.LOGNOTICE) try: u = hmf.HostedMediaFile(url).resolve() except Exception as e: log_utils.log( 'Error getting valid link from SMR :: %s :: %s' % (url, str(e)), xbmc.LOGERROR) kodi.idle() kodi.notify(msg='Something went wrong! | %s' % str(e), duration=8000, sound=True) quit() log_utils.log('Link returned by XXX Resolver :: %s' % (u), xbmc.LOGNOTICE) else: log_utils.log( '%s is not a valid SMR resolvable link. Attempting to resolve by AdultFlix backup resolver.' % (url), xbmc.LOGNOTICE) try: u = adultresolver.resolve(url) except Exception as e: log_utils.log( 'Error getting valid link from SMR :: %s :: %s' % (url, str(e)), xbmc.LOGERROR) kodi.idle() kodi.notify(msg='Something went wrong! | %s' % str(e), duration=8000, sound=True) quit() log_utils.log('%s returned by AdultFlix backup resolver.' % (u), xbmc.LOGNOTICE) if not isinstance(u, str): try: u = multilinkselector(u) except: pass if u == 'quit': xbmc.executebuiltin("Dialog.Close(busydialog)") quit() if u: dest = getDest() dest = os.path.join(dest, '%s.tmp_mp4' % quote_plus(name)) download(u, name, iconimage, dest) else: xbmc.executebuiltin("Dialog.Close(busydialog)") kodi.notify('No Downloadable Link Found.') quit()
def resolve_url(url, name=None, iconimage=None, pattern=None): kodi.busy() try: url, site = url.split('|SPLIT|') except: site = 'Unknown' log_utils.log('Error getting site information from :: %s' % (url), xbmc.LOGERROR) if not name: name = 'Unknown' if not iconimage: iconimage = kodi.addonicon name = re.sub(r'(\[.+?\])', '', name) name = name.lstrip() if '] - ' in name: name = name.split('] - ')[-1] if 'site=' in url: url, site = url.split('site=') if '|CHAT|' in url: url, site, name = url.split('|CHAT|') if '- [' in name: name = name.split('- [')[0] u = None log_utils.log('Sending %s to XXX Resolver' % (url), xbmc.LOGNOTICE) if hmf.HostedMediaFile(url).valid_url(): log_utils.log('%s is a valid SMR resolvable URL. Attempting to resolve.' % (url), xbmc.LOGNOTICE) try: u = hmf.HostedMediaFile(url).resolve() except Exception as e: log_utils.log('Error getting valid link from SMR :: %s :: %s' % (url, str(e)), xbmc.LOGERROR) kodi.idle() kodi.notify(msg='Something went wrong! | %s' % str(e), duration=8000, sound=True) quit() log_utils.log('Link returned by XXX Resolver :: %s' % (u), xbmc.LOGNOTICE) else: log_utils.log('%s is not a valid SMR resolvable link. Attempting to resolve by AdultFlix backup resolver.' % (url), xbmc.LOGNOTICE) try: u = adultresolver.resolve(url) if u: if hmf.HostedMediaFile(u).valid_url(): u = hmf.HostedMediaFile(u).resolve() except Exception as e: log_utils.log('Error getting valid link from SMR :: %s :: %s' % (url, str(e)), xbmc.LOGERROR) kodi.idle() kodi.notify(msg='Something went wrong! | %s' % str(e), duration=8000, sound=True) quit() log_utils.log('%s returned by AdultFlix backup resolver.' % (u), xbmc.LOGNOTICE) if u == 'offline': kodi.idle() kodi.notify(msg='This performer is offline.', duration=5000, sound=True) quit() if u: kodi.idle() play(u, name, iconimage, url, site) else: kodi.idle() log_utils.log('Failed to get any playable link for :: %s' % (url), xbmc.LOGERROR) kodi.notify(msg='Failed to get any playable link.', duration=7500, sound=True) quit()