def rojadirecta_resolver(name, url): print name, url if "sop://" not in url and "acestream://" not in url: if "http://" not in url: url = "http://" + url try: source = abrir_url(url) except: source = "" mensagemok(traducao(40000), traducao(40128)) matchredirect = re.compile('<frame src="(.+?)"').findall(source) matchsop = re.compile('sop://(.+?)"').findall(source) if matchsop: sop.sopstreams(name, os.path.join(current_dir, 'icon.png'), "sop://" + matchsop[0]) else: match = re.compile('this.loadPlayer\("(.+?)"').findall(source) if match: ace.acestreams(name, os.path.join(current_dir, 'icon.png'), match[0]) else: if matchredirect: rojadirecta_resolver(name, matchredirect[0]) else: mensagemok(traducao(40000), traducao(40022)) elif "sop://" in url: so.sopstreams(name, os.path.join(current_dir, 'icon.png'), url) elif "acestream://" in url: ace.acestreams(name, os.path.join(current_dir, 'icon.png'), url) else: mensagemok(traducao(40000), traducao(40022))
def go_to_id(p2p_type): if p2p_type == 'ace': keyb = xbmc.Keyboard('', translate(40033)) keyb.doModal() if (keyb.isConfirmed()): search = keyb.getText() if search == '': sys.exit(0) else: channel_id = search ace.acestreams( translate(40035) + ' ( ' + str(channel_id) + ')', '', str(channel_id)) elif p2p_type == 'sop_id': channel_id = xbmcgui.Dialog().numeric(0, translate(40033)) sop.sopstreams( translate(40035) + ' ( ' + str(channel_id) + ')', '', str(channel_id)) elif p2p_type == 'sop_url': keyb = xbmc.Keyboard('sop://', translate(40034) + ' sop://') keyb.doModal() if (keyb.isConfirmed()): search = keyb.getText() if search == '': sys.exit(0) else: channel_id = search sop.sopstreams( translate(40036) + ' ( ' + str(channel_id) + ')', '', str(channel_id))
def tron_play(name, url): conteudo = clean(get_page_source('http://m.tvron.net' + url)) blogpost = re.findall( '<div id="servere"><div class="smb">(.+?)<div id="programinfo">', conteudo, re.DOTALL) if blogpost: ender = [] titulo = [] match = re.compile( '<a class="server" href="(.+?)" target="_blank"><img src=".+?">(.+?)</a>' ).findall(blogpost[0]) for address, nume in match: if "sop://" in address: titulo.append('' + nume + ' - ' + name + ' sopcast link') ender.append(address) elif "acestream://" in address: titulo.append('' + nume + ' - ' + name + ' acestream link') ender.append(address) else: pass if ender and titulo: index = xbmcgui.Dialog().select(translate(40023), titulo) if index > -1: nomeescolha = titulo[index] linkescolha = ender[index] if re.search('acestream', nomeescolha, re.IGNORECASE) or re.search( 'TorrentStream', nomeescolha, re.IGNORECASE): ace.acestreams(nomeescolha, '', linkescolha) elif re.search('sopcast', nomeescolha, re.IGNORECASE): sop.sopstreams(nomeescolha, '', linkescolha) else: xbmcgui.Dialog().ok(translate(40000), translate(40024)) else: xbmcgui.Dialog().ok(translate(40000), translate(40008))
def test_channel(): keyb = xbmc.Keyboard('', translate(30166)) keyb.doModal() if (keyb.isConfirmed()): search = keyb.getText() if search == '': sys.exit(0) else: if search.startswith("acestream://"): url_addr = search ace.acestreams( translate(30020) + ' ( ' + str(url_addr) + ')', '', str(url_addr)) elif search.startswith("sop://"): url_addr = search sop.sopstreams( translate(30021) + ' ( ' + str(url_addr) + ')', '', str(url_addr)) elif (search.startswith("http://")) or (search.startswith( "https://")) or (search.startswith("rtmp://")) or ( search.startswith("rtsp://")) or ( search.startswith("mmsh://")): url_addr = search playstream( translate(30021) + ' ( ' + str(url_addr) + ')', '', str(url_addr)) elif search.startswith("sopid:"): url_addr = str(search).replace("sopid:", "") sop.sopstreams( translate(30020) + ' ( ' + str(url_addr) + ')', '', str(url_addr)) else: messageok(translate(30000), translate(30011))
def sopcast_ucoz_play(name, url): conteudo = clean(get_page_source(url)) blogpost = re.findall('<tr><td class="eMessage">(.*?)<tr><td colspan', conteudo, re.DOTALL) if blogpost: ender = [] titulo = [] match = re.compile('br.+?>(.+?)<').findall(blogpost[0]) for address in match: if "sop://" in address: titulo.append('Sopcast [' + address + ']') ender.append(address) elif "(ace stream)" in address: titulo.append('Acestream [' + address.replace(' (ace stream)', '') + ']') ender.append(address.replace(' (ace stream)', '')) else: pass if ender and titulo: index = xbmcgui.Dialog().select(translate(40023), titulo) if index > -1: nomeescolha = titulo[index] linkescolha = ender[index] if re.search('acestream', nomeescolha, re.IGNORECASE) or re.search( 'TorrentStream', nomeescolha, re.IGNORECASE): ace.acestreams(nomeescolha, '', linkescolha) elif re.search('sopcast', nomeescolha, re.IGNORECASE): sop.sopstreams(nomeescolha, '', linkescolha) else: xbmcgui.Dialog().ok(translate(40000), translate(40024)) else: xbmcgui.Dialog().ok(translate(40000), translate(40008))
def playstream(name, iconimage, url): if url.startswith("sop://"): sop.sopstreams(name, iconimage, url) elif url.startswith("acestream://"): ace.acestreams(name, iconimage, url) elif (url.startswith("http://")) or (url.startswith("https://")) or ( url.startswith("rtmp://")) or (url.startswith("rtsp://")) or ( url.startswith("mmsh://")): if settings.getSetting('addon_history') == "true": try: add_to_history(name, str(url), 15, iconimage) except: pass playlist = xbmc.PlayList(1) playlist.clear() listitem = xbmcgui.ListItem(name, iconImage=iconimage, thumbnailImage=iconimage) listitem.setLabel(name) listitem.setInfo("Video", {"Title": name}) listitem.setProperty('mimetype', 'video/x-msvideo') listitem.setProperty('IsPlayable', 'true') listitem.setPath(url) playlist.add(url, listitem) xbmc.Player().play(playlist) else: messageok(translate(30000), translate(30182))
def arenavision_streams(name, url): headers = { 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'es-ES,es;q=0.9,ca;q=0.8,en;q=0.7', 'Cookie': 'beget=begetok; has_js=1;' } try: source = requests.get(url, headers=headers).text except: source = "" xbmcgui.Dialog().ok(translate(40000), translate(40128)) if source: match = re.compile('sop://(.+?)"').findall(source) if match: sop.sopstreams(name, os.path.join(current_dir, "icon.png"), "sop://" + match[0]) else: match = re.compile('href="(acestream://.+?)"').findall(source) if match: ace.acestreams(name, os.path.join(current_dir, "icon.png"), match[0]) else: xbmcgui.Dialog().ok(translate(40000), translate(40022))
def tron_play(name, url): conteudo = clean(get_page_source(url)) blogpost = re.findall( '<div class="player player-ch">(.+?)<div class="play-info">', conteudo, re.DOTALL) if blogpost: ender = [] titulo = [] match = re.compile('href="(acestream://|sop://.+?)"').findall( blogpost[0]) for address in match: if "sop://" in address: titulo.append('sopcast link') ender.append(address) elif "acestream://" in address: titulo.append('acestream link') ender.append(address) else: pass if ender and titulo: index = xbmcgui.Dialog().select(translate(40023), titulo) if index > -1: nomeescolha = titulo[index] linkescolha = ender[index] if re.search('acestream', nomeescolha, re.IGNORECASE) or re.search( 'TorrentStream', nomeescolha, re.IGNORECASE): ace.acestreams(nomeescolha, '', linkescolha) elif re.search('sopcast', nomeescolha, re.IGNORECASE): sop.sopstreams(nomeescolha, '', linkescolha) else: xbmcgui.Dialog().ok(translate(40000), translate(40024)) else: xbmcgui.Dialog().ok(translate(40000), translate(40008))
def arenavision_streams(name,url): headers = { "Cookie" : "beget=begetok; has_js=1;" } try: source = requests.get(url,headers=headers).text except: source="";xbmcgui.Dialog().ok(translate(40000),translate(40128)) if source: match = re.compile('sop://(.+?)"').findall(source) if match: sop.sopstreams(name,os.path.join(current_dir,"icon.png"),"sop://" + match[0]) else: match = re.compile('this.loadPlayer\("(.+?)"').findall(source) if match: ace.acestreams(name,os.path.join(current_dir,"icon.png"),match[0]) else: xbmcgui.Dialog().ok(translate(40000),translate(40022))
def lfol_play_stream(name, url, iconimage): try: source = requests.get(url).text except: source = "" xbmcgui.Dialog().ok(translate(40000), translate(40128)) if source: match = re.compile('href="(acestream\:.+?)">').findall(source) match2 = re.compile('href="(sop\:.+?)">').findall(source) if match: ace.acestreams(name, iconimage, match[0]) elif match2: sop.sopstreams(name, iconimage, match2[0]) else: xbmcgui.Dialog().ok(translate(40000), translate(40022))
def arenavision_streams(name, url): try: source = abrir_url(url) except: source = "" mensagemok(traducao(40000), traducao(40128)) if source: match = re.compile('sop://(.+?)"').findall(source) if match: sop.sopstreams(name, os.path.join(current_dir, "icon.png"), "sop://" + match[0]) else: match = re.compile('this.loadPlayer\("(.+?)"').findall(source) if match: ace.acestreams(name, os.path.join(current_dir, "icon.png"), match[0]) else: mensagemok(traducao(40000), traducao(40022))
def rojadirecta_resolver(name, url): if "sop://" not in url and "acestream://" not in url: if "http://" not in url: url = "http://" + url if 'arenavision' in url: headers = {"Cookie": "beget=begetok; has_js=1;"} try: source = requests.get(url, headers=headers).text except: source = "" xbmcgui.Dialog().ok(translate(40000), translate(40128)) else: try: source = get_page_source(url) except: source = "" xbmcgui.Dialog().ok(translate(40000), translate(40128)) matchredirect = re.compile( '<(?:frame|FRAME|iframe) (?:SRC|src)="(.+?)"').findall(source) matchsop = re.compile('sop://(.+?)"').findall(source) if matchsop: sop.sopstreams(name, os.path.join(current_dir, 'icon.png'), "sop://" + matchsop[0]) else: match = re.compile('this.loadPlayer\("(.+?)"').findall(source) if match: ace.acestreams(name, os.path.join(current_dir, 'icon.png'), match[0]) else: if matchredirect: if '/' not in matchredirect[0]: redirect_url = url + '/' + matchredirect[0] else: redirect_url = matchredirect[0] rojadirecta_resolver(name, redirect_url) else: xbmcgui.Dialog().ok(translate(40000), translate(40022)) elif "sop://" in url: sop.sopstreams(name, os.path.join(current_dir, 'icon.png'), url) elif "acestream://" in url: ace.acestreams(name, os.path.join(current_dir, 'icon.png'), url) else: xbmcgui.Dialog().ok(translate(40000), translate(40022))
def sopcast_ucoz_play(name, url): conteudo = clean(abrir_url(url)) blogpost = re.findall('<tr><td class="eMessage">(.*?)<tr><td colspan', conteudo, re.DOTALL) if blogpost: ender = [] titulo = [] match = re.compile('br.+?>(.+?)<').findall(blogpost[0]) print match for address in match: if "sop://" in address: titulo.append('Sopcast [' + address + ']') ender.append(address) elif "(ace stream)" in address: titulo.append('Acestream [' + address.replace(' (ace stream)', '') + ']') ender.append(address.replace(' (ace stream)', '')) else: pass if ender and titulo: index = xbmcgui.Dialog().select(traducao(40023), titulo) if index > -1: nomeescolha = titulo[index] linkescolha = ender[index] if re.search('acestream', nomeescolha, re.IGNORECASE) or re.search( 'TorrentStream', nomeescolha, re.IGNORECASE): ace.acestreams(nomeescolha, '', linkescolha) elif re.search('sopcast', nomeescolha, re.IGNORECASE): if xbmc.getCondVisibility('system.platform.windows'): sopserver() else: sop.sopstreams(nomeescolha, '', linkescolha) else: mensagemok(traducao(40000), traducao(40024)) else: mensagemok(traducao(40000), traducao(40008))
def play_stream_url(name, icon, url): if "sop://" in url: sop.sopstreams(name,icon,url) else: ace.acestreams(name,icon,url)