clipwatching: nuevo server

This commit is contained in:
Intel1
2018-01-20 09:24:11 -05:00
committed by GitHub
parent 467ac55faa
commit 40b475b554
2 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
{
"active": true,
"find_videos": {
"ignore_urls": [],
"patterns": [
{
"pattern": "clipwatching.com/(.*?).html",
"url": "http://clipwatching.com/\\1.html"
}
]
},
"free": true,
"id": "clipwatching",
"name": "clipwatching",
"settings": [
{
"default": false,
"enabled": true,
"id": "black_list",
"label": "Incluir en lista negra",
"type": "bool",
"visible": true
},
{
"default": 0,
"enabled": true,
"id": "favorites_servers_list",
"label": "Incluir en lista de favoritos",
"lvalues": [
"No",
"1",
"2",
"3",
"4",
"5"
],
"type": "list",
"visible": false
}
],
"thumbnail": "https://s17.postimg.org/e6kcan0vj/clipwatching1.png"
}

View File

@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
from core import httptools
from core import scrapertools
from platformcode import logger
def test_video_exists(page_url):
logger.info("(page_url='%s')" % page_url)
data = httptools.downloadpage(page_url).data
if "no longer exists" in data or "to copyright issues" in data:
return False, "[clipwatching] El video ha sido borrado"
if "please+try+again+later." in data:
return False, "[clipwatching] Error de clipwatching, no se puede generar el enlace al video"
return True, ""
def get_video_url(page_url, user="", password="", video_password=""):
logger.info("(page_url='%s')" % page_url)
data = httptools.downloadpage(page_url).data
video_urls = []
videourl, label = scrapertools.find_single_match(data, 'file:"([^"]+).*?label:"([^"]+)')
video_urls.append([label + " [clipwatching]", videourl])
return video_urls