Fix Server ClipWatching
This commit is contained in:
@@ -4,18 +4,14 @@
|
||||
"ignore_urls": [],
|
||||
"patterns": [
|
||||
{
|
||||
"pattern": "clipwatching.com/(e.*?.html)",
|
||||
"url": "http://clipwatching.com/\\1"
|
||||
},
|
||||
{
|
||||
"pattern": "clipwatching.com/(\\w+)",
|
||||
"pattern": "clipwatching.com/(?:embed-)?([a-zA-Z0-9]+).html",
|
||||
"url": "http://clipwatching.com/embed-\\1.html"
|
||||
}
|
||||
]
|
||||
},
|
||||
"free": true,
|
||||
"id": "clipwatching",
|
||||
"name": "clipwatching",
|
||||
"name": "ClipWatching",
|
||||
"settings": [
|
||||
{
|
||||
"default": false,
|
||||
@@ -42,5 +38,5 @@
|
||||
"visible": false
|
||||
}
|
||||
],
|
||||
"thumbnail": "https://s17.postimg.cc/e6kcan0vj/clipwatching1.png"
|
||||
"thumbnail": "server_clipwatching.png"
|
||||
}
|
||||
|
||||
+11
-6
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import re
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
from lib import jsunpack
|
||||
@@ -17,12 +18,16 @@ 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
|
||||
packed = scrapertools.find_single_match(data, "text/javascript'>(.*?)\s*</script>")
|
||||
unpacked = jsunpack.unpack(packed)
|
||||
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, 'file:"([^"]+).*?label:"([^"]+)')
|
||||
for video, label in videos:
|
||||
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)
|
||||
if ".jpg" not in video:
|
||||
video_urls.append([label + " [clipwatching]", video])
|
||||
video_urls.sort(key=lambda it: int(it[0].split("p ", 1)[0]))
|
||||
video_urls.append(['%s [%sp] [ClipWatching]' % (Type, label), video])
|
||||
return video_urls
|
||||
|
||||
Reference in New Issue
Block a user