KoD 0.8.1
- riorganizzate le impostazioni - aggiunte descrizioni tag qualità su cb01 (presto anche sugli altri) - aggiunto il supporto alle serie di polpotv - fixato server mystream - fix Rinumerazione per episodi Nuovi
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# --------------------------------------------------------
|
||||
# Conector redtube By Alfa development Group
|
||||
# --------------------------------------------------------
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
from platformcode import logger
|
||||
|
||||
def test_video_exists(page_url):
|
||||
|
||||
response = httptools.downloadpage(page_url)
|
||||
|
||||
if not response.sucess or \
|
||||
"Not Found" in response.data \
|
||||
or "File was deleted" in response.data \
|
||||
or "is no longer available" in response.data:
|
||||
return False, "[redtube] El fichero no existe o ha sido borrado"
|
||||
return True, ""
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.info()
|
||||
video_urls = []
|
||||
data = httptools.downloadpage(page_url).data
|
||||
data = scrapertools.find_single_match(data,'mediaDefinition: \[(.*?)\]')
|
||||
logger.debug(data)
|
||||
patron = '"defaultQuality":.*?,"quality":"([^"]+)","videoUrl"\:"([^"]+)"'
|
||||
matches = scrapertools.find_multiple_matches(data, patron)
|
||||
for quality,scrapedurl in matches:
|
||||
url = scrapedurl.replace("\/", "/")
|
||||
video_urls.append(["[redtube] %s" %quality, url])
|
||||
return video_urls
|
||||
Reference in New Issue
Block a user