Actualizados
- inkapelis: fix - tvmoviedb: Actualizado idioma por defecto - Eliminado imagenes de servidores que no se usan - mp4upload: agregado test_video_exists
This commit is contained in:
@@ -7,25 +7,24 @@ from core import scrapertools
|
||||
from lib import jsunpack
|
||||
from platformcode import logger
|
||||
|
||||
def test_video_exists(page_url):
|
||||
data = httptools.downloadpage(page_url).data
|
||||
if data == "File was deleted" or data == '':
|
||||
return False, "[mp4upload] El video ha sido borrado"
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
|
||||
data = re.sub(r"\n|\r|\t|\s{2}", "", httptools.downloadpage(page_url).data)
|
||||
|
||||
match = scrapertools.find_single_match(data, "<script type='text/javascript'>(.*?)</script>")
|
||||
data = jsunpack.unpack(match)
|
||||
data = data.replace("\\'", "'")
|
||||
|
||||
media_url = scrapertools.find_single_match(data, '{type:"video/mp4",src:"([^"]+)"}')
|
||||
if not media_url:
|
||||
media_url = scrapertools.find_single_match(data, '"file":"([^"]+)')
|
||||
logger.info("media_url=" + media_url)
|
||||
|
||||
video_urls = list()
|
||||
video_urls.append([scrapertools.get_filename_from_url(media_url)[-4:] + " [mp4upload]", media_url])
|
||||
|
||||
for video_url in video_urls:
|
||||
logger.info("%s - %s" % (video_url[0], video_url[1]))
|
||||
|
||||
return video_urls
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"ignore_urls": [],
|
||||
"patterns": [
|
||||
{
|
||||
"pattern": "powvideo.(?:net|xyz|cc)/(?:embed-|iframe-|preview-|)([a-z0-9]+)",
|
||||
"url": "http://powvideo.net/iframe-\\1-954x562.html"
|
||||
"pattern": "(?:powvideo|povw1deo).(?:net|xyz|com)/(?:embed-|iframe-|preview-|)([a-z0-9]+)",
|
||||
"url": "http://powvideo.net/iframe-\\1-1536x701.html"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -14,6 +14,9 @@ headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/2
|
||||
|
||||
def test_video_exists(page_url):
|
||||
referer = page_url.replace('iframe', 'preview')
|
||||
|
||||
httptools.downloadpage(referer)
|
||||
|
||||
data = httptools.downloadpage(page_url, headers={'referer': referer}).data
|
||||
if data == "File was deleted" or data == '':
|
||||
return False, "[powvideo] El video ha sido borrado"
|
||||
|
||||
Reference in New Issue
Block a user