diff --git a/plugin.video.alfa/servers/bitp.json b/plugin.video.alfa/servers/bitp.json new file mode 100644 index 00000000..f7cb4dfa --- /dev/null +++ b/plugin.video.alfa/servers/bitp.json @@ -0,0 +1,49 @@ +{ + "active": true, + "changes": [ + { + "date": "18/09/2017", + "description": "Versión inicial" + } + ], + "find_videos": { + "ignore_urls": [], + "patterns": [ + { + "pattern": "https://www.bitporno.com/e/([A-z0-9]+)", + "url": "https://www.bitporno.com/e/\\1" + } + ] + }, + "free": true, + "id": "bitp", + "name": "bitp", + "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://s26.postimg.org/maiur9tmx/bitp1.png", + "version": 1 +} diff --git a/plugin.video.alfa/servers/bitp.py b/plugin.video.alfa/servers/bitp.py new file mode 100644 index 00000000..95a12753 --- /dev/null +++ b/plugin.video.alfa/servers/bitp.py @@ -0,0 +1,27 @@ +# -*- 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: + return False, "[bitp] 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 + videourl = scrapertools.find_multiple_matches(data, 'file":"([^"]+).*?label":"([^"]+)') + scrapertools.printMatches(videourl) + for scrapedurl, scrapedquality in videourl: + scrapedurl = scrapedurl.replace("\\","") + video_urls.append([scrapedquality + " [bitp]", scrapedurl]) + + return video_urls