From 39f075bbba88d0777c8b7dcdb785dad202838c95 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Sep 2015 00:04:38 +0200 Subject: [OpenloadIo] Update __pattern__ --- module/plugins/hoster/OpenloadIo.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/OpenloadIo.py') diff --git a/module/plugins/hoster/OpenloadIo.py b/module/plugins/hoster/OpenloadIo.py index c46462344..372ce28f9 100644 --- a/module/plugins/hoster/OpenloadIo.py +++ b/module/plugins/hoster/OpenloadIo.py @@ -6,25 +6,25 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class OpenloadIo(SimpleHoster): __name__ = "OpenloadIo" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __status__ = "testing" - __pattern__ = r'https?://(?:www\.)?openload\.io/f/[\w_-]{11}' + __pattern__ = r'https?://(?:www\.)?openload\.(co|io)/f/[\w-]+' - __description__ = """Openload.io hoster plugin""" + __description__ = """Openload.co hoster plugin""" __license__ = "GPLv3" __authors__ = [(None, None)] NAME_PATTERN = r'(?P.+?)(?P[\d.,]+) (?P[\w^_]+)<' + SIZE_PATTERN = r'(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r">(We can't find the file you are looking for)" - LINK_FREE_PATTERN = r'id="real\w*download"> Date: Wed, 23 Sep 2015 21:03:03 +0200 Subject: [Openload.io] Rewrite the plugin using official API --- module/plugins/hoster/OpenloadIo.py | 55 ++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/OpenloadIo.py') diff --git a/module/plugins/hoster/OpenloadIo.py b/module/plugins/hoster/OpenloadIo.py index 372ce28f9..f5d677bb2 100644 --- a/module/plugins/hoster/OpenloadIo.py +++ b/module/plugins/hoster/OpenloadIo.py @@ -1,31 +1,72 @@ # -*- coding: utf-8 -*- +import json +import re +from time import sleep from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.network.RequestFactory import getURL class OpenloadIo(SimpleHoster): __name__ = "OpenloadIo" __type__ = "hoster" - __version__ = "0.05" + __version__ = "0.06" __status__ = "testing" - __pattern__ = r'https?://(?:www\.)?openload\.(co|io)/f/[\w-]+' + _FILE_ID_PATTERN = '/f/([\w\-_]+)/?' + __pattern__ = r'https?://(?:www\.)?openload\.(?:co|io)' + _FILE_ID_PATTERN __description__ = """Openload.co hoster plugin""" __license__ = "GPLv3" __authors__ = [(None, None)] - NAME_PATTERN = r'(?P.+?)(?P[\d.,]+) (?P[\w^_]+)' - OFFLINE_PATTERN = r">(We can't find the file you are looking for)" - - LINK_FREE_PATTERN = r'id="real\w*download"> Date: Tue, 29 Sep 2015 21:58:44 +0200 Subject: [OpenloadIo] Cleanup --- module/plugins/hoster/OpenloadIo.py | 44 +++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'module/plugins/hoster/OpenloadIo.py') diff --git a/module/plugins/hoster/OpenloadIo.py b/module/plugins/hoster/OpenloadIo.py index f5d677bb2..1ebc12ad0 100644 --- a/module/plugins/hoster/OpenloadIo.py +++ b/module/plugins/hoster/OpenloadIo.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- + import json import re -from time import sleep -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.network.RequestFactory import getURL +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class OpenloadIo(SimpleHoster): @@ -13,8 +13,7 @@ class OpenloadIo(SimpleHoster): __version__ = "0.06" __status__ = "testing" - _FILE_ID_PATTERN = '/f/([\w\-_]+)/?' - __pattern__ = r'https?://(?:www\.)?openload\.(?:co|io)' + _FILE_ID_PATTERN + __pattern__ = r'https?://(?:www\.)?openload\.(?:co|io)/f/([\w-_]+)' __description__ = """Openload.co hoster plugin""" __license__ = "GPLv3" @@ -22,15 +21,18 @@ class OpenloadIo(SimpleHoster): # The API reference, that this implementation uses is available at https://openload.co/api - _API_BASE_URL = 'https://api.openload.co/1' + API_URL = 'https://api.openload.co/1' - _DOWNLOAD_TICKET_URI_PATTERN = '/file/dlticket?file={0}' - _DOWNLOAD_FILE_URI_PATTERN = '/file/dl?file={0}&ticket={1}' - _FILE_INFO_URI_PATTERN = '/file/info?file={0}' + FILE_ID_PATTERN = '/f/([\w-_]+)' - def setup(self): - self.multiDL = True - self.chunk_limit = 1 + DOWNLOAD_TICKET_URI_PATTERN = '/file/dlticket?file={0}' + DOWNLOAD_FILE_URI_PATTERN = '/file/dl?file={0}&ticket={1}' + FILE_INFO_URI_PATTERN = '/file/info?file={0}' + + + @classmethod + def _load_json(cls, uri): + return json.loads(getURL(cls.API_URL + uri)) @classmethod @@ -42,10 +44,16 @@ class OpenloadIo(SimpleHoster): file_id = file_id[0] info_json = cls._load_json(cls._FILE_INFO_URI_PATTERN.format(file_id)) file_info = info_json['result'][file_id] - return {'name': file_info['name'], - 'size': file_info['size'], + + return {'name' : file_info['name'], + 'size' : file_info['size'], 'status': 3 if url.strip() else 8, - 'url': url} + 'url' : url} + + + def setup(self): + self.multiDL = True + self.chunk_limit = 1 def handle_free(self, pyfile): @@ -55,8 +63,7 @@ class OpenloadIo(SimpleHoster): ticket_json = self._load_json(self._DOWNLOAD_TICKET_URI_PATTERN.format(file_id)) - wait_time = ticket_json['result']['wait_time'] - sleep(wait_time + 0.1) + self.wait(ticket_json['result']['wait_time']) ticket = ticket_json['result']['ticket'] @@ -64,9 +71,4 @@ class OpenloadIo(SimpleHoster): self.link = download_json['result']['url'] - @classmethod - def _load_json(cls, uri): - return json.loads( - getURL(cls._API_BASE_URL + uri)) - getInfo = create_getInfo(OpenloadIo) -- cgit v1.2.3 From 8d85a655d8cc408574f471306613bc05115c8c64 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 1 Oct 2015 18:59:55 +0200 Subject: Improve Hoster and Crypter + general fixup --- module/plugins/hoster/OpenloadIo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/OpenloadIo.py') diff --git a/module/plugins/hoster/OpenloadIo.py b/module/plugins/hoster/OpenloadIo.py index 1ebc12ad0..6213a9c09 100644 --- a/module/plugins/hoster/OpenloadIo.py +++ b/module/plugins/hoster/OpenloadIo.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class OpenloadIo(SimpleHoster): __name__ = "OpenloadIo" __type__ = "hoster" - __version__ = "0.06" + __version__ = "0.07" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?openload\.(?:co|io)/f/([\w-_]+)' @@ -23,11 +23,11 @@ class OpenloadIo(SimpleHoster): # The API reference, that this implementation uses is available at https://openload.co/api API_URL = 'https://api.openload.co/1' - FILE_ID_PATTERN = '/f/([\w-_]+)' + _FILE_ID_PATTERN = '/f/([\w-_]+)' - DOWNLOAD_TICKET_URI_PATTERN = '/file/dlticket?file={0}' - DOWNLOAD_FILE_URI_PATTERN = '/file/dl?file={0}&ticket={1}' - FILE_INFO_URI_PATTERN = '/file/info?file={0}' + _DOWNLOAD_TICKET_URI_PATTERN = '/file/dlticket?file={0}' + _DOWNLOAD_FILE_URI_PATTERN = '/file/dl?file={0}&ticket={1}' + _FILE_INFO_URI_PATTERN = '/file/info?file={0}' @classmethod -- cgit v1.2.3