def TextWindow(Text): kodi.idle() global msg_text msg_text = Text window = Main('') window.doModal() del window
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 __init__(self): self.firstRunFile = os.path.join(kodi.datafolder, 'firstrun.txt') self.informationFile = os.path.join(kodi.addonfolder, 'resources/files/information.txt') if (not os.path.isfile(self.firstRunFile)): self.checkAge() kodi.busy() try: countme = client.request('http://bit.ly/2vchTCP') except: pass kodi.idle() try: local_utils.viewDialog(self.informationFile) except: pass return
def resolve_url(url, name=None, iconimage=None): kodi.busy() if 'motherless.com' in url: r = client.request(url) img = re.findall('''<meta\s*property=["']og:image["']\s*content=["']([^'"]+)''', r)[0] SHOW = "ShowPicture(" + img + ')' kodi.idle() xbmc.executebuiltin(SHOW) elif '8muses.com' in url: try: r = client.request(url) dir = re.findall('''<input\s*type=['"]hidden['"]\s*id=['"]imageDir['"]\s*value=['"]([^'"]+)''', r)[0] icon_id = re.findall('''<input\s*type=['"]hidden['"]\s*id=['"]imageName['"]\s*value=['"]([^'"]+)''', r)[0] display_url = 'https://cdn.ampproject.org/i/s/www.8muses.com/%ssmall/%s' % (dir,icon_id) SHOW = "ShowPicture(" + display_url + ')' except: SHOW = "ShowPicture(" + url + ')' kodi.idle() xbmc.executebuiltin(SHOW) else: SHOW = "ShowPicture(" + url + ')' kodi.idle() xbmc.executebuiltin(SHOW)
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(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 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()
def play(url, name, iconimage=None, ref=None, site=None): try: kodi.busy() if not site: if 'site=' in url: url, site = url.split('site=') else: site = 'Unknown' 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] chatur = False if ref: if 'chaturbate.com' in ref: chatur = True else: ref = '' if 'chaturbate.com' in url: chatur = True ref = url url = adultresolver.resolve(url) if (isinstance(url, list)): try: url = multilinkselector(url) except: pass history_on_off = kodi.get_setting("history_setting") if history_on_off == "true": web_checks = ['http:', 'https:', 'rtmp:'] locak_checks = ['.mp4'] try: if any(f for f in web_checks if f in url): site = site.title() elif any(f for f in locak_checks if f in url): site = 'Local File' else: site = 'Unknown' except: site = site.title() # if chatur: history.delEntry(ref) history.addHistory(name, ref, site.title(), iconimage) # else: # history.delEntry(url) # history.addHistory(name, url, site.title(), iconimage) kodi.idle() if 'chaturbate.com' in ref: if kodi.get_setting("mobile_mode") == 'true': url = url.replace('_fast_aac', '_aac') else: bandwidth = kodi.get_setting("chaturbate_band") if bandwidth == '0': url = url.replace('_fast_aac', '_aac') elif bandwidth == '2': choice = kodi.dialog.select("[COLOR white][B]" + name + "[/B][/COLOR]", ['[COLOR white]Play High Bandwidth Stream[/COLOR]', '[COLOR white]Play Low Bandwidth Stream[/COLOR]']) if choice == 1: url = url.replace('_fast_aac', '_aac') elif choice == 0: pass else: quit() liz = xbmcgui.ListItem(name, iconImage=iconimage, thumbnailImage=iconimage) xbmc.executebuiltin("Dialog.Close(busydialog)") xbmc.Player().play(url, liz, False) if kodi.get_setting("chaturbate_subject") == "true": sleeper = kodi.get_setting("chaturbate_subject_refresh") i = 0 while not xbmc.Player().isPlayingVideo(): time.sleep(1) i += 1 if i == 30: quit() while xbmc.Player().isPlayingVideo(): try: r = client.request(ref) subject = re.compile('default_subject:\s\"([^,]+)",').findall(r)[0] subject = unquote_plus(subject) kodi.notify(msg=subject, duration=8500, sound=True, icon_path=iconimage) except: pass time.sleep(int(sleeper)) else: liz = xbmcgui.ListItem(name, iconImage=iconimage, thumbnailImage=iconimage) xbmc.Player().play(url, liz, False) except: kodi.idle() kodi.notify(msg='Error playing %s' % name)