Fix clipwatching
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"free": true,
|
||||
"id": "clipwatching",
|
||||
"name": "clipwatching",
|
||||
"name": "Clipwatching",
|
||||
"settings": [
|
||||
{
|
||||
"default": false,
|
||||
|
||||
@@ -17,16 +17,23 @@ def test_video_exists(page_url):
|
||||
def get_video_url(page_url, user="", password="", video_password=""):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
video_urls = []
|
||||
|
||||
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*"([^"]+)')
|
||||
|
||||
videos = scrapertools.find_multiple_matches(unpacked if unpacked else data, r'(?:file|src|sources):\s*(?:\[)?"([^"]+).*?(?:label:\s*"([^"]+))?')
|
||||
for video, label in videos:
|
||||
if ".jpg" not in video:
|
||||
if not label.endswith('p'):
|
||||
if label and not label.endswith('p'):
|
||||
label += 'p'
|
||||
multires = True
|
||||
else:
|
||||
label = video.split('.')[-1]
|
||||
multires = False
|
||||
video_urls.append([label + " [clipwatching]", video])
|
||||
video_urls.sort(key=lambda it: int(it[0].split("p ", 1)[0]))
|
||||
if multires:
|
||||
video_urls.sort(key=lambda it: int(it[0].split("p ", 1)[0]))
|
||||
return video_urls
|
||||
|
||||
Reference in New Issue
Block a user