diff options
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/OpenloadIo.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/module/plugins/hoster/OpenloadIo.py b/module/plugins/hoster/OpenloadIo.py index dcd4dddb4..c4824280b 100644 --- a/module/plugins/hoster/OpenloadIo.py +++ b/module/plugins/hoster/OpenloadIo.py @@ -10,7 +10,7 @@ from module.plugins.internal.misc import json class OpenloadIo(SimpleHoster): __name__ = "OpenloadIo" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?openload\.(co|io)/(f|embed)/(?P<ID>[\w\-]+)' @@ -28,9 +28,9 @@ class OpenloadIo(SimpleHoster): # The API reference, that this implementation uses is available at https://openload.co/api 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}' + _DOWNLOAD_TICKET_URI_PATTERN = '/file/dlticket?file=%s' + _DOWNLOAD_FILE_URI_PATTERN = '/file/dl?file=%s&ticket=%s' + _FILE_INFO_URI_PATTERN = '/file/info?file=%s' OFFLINE_PATTERN = r'>We are sorry' @@ -43,7 +43,7 @@ class OpenloadIo(SimpleHoster): @classmethod def api_info(cls, url): file_id = re.match(cls.__pattern__, url).group('ID') - info_json = cls._load_json(cls._FILE_INFO_URI_PATTERN.format(file_id)) + info_json = cls._load_json(cls._FILE_INFO_URI_PATTERN % file_id) file_info = info_json['result'][file_id] return {'name': file_info['name'], @@ -59,7 +59,7 @@ class OpenloadIo(SimpleHoster): # If the link is being handled here, then it matches the file_id_pattern, # therefore, we can call [0] safely. file_id = self.info['pattern']['ID'] - ticket_json = self._load_json(self._DOWNLOAD_TICKET_URI_PATTERN.format(file_id)) + ticket_json = self._load_json(self._DOWNLOAD_TICKET_URI_PATTERN % file_id) if ticket_json['status'] == 404: self.offline(ticket_json['msg']) @@ -74,5 +74,5 @@ class OpenloadIo(SimpleHoster): ticket = ticket_json['result']['ticket'] - download_json = self._load_json(self._DOWNLOAD_FILE_URI_PATTERN.format(file_id, ticket)) + download_json = self._load_json(self._DOWNLOAD_FILE_URI_PATTERN % (file_id, ticket)) self.link = download_json['result']['url'] |