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:
+12
-14
@@ -1,14 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import re
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
from lib import jsunpack
|
||||
from platformcode import logger, config
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
global data
|
||||
data = httptools.downloadpage(page_url).data
|
||||
if "File Not Found" in data or "File was deleted" in data:
|
||||
return False, config.get_localized_string(70292) % "ClipWatching"
|
||||
@@ -17,18 +16,17 @@ def test_video_exists(page_url):
|
||||
|
||||
def get_video_url(page_url, user="", password="", video_password=""):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
data = httptools.downloadpage(page_url).data
|
||||
data = re.sub('\t|\n','',data)
|
||||
logger.info('CLIP DATA= ' + data)
|
||||
packed = scrapertools.find_single_match(data, r"text/javascript'>(.*?)\s*</script>")
|
||||
try: unpacked = jsunpack.unpack(packed)
|
||||
except: unpacked = data
|
||||
video_urls = []
|
||||
videos = scrapertools.find_multiple_matches(unpacked, r'(?:file|src):\s*"([^"]+).*?type:\s*"video/([^"]+)".*?label:\s*"([^"]+)')
|
||||
for video, Type, label in videos:
|
||||
logger.info(Type)
|
||||
logger.info(label)
|
||||
try:
|
||||
packed = scrapertools.find_single_match(data, "text/javascript'>(eval.*?)\s*</script>")
|
||||
unpacked = jsunpack.unpack(packed)
|
||||
except:
|
||||
unpacked = scrapertools.find_single_match(data,"window.hola_player.*")
|
||||
videos = scrapertools.find_multiple_matches(unpacked, r'(?:file|src):\s*"([^"]+).*?label:\s*"([^"]+)')
|
||||
for video, label in videos:
|
||||
if ".jpg" not in video:
|
||||
video_urls.append(['%s [%sp] [ClipWatching]' % (Type, label), video])
|
||||
video_urls.sort(key=lambda x: x[0].split()[1])
|
||||
if not label.endswith('p'):
|
||||
label += 'p'
|
||||
video_urls.append([label + " [clipwatching]", video])
|
||||
video_urls.sort(key=lambda it: int(it[0].split("p ", 1)[0]))
|
||||
return video_urls
|
||||
|
||||
Reference in New Issue
Block a user