def corregir_servidor(servidor): servidor = servertools.corregir_servidor(servidor) return servidor
def corregir_servidor(servidor): servidor = servertools.corregir_servidor(servidor) if servidor == 'myv': return 'myvi' return servidor
def corregir_servidor(servidor): servidor = servertools.corregir_servidor(servidor) if servidor == 'fcom': return 'fembed' elif servidor in ['mp4', 'api', 'drive']: return 'gvideo' else: return servidor
def findvideos(item): logger.info() itemlist = [] IDIOMAS = {'Español': 'Esp', 'Latino': 'Lat', 'Subtitulado': 'VOSE'} data = httptools.downloadpage(item.url).data # ~ logger.debug(data) # Enlaces en embeds patron = '<a href="#embed\d+" data-src="([^"]+)" class="([^"]+)"(.*?)</a>' matches = re.compile(patron, re.DOTALL).findall(data) for urlcod, lang, resto in matches: if urlcod.startswith('//'): urlcod = 'https:' + urlcod elif urlcod.startswith('/'): urlcod = HOST + urlcod[1:] cod = urlcod.replace(HOST + 'replayer/', '').split('RRRRR')[0] # ~ logger.info('%s %s' % (cod, urlcod)) numpad = len(cod) % 4 if numpad > 0: cod += 'R' * (4 - numpad) try: url = base64.b64decode(cod) if numpad > 0: url = url[:-(4 - numpad)] except: url = None if not url: logger.info('No detectada url. %s %s' % (cod, urlcod)) continue servidor = servertools.get_server_from_url(url) if not servidor or (servidor == 'directo' and 'storage.googleapis.com/' not in url): logger.info('No detectado servidor, url: %s' % url) continue url = servertools.normalize_url(servidor, url) qlty = scrapertools.find_single_match(resto, '([^>]+)</div>$') itemlist.append( Item(channel=item.channel, action='play', server=servidor, title='', url=url, language=IDIOMAS.get(lang, lang), quality=qlty, quality_num=puntuar_calidad(qlty), other='e')) # Enlaces en descargas bloque = scrapertools.find_single_match(data, 'id="dlnmt"(.*?)</table>') matches = re.compile('<tr>(.*?)</tr>', re.DOTALL).findall(bloque) for lin in matches: if '<th' in lin: continue tds = scrapertools.find_multiple_matches(lin, '<td[^>]*>(.*?)</td>') url = scrapertools.find_single_match(tds[0], ' href="([^"]+)') servidor = scrapertools.find_single_match(tds[1], '<span>(.*?)</span>') lang = tds[2] qlty = tds[3] if '/link/?go=' in url: url = url.split('/link/?go=')[1] if not url or not servidor: continue itemlist.append( Item(channel=item.channel, action='play', server=servertools.corregir_servidor(servidor), title='', url=url, language=IDIOMAS.get(lang, lang), quality=qlty, quality_num=puntuar_calidad(qlty), other='d')) return itemlist
def corregir_servidor(servidor): servidor = servertools.corregir_servidor(servidor) if servidor == 'embed': return 'mystream' if servidor == 'flixplayer': return 'directo' return servidor
def corregir_servidor(servidor): servidor = servertools.corregir_servidor(servidor) if servidor == 'miracine': return 'netutv' elif servidor == 'player': return 'vimple' else: return servidor
def corregir_servidor(servidor): servidor = servertools.corregir_servidor(servidor) if servidor == 'youtvgratis': return 'fembed' return servidor