From 65648bca9b8e0d24bae480aac71f4e91a28f9669 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Wed, 13 Dec 2017 08:38:39 -0500 Subject: [PATCH] bitertv: nuevo server --- plugin.video.alfa/servers/bitertv.json | 43 ++++++++++++++++++++++++++ plugin.video.alfa/servers/bitertv.py | 24 ++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 plugin.video.alfa/servers/bitertv.json create mode 100644 plugin.video.alfa/servers/bitertv.py diff --git a/plugin.video.alfa/servers/bitertv.json b/plugin.video.alfa/servers/bitertv.json new file mode 100644 index 00000000..3c798902 --- /dev/null +++ b/plugin.video.alfa/servers/bitertv.json @@ -0,0 +1,43 @@ +{ + "active": true, + "find_videos": { + "ignore_urls": [], + "patterns": [ + { + "pattern": "(http://biter.tv/v/[A-z0-9]+)", + "url": "\\1" + } + ] + }, + "free": true, + "id": "bitertv", + "name": "Bitertv", + "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://s18.postimg.org/f56rayqq1/logo-bitertv.png", + "version": 1 +} diff --git a/plugin.video.alfa/servers/bitertv.py b/plugin.video.alfa/servers/bitertv.py new file mode 100644 index 00000000..a0e0e145 --- /dev/null +++ b/plugin.video.alfa/servers/bitertv.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- + +from core import httptools +from core import scrapertools +from platformcode import logger + +headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'} + +def test_video_exists(page_url): + logger.info("(page_url='%s')" % page_url) + data = httptools.downloadpage(page_url).data + if "Archive no Encontrado" in data: + return False, "[bitertv] El fichero ha sido borrado" + return True, "" + + +def get_video_url(page_url, user="", password="", video_password=""): + logger.info("(page_url='%s')" % page_url) + video_urls = [] + data = httptools.downloadpage(page_url).data + patron = "(?s)file: '([^']+)" + file = scrapertools.find_single_match(data, patron) + video_urls.append([".MP4 [bitertv]", file]) + return video_urls