From 31baaf76768173e2e9da8f57915b81a25d658f01 Mon Sep 17 00:00:00 2001 From: Alfa-beto <30815244+Alfa-beto@users.noreply.github.com> Date: Wed, 13 Feb 2019 12:02:58 -0300 Subject: [PATCH] Nuevo Conector - ArchiveOrg: Nuevo conector --- plugin.video.alfa/servers/archiveorg.json | 42 +++++++++++++++++++++++ plugin.video.alfa/servers/archiveorg.py | 28 +++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 plugin.video.alfa/servers/archiveorg.json create mode 100644 plugin.video.alfa/servers/archiveorg.py diff --git a/plugin.video.alfa/servers/archiveorg.json b/plugin.video.alfa/servers/archiveorg.json new file mode 100644 index 00000000..c2473bcc --- /dev/null +++ b/plugin.video.alfa/servers/archiveorg.json @@ -0,0 +1,42 @@ +{ + "active": true, + "find_videos": { + "ignore_urls": [], + "patterns": [ + { + "pattern": "https://archive.org/embed/(.*)", + "url": "https://archive.org/embed/\\1" + } + ] + }, + "free": true, + "id": "ArchiveOrg", + "name": "archiveorg", + "settings": [ + { + "default": false, + "enabled": true, + "id": "black_list", + "label": "@60654", + "type": "bool", + "visible": true + }, + { + "default": 0, + "enabled": true, + "id": "favorites_servers_list", + "label": "@60655", + "lvalues": [ + "No", + "1", + "2", + "3", + "4", + "5" + ], + "type": "list", + "visible": false + } + ], + "thumbnail": "https://i.postimg.cc/P5ZYJM4L/archiveorg.png" +} diff --git a/plugin.video.alfa/servers/archiveorg.py b/plugin.video.alfa/servers/archiveorg.py new file mode 100644 index 00000000..a954cc35 --- /dev/null +++ b/plugin.video.alfa/servers/archiveorg.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# -------------------------------------------------------- +# Conector ArchiveOrg By Alfa development Group +# -------------------------------------------------------- + +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) + if data.code == 404: + return False, "[ArchiveOrg] El archivo no existe o ha sido borrado" + return True, "" + + +def get_video_url(page_url, premium=False, user="", password="", video_password=""): + logger.info("url=" + page_url) + video_urls = [] + data = httptools.downloadpage(page_url).data + logger.debug(data) + patron = '' + matches = scrapertools.find_multiple_matches(data, patron) + for url in matches: + video_urls.append(['.MP4 [ArchiveOrg]', url]) + return video_urls