def Playvid(url, name, download=None): vp = utils.VideoPlayer(name, download) vp.progress.update(25, "[CR]Loading video page[CR]") try: listhtml = utils.getHtml(url, '') except: return None embed = re.compile("vid = '(.+?)'.+?hash = '(.+?)'", re.DOTALL | re.IGNORECASE).findall(listhtml)[0] vid = embed[0] s = embed[1] hash = ''.join( (encode_base_n(int(s[lb:lb + 8], 16), 36) for lb in range(0, 32, 8))) jsonUrl = 'https://www.eporner.com/xhr/video/' + vid + '?hash=' + hash + '&domain=www.eporner.com&fallback=false&embed=true&supportedFormats=dash,mp4' listJson = utils.getHtml(jsonUrl, '') videoJson = json.loads(listJson) vp.progress.update(75, "[CR]Loading video page[CR]") videoArray = {} for (k, v) in videoJson['sources']['mp4'].items(): videoArray[k] = v['src'] videourl = utils.prefquality( videoArray, sort_by=lambda x: int(''.join([y for y in x if y.isdigit()])), reverse=True) if videourl: vp.play_from_direct_link(videourl)
def PTPlayvid(url, name, download=None): vp = utils.VideoPlayer(name, download) vp.progress.update(25, "[CR]Loading video page[CR]") hdr = dict(utils.base_hdrs) hdr['Cookie'] = get_cookies() videopage = utils.getHtml(url, site.url, headers=hdr) if 'video_url_text' not in videopage: videourl = re.compile("video_url: '([^']+)'", re.DOTALL | re.IGNORECASE).search(videopage).group(1) else: sources = {} srcs = re.compile( "video(?:_alt_|_)url(?:[0-9]|): '([^']+)'.*?video(?:_alt_|_)url(?:[0-9]|)_text: '([^']+)'", re.DOTALL | re.IGNORECASE).findall(videopage) for src, quality in srcs: sources[quality] = src videourl = utils.prefquality( sources, sort_by=lambda x: int(''.join([y for y in x if y.isdigit()])), reverse=True) if not videourl: vp.progress.close() return vp.progress.update(75, "[CR]Video found[CR]") vp.play_from_direct_link(videourl)
def BGPlayvid(url, name, download=None): bgversion = addon.getSetting('bgversion') vp = utils.VideoPlayer(name, download) vp.progress.update(25, "[CR]Loading video page[CR]") videopage = utils.getHtml(url, site.url) videopage = json.loads(videopage) videourls = {} if videopage["240p"]: videourls.update({"240p": videopage["240p"]}) if videopage["480p"]: videourls.update({"480p": videopage["480p"]}) if videopage["720p"]: videourls.update({"720p": videopage["720p"]}) if videopage["1080p"]: videourls.update({"1080p": videopage["1080p"]}) if videopage["2160p"]: videourls.update({"2160p": videopage["2160p"]}) videourl = utils.prefquality(videourls, sort_by=lambda x: int(''.join([y for y in x if y.isdigit()])), reverse=True) if not videourl: return DATA_MARKERS = 'data=pc_XX__{}_'.format(bgversion) videourl = videourl.format(DATA_MARKERS=DATA_MARKERS) if videourl.startswith("//"): videourl = "https:" + videourl vp.play_from_direct_link(videourl)
def Playvid(url, name, download=None): vp = utils.VideoPlayer(name, download) vp.progress.update(25, "[CR]Loading video page[CR]") html = utils.getHtml(url) sources = re.findall(r"video(?:_alt)?_url:\s*'([^']+).+?text:\s*'([^']+)", html) if sources: sources = {label: url for url, label in sources} surl = utils.prefquality( sources, sort_by=lambda x: int(''.join([y for y in x if y.isdigit()])), reverse=True) if surl.startswith('function/'): lcode = re.findall(r"license_code:\s*'([^']+)", html)[0] surl = '{0}|User-Agent=iPad&Referer={1}/'.format( kvs_decode(surl, lcode), site.url) if not surl: vp.progress.close() return vp.progress.update(75, "[CR]Video found[CR]") vp.progress.close() if download == 1: utils.downloadVideo(surl, name) else: vp.play_from_direct_link(surl)
def Playvid(url, name, download=None): vp = utils.VideoPlayer(name, download, regex='<a href="([^"]+)" target="_blank"') vp.progress.update(25, "[CR]Loading video page[CR]") videohtml = utils.getHtml(url, site.url) match = re.compile( r'class="embed-container"><iframe loading="lazy" src="([^"]+)"', re.IGNORECASE | re.DOTALL).findall(videohtml) if match: iframeurl = match[0] iframehtml = utils.getHtml(iframeurl, url) match = re.compile(r'FirePlayer\(vhash, ({.+?}), false\);', re.IGNORECASE | re.DOTALL).findall(iframehtml) if match: j = json.loads(match[0]) videourl = j["videoUrl"] videoserver = j["videoServer"] url1 = 'https://onetvplus.xyz' + videourl + '?s={}&d='.format( videoserver) hdr = dict(utils.base_hdrs) hdr['Accept'] = '*/*' html = utils.getHtml(url1, iframeurl, headers=hdr) match = re.compile(r'#EXT.+?RESOLUTION=(\d+x\d+)\s*([^#]+)', re.IGNORECASE | re.DOTALL).findall(html) if match: links = {} for key, value in match: links[key] = value.strip() videourl = utils.prefquality( links, sort_by=lambda x: int(x.split('x')[0]), reverse=True) if videourl: vp.play_from_direct_link(videourl + '|Referer=' + iframeurl)
def Play(url, name, download=None): vp = utils.VideoPlayer(name, download) videopage = utils.getHtml(url, site.url) sources = re.compile(r'data-hls-src(\d+)="([^"]+)', re.DOTALL | re.IGNORECASE).findall(videopage) if sources: sources = {key: value for key, value in sources} videourl = utils.prefquality(sources, reverse=True) vp.play_from_direct_link(videourl.replace('&', '&'))
def getFly(url): videopage = utils.getHtml(url, '') videos = re.compile(r'''source\s*src=['"]([^'"]+).+?label=['"]([^'"]+)''', re.DOTALL | re.IGNORECASE).findall(videopage) if videos: videos = {label: url for url, label in videos} videourl = utils.prefquality(videos, sort_by=lambda x: int(''.join([y for y in x if y.isdigit()])), reverse=True) if videourl.startswith('//'): videourl = 'https:' + videourl return videourl
def getBMW(url): videopage = utils.getHtml(url, '') videos = re.compile(r'source\s*src=\\"([^\\]+).+?\\"([^\\\s]+)', re.DOTALL | re.IGNORECASE).findall(videopage) if not videos: videos = re.compile(r'file:\s*"([^"]+mp4)",\s*label:\s*"\d+', re.DOTALL | re.IGNORECASE).findall(videopage) if videos: videos = {label: url for url, label in videos} videourl = utils.prefquality(videos, sort_by=lambda x: int(''.join([y for y in x if y.isdigit()])), reverse=True) if videourl.startswith('//'): videourl = 'https:' + videourl return videourl
def getHQWO(url): epage = utils.getHtml(url, '') eurl = re.compile(r'''<script[^\n]+src='([^']+)''', re.DOTALL | re.IGNORECASE).findall(epage)[0] videopage = utils.getHtml(eurl, 'https://hqwo.cc/') videos = re.compile(r'''file":\s*"([^"]+).+?label":\s*"([^"]+)''', re.DOTALL | re.IGNORECASE).findall(videopage) if videos: videos = {label: url for url, label in videos} videourl = utils.prefquality(videos, sort_by=lambda x: int(''.join([y for y in x if y.isdigit()])), reverse=True) if videourl.startswith('//'): videourl = 'https:' + videourl return videourl
def Playvid(url, name, download=None): vp = utils.VideoPlayer(name, download) videopage = utils.getHtml(url, '') videopage = re.compile(r'player-wrapper(.+?)container', re.DOTALL | re.IGNORECASE).findall(videopage)[0] eurl = re.compile(r'<iframe.+?src="([^"]+)', re.DOTALL | re.IGNORECASE).search(videopage) if eurl: vp.play_from_link_to_resolve(eurl.group(1)) else: sources = re.compile(r'"file":\s*"([^"]+).+?"label":\s"([^"]+)', re.DOTALL | re.IGNORECASE).findall(videopage) if sources: sources = {key: value for value, key in sources} videourl = utils.prefquality(sources, reverse=True) vp.play_from_direct_link(videourl)
def Playvid(url, name): url, performerID = url.split('$$') response = utils._getHtml("https://streamate.com/ajax/config/?name=" + url + "&sakey=&sk=streamate.com&userid=0&version=2.2.0&ajax=1") data = json.loads(response) host = data['liveservices']['host'] + "/socket.io/?puserid=" + performerID + "&EIO=3&transport=websocket" ws = websocket.WebSocket() ws = websocket.create_connection(host) ws.send('40/live') quitting = 0 i = 0 while quitting == 0: i += 1 message = ws.recv() match = re.compile('performer offline', re.DOTALL | re.IGNORECASE).findall(message) if match: quitting = 1 ws.close() utils.notify('Model is offline') return None match = re.compile('isPaid":true', re.DOTALL | re.IGNORECASE).findall(message) if match: quitting = 1 ws.close() utils.notify('Model not in freechat') return None if message == '40/live': ws.close() quitting = 1 playmode = int(utils.addon.getSetting('chatplay')) videourl = '' response = utils._getHtml("https://manifest-server.naiadsystems.com/live/s:{0}.json?last=load&format=mp4-hls".format(url)) data = json.loads(response).get('formats') if playmode == 0: videourl = data.get('mp4-hls').get('manifest') elif playmode == 1: sources = {'{0}p'.format(item['videoHeight']): item['location'] for item in data.get('mp4-rtmp').get('encodings')} videourl = utils.prefquality(sources, sort_by=lambda x: int(''.join([y for y in x if y.isdigit()])), reverse=True) if videourl: vp = utils.VideoPlayer(name) vp.play_from_direct_link(videourl) else: utils.notify('Oh oh', 'Couldn\'t find a playable webcam link') return
def Playvid(url, name, download=None): vp = utils.VideoPlayer(name, download) vp.progress.update(25, "[CR]Loading video page[CR]") videopage = utils.getHtml(url, '') srcs = re.compile(r"video_(?:alt_|)url:\s*'([^']+)'.+?video_(?:alt_|)url_text:\s*'([^']+)'", re.DOTALL | re.IGNORECASE).findall(videopage) sources = {} for videourl, quality in srcs: if videourl: sources[quality] = videourl videourl = utils.prefquality(sources, sort_by=lambda x: 1081 if x == '4k' else int(x[:-1]), reverse=True) if videourl: vp.progress.update(75, "[CR]Loading video page[CR]") vp.play_from_direct_link(videourl)
def Play(url, name, download=None): vp = utils.VideoPlayer(name, download) vp.progress.update(25, "[CR]Loading video page[CR]") html = utils.getHtml(url, site.url) sources = re.compile(r'<a\s*class="video-links__link"\s*href="([^"]+)"\s*no-load-content>([^\s]+)').findall(html) if sources: sources = {key: value for value, key in sources} videourl = utils.prefquality(sources, reverse=True) if not videourl: vp.progress.close() return vp.progress.update(75, "[CR]Video found[CR]") vp.progress.close() if download == 1: utils.downloadVideo(videourl, name) else: vp.play_from_direct_link(videourl)
def Playvid(url, name, download=None): vp = utils.VideoPlayer(name, download) vp.progress.update(25, "[CR]Loading video page[CR]") html = utils.getHtml(url, '') sources = {} srcs = re.compile( r'''["'](240p|320p|480p|720p|1080p|4k)["']:\s*\[["']([^"']+)''', re.DOTALL | re.IGNORECASE).findall(html) for quality, videourl in srcs: if videourl: sources[quality] = videourl videourl = utils.prefquality(sources, sort_by=lambda x: 1081 if x == '4k' else int(x[:-1]), reverse=True) if not videourl: return vp.play_from_direct_link(videourl.replace(r'\u0026', '&'))
def Play(url, name, download=None): vp = utils.VideoPlayer(name, download=download) videohtml = utils.getHtml(url) match = re.compile(r'<iframe[^>]+src="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(videohtml) if not match: return playerurl = match[0] playerhtml = utils.getHtml(playerurl, url) match = re.compile(r'src="([^"]+)" title="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(playerhtml) videos = {} for m in match: videos[m[1]] = m[0] videourl = utils.prefquality(videos, sort_by=lambda x: int(x[:-1]), reverse=True) if videourl: vp.play_from_direct_link(videourl)
def Playvid(url, name, download=None): vp = utils.VideoPlayer(name, download) vp.progress.update(25, "[CR]Loading video page[CR]") videopage = utils.getHtml(url, site.url) eurls = re.compile(r'<li><a\s*href="([^"]+)"\s*>\s*([^<]+)', re.DOTALL | re.IGNORECASE).findall(videopage) sources = {} for eurl, ename in eurls: if eurl != '?server=1': videopage = utils.getHtml(url + eurl, '') embedurl = re.compile('<iframe.+?src="([^"]+)', re.DOTALL | re.IGNORECASE).findall(videopage)[0] if 'filestar.club' in embedurl: embedurl = utils.getVideoLink(embedurl, url) if '//' in embedurl: sources[enames[ename]] = embedurl videourl = utils.selector('Select Hoster', sources) if not videourl: vp.progress.close() return if 'gdriveplayer.to' in videourl: videourl = videourl.split('data=')[-1] while '%' in videourl: videourl = urllib_parse.unquote(videourl) videohtml = utils.getHtml('https:' + videourl, site.url) ptext = jsunpack.unpack(videohtml).replace('\\', '') ct = re.findall(r'"ct":"([^"]+)', ptext)[0] salt = codecs.decode(re.findall(r'"s":"([^"]+)', ptext)[0], 'hex') pf = re.findall(r"null,\s*'([^']+)", ptext, re.S)[0] pf = re.compile(r"[a-zA-Z]{1,}").split(pf) passphrase = ''.join([chr(int(c)) for c in pf]) passphrase = re.findall(r'var\s+pass\s*=\s*"([^"]+)', passphrase)[0] from resources.lib.jscrypto import jscrypto etext = jscrypto.decode(ct, passphrase, salt) ctext = jsunpack.unpack(etext).replace('\\', '') frames = re.findall(r'sources:\s*(\[[^]]+\])', ctext)[0] frames = re.findall(r'file":"([^"]+)[^}]+label":"(\d+p)"', frames) t = int(time.time() * 1000) sources = { qual: "{0}{1}&ref={2}&res={3}".format(source, t, site.url, qual) for source, qual in frames } surl = utils.prefquality(sources) if surl: if surl.startswith('//'): surl = 'https:' + surl vp.play_from_direct_link(surl) vp.progress.close() return elif 'motonews' in videourl: if videourl.startswith('//'): videourl = 'https:' + videourl epage = utils.getHtml(videourl, url) s = re.findall(r'file":"(?P<url>[^"]+)","label":"(?P<label>[^"]+)', epage) if s: sources = {qual: source.replace('\\/', '/') for source, qual in s} surl = utils.prefquality(sources) if surl.startswith('//'): surl = 'https:' + surl vp.play_from_direct_link(surl + '|Referer={0}&verifypeer=false'.format( urllib_parse.urljoin(videourl, '/'))) else: vp.progress.close() utils.notify('Oh oh', 'No video found') return else: vp.play_from_link_to_resolve(videourl)
def BGPlayvid(url, name, download=None): playall = True if utils.addon.getSetting( "paradisehill") == "true" else False vp = utils.VideoPlayer(name, download) vp.progress.update(25, "[CR]Loading video page[CR]") # listjson = utils.getHtml(url, site.url) # jdata = json.loads(listjson) listjson = base64.b64decode(url) jdata = json.loads(listjson.decode()) fc_facts = jdata["fc_facts"] if len(fc_facts) == 1: if "hls_resources" in jdata["file"]: videos = jdata["file"]["hls_resources"] else: videos = jdata["fc_facts"][0]["hls_resources"] playall = False else: links = {} for i, fc_fact in enumerate( sorted(fc_facts, key=lambda x: x["fc_start"])): start = fc_fact["fc_start"] end = fc_fact["fc_end"] m, s = divmod(start, 60) stxt = '{:d}:{:02d}'.format(m, s) m, s = divmod(end, 60) etxt = '{:d}:{:02d}'.format(m, s) part = ' part {} ({} - {})'.format(str(i + 1), stxt, etxt) links[part] = fc_fact["hls_resources"] if len(links) < 2: playall = False if not playall: videos = utils.selector('Select part:', links) if not playall: if videos: videos = { key.replace('fl_cdn_', ''): videos[key] for key in videos.keys() } key = utils.prefquality(videos, sort_by=lambda x: int(x), reverse=True) if key: vp.progress.update(75, "[CR]Loading video page[CR]") videourl = 'https://video.beeg.com/' + key + '|Referer={}'.format( site.url) vp.play_from_direct_link(videourl) if playall: if links: iconimage = xbmc.getInfoImage("ListItem.Thumb") pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) pl.clear() for video in links: vp.progress.update(75, "[CR]Adding part to playlist[CR]") videos = links[video] videos = { key.replace('fl_cdn_', ''): videos[key] for key in videos.keys() } key = utils.prefquality(videos, sort_by=lambda x: int(x), reverse=True) newname = name + video listitem = xbmcgui.ListItem(newname) listitem.setArt({ 'thumb': iconimage, 'icon': "DefaultVideo.png", 'poster': iconimage }) listitem.setInfo('video', {'Title': newname, 'Genre': 'P**n'}) listitem.setProperty("IsPlayable", "true") videourl = 'https://video.beeg.com/' + key + '|Referer={}'.format( site.url) pl.add(videourl, listitem) listitem = '' xbmc.Player().play(pl)