Update bitp.py

This commit is contained in:
Intel1
2017-09-18 12:42:17 -05:00
committed by GitHub
parent 0d38737fa7
commit 059fe13a8d

View File

@@ -1,4 +1,9 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# Alfa addon - KODI Plugin
# Conector para bitporno
# https://github.com/alfa-addon
# ------------------------------------------------------------
from core import httptools
from core import scrapertools
@@ -8,8 +13,8 @@ from platformcode import logger
def test_video_exists(page_url):
logger.info("(page_url='%s')" % page_url)
data = httptools.downloadpage(page_url).data
if "no longer exists" in data:
return False, "[bitp] El fichero ha sido borrado"
if "Object not found" in data or "no longer exists" in data or '"sources": [false]' in data:
return False, "[bitp] El archivo no existe o ha sido borrado"
return True, ""
@@ -21,7 +26,9 @@ def get_video_url(page_url, user="", password="", video_password=""):
videourl = scrapertools.find_multiple_matches(data, 'file":"([^"]+).*?label":"([^"]+)')
scrapertools.printMatches(videourl)
for scrapedurl, scrapedquality in videourl:
if "loadthumb" in scrapedurl:
continue
scrapedurl = scrapedurl.replace("\\","")
video_urls.append([scrapedquality + " [bitp]", scrapedurl])
video_urls.sort(key=lambda it: int(it[0].split("p ", 1)[0]))
return video_urls