From 93592862b520a862c01f80c019e5c4bc43746c19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:54:20 +0200 Subject: [SimpleHoster] Better inline docs + changed "FILE_OFFLINE_PATTERN" to "OFFLINE_PATTERN" --- module/plugins/hoster/UploadingCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index f3cc7a1c6..f84035c90 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -35,7 +35,7 @@ class UploadingCom(SimpleHoster): FILE_NAME_PATTERN = r'id="file_title">(?P.+)(?P[\d.]+) (?P\w+)<' - FILE_OFFLINE_PATTERN = r'Page not found!' + OFFLINE_PATTERN = r'Page not found!' def process(self, pyfile): # set lang to english -- cgit v1.2.3 From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/hoster/UploadingCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index f84035c90..8e39b3ed0 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -28,7 +28,7 @@ class UploadingCom(SimpleHoster): __name__ = "UploadingCom" __type__ = "hoster" __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P[\w\d]+)' - __version__ = "0.34" + __version__ = "0.35" __description__ = """Uploading.com hoster plugin""" __author_name__ = ("jeix", "mkaay", "zoidberg") __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") @@ -85,21 +85,21 @@ class UploadingCom(SimpleHoster): self.logInfo("%s: Waiting %d seconds." % (self.__name__, wait_time)) self.wait(wait_time) else: - self.pluginParseError("AJAX/WAIT") + self.parseError("AJAX/WAIT") response = json_loads( self.load(ajax_url, post={'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'})) if 'answer' in response and 'link' in response['answer']: url = response['answer']['link'] else: - self.pluginParseError("AJAX/URL") + self.parseError("AJAX/URL") self.html = self.load(url) found = re.search(r'
Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hoster/UploadingCom.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 8e39b3ed0..f2dc0cba2 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: jeix """ import re -- cgit v1.2.3 From a9f81c043c62abcb3ce38971237693736833fdbe Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:28:23 +0200 Subject: Fix hosters SH_COOKIES syntax --- module/plugins/hoster/UploadingCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index f2dc0cba2..acb833dae 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -37,10 +37,10 @@ class UploadingCom(SimpleHoster): def process(self, pyfile): # set lang to english - self.req.cj.setCookie("uploading.com", "lang", "1") - self.req.cj.setCookie("uploading.com", "language", "1") - self.req.cj.setCookie("uploading.com", "setlang", "en") - self.req.cj.setCookie("uploading.com", "_lang", "en") + self.req.cj.setCookie(".uploading.com", "lang", "1") + self.req.cj.setCookie(".uploading.com", "language", "1") + self.req.cj.setCookie(".uploading.com", "setlang", "en") + self.req.cj.setCookie(".uploading.com", "_lang", "en") if not "/get/" in pyfile.url: pyfile.url = pyfile.url.replace("/files", "/files/get") -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hoster/UploadingCom.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index acb833dae..1c6583c12 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -67,11 +67,11 @@ class UploadingCom(SimpleHoster): raise Exception("Plugin defect.") def handleFree(self): - found = re.search('

((Daily )?Download Limit)

', self.html) - if found: - self.pyfile.error = found.group(1) + m = re.search('

((Daily )?Download Limit)

', self.html) + if m: + self.pyfile.error = m.group(1) self.logWarning(self.pyfile.error) - self.retry(max_tries=6, wait_time=6 * 60 * 60 if found.group(2) else 15 * 60, reason=self.pyfile.error) + self.retry(max_tries=6, wait_time=6 * 60 * 60 if m.group(2) else 15 * 60, reason=self.pyfile.error) ajax_url = "http://uploading.com/files/get/?ajax" self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) @@ -93,9 +93,9 @@ class UploadingCom(SimpleHoster): self.parseError("AJAX/URL") self.html = self.load(url) - found = re.search(r' Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/UploadingCom.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 1c6583c12..ac7226ec7 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -1,32 +1,20 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - import re + from pycurl import HTTPHEADER -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp from module.common.json_layer import json_loads +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp class UploadingCom(SimpleHoster): __name__ = "UploadingCom" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P[\w\d]+)' __version__ = "0.35" + + __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P[\w\d]+)' + __description__ = """Uploading.com hoster plugin""" __author_name__ = ("jeix", "mkaay", "zoidberg") __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") @@ -35,6 +23,7 @@ class UploadingCom(SimpleHoster): FILE_SIZE_PATTERN = r'size tip_container">(?P[\d.]+) (?P\w+)<' OFFLINE_PATTERN = r'Page not found!' + def process(self, pyfile): # set lang to english self.req.cj.setCookie(".uploading.com", "lang", "1") -- cgit v1.2.3 From a845e525eee9dae5089b8f7a5e7e27770725f15f Mon Sep 17 00:00:00 2001 From: igel-kun Date: Sat, 30 Aug 2014 00:56:41 +0200 Subject: Update UploadingCom.py --- module/plugins/hoster/UploadingCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index ac7226ec7..45ab1d4cd 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class UploadingCom(SimpleHoster): __name__ = "UploadingCom" __type__ = "hoster" - __version__ = "0.35" + __version__ = "0.36" __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P[\w\d]+)' @@ -21,7 +21,7 @@ class UploadingCom(SimpleHoster): FILE_NAME_PATTERN = r'id="file_title">(?P.+)(?P[\d.]+) (?P\w+)<' - OFFLINE_PATTERN = r'Page not found!' + OFFLINE_PATTERN = r'(Page|file) not found' def process(self, pyfile): -- cgit v1.2.3 From df10dce103716acc293f51572650b3dbb7264bf2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 01:55:44 +0200 Subject: Spare code fixes about COOKIES --- module/plugins/hoster/UploadingCom.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 45ab1d4cd..f4d6f5d8d 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -19,18 +19,18 @@ class UploadingCom(SimpleHoster): __author_name__ = ("jeix", "mkaay", "zoidberg") __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") + FILE_NAME_PATTERN = r'id="file_title">(?P.+)(?P[\d.]+) (?P\w+)<' OFFLINE_PATTERN = r'(Page|file) not found' + COOKIES = [(".uploading.com", "lang", "1"), + (".uploading.com", "language", "1"), + (".uploading.com", "setlang", "en"), + (".uploading.com", "_lang", "en")] - def process(self, pyfile): - # set lang to english - self.req.cj.setCookie(".uploading.com", "lang", "1") - self.req.cj.setCookie(".uploading.com", "language", "1") - self.req.cj.setCookie(".uploading.com", "setlang", "en") - self.req.cj.setCookie(".uploading.com", "_lang", "en") + def process(self, pyfile): if not "/get/" in pyfile.url: pyfile.url = pyfile.url.replace("/files", "/files/get") @@ -42,6 +42,7 @@ class UploadingCom(SimpleHoster): else: self.handleFree() + def handlePremium(self): postData = {'action': 'get_link', 'code': self.file_info['ID'], @@ -55,6 +56,7 @@ class UploadingCom(SimpleHoster): raise Exception("Plugin defect.") + def handleFree(self): m = re.search('

((Daily )?Download Limit)

', self.html) if m: -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/UploadingCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index f4d6f5d8d..1ec8370e2 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -16,8 +16,9 @@ class UploadingCom(SimpleHoster): __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P[\w\d]+)' __description__ = """Uploading.com hoster plugin""" - __author_name__ = ("jeix", "mkaay", "zoidberg") - __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") + __authors__ = [("jeix", "jeix@hasnomail.de"), + ("mkaay", "mkaay@mkaay.de"), + ("zoidberg", "zoidberg@mujmail.cz")] FILE_NAME_PATTERN = r'id="file_title">(?P.+) Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/UploadingCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 1ec8370e2..7033a364d 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -16,6 +16,7 @@ class UploadingCom(SimpleHoster): __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P[\w\d]+)' __description__ = """Uploading.com hoster plugin""" + __license__ = "GPLv3" __authors__ = [("jeix", "jeix@hasnomail.de"), ("mkaay", "mkaay@mkaay.de"), ("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- module/plugins/hoster/UploadingCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 7033a364d..6a457602f 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -13,7 +13,7 @@ class UploadingCom(SimpleHoster): __type__ = "hoster" __version__ = "0.36" - __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P[\w\d]+)' + __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P\w+)' __description__ = """Uploading.com hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- module/plugins/hoster/UploadingCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 6a457602f..a55790441 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -23,7 +23,7 @@ class UploadingCom(SimpleHoster): FILE_NAME_PATTERN = r'id="file_title">(?P.+)(?P[\d.]+) (?P\w+)<' + FILE_SIZE_PATTERN = r'size tip_container">(?P[\d.,]+) (?P\w+)<' OFFLINE_PATTERN = r'(Page|file) not found' COOKIES = [(".uploading.com", "lang", "1"), -- cgit v1.2.3 From 388a2f6478d42e423f1f8442d8539983f3762f22 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 14 Oct 2014 13:38:49 +0200 Subject: Improve unit detection in size pattern --- module/plugins/hoster/UploadingCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index a55790441..e3f75a3f9 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -23,7 +23,7 @@ class UploadingCom(SimpleHoster): FILE_NAME_PATTERN = r'id="file_title">(?P.+)(?P[\d.,]+) (?P\w+)<' + FILE_SIZE_PATTERN = r'size tip_container">(?P[\d.,]+) (?P[\w^_]+)<' OFFLINE_PATTERN = r'(Page|file) not found' COOKIES = [(".uploading.com", "lang", "1"), -- cgit v1.2.3 From 2ae91b81a2f12a1c9b1f78524df78a2b3f1ef494 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 14:52:42 +0200 Subject: Update hosters to self.error --- module/plugins/hoster/UploadingCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index e3f75a3f9..71a1eb4a0 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class UploadingCom(SimpleHoster): __name__ = "UploadingCom" __type__ = "hoster" - __version__ = "0.36" + __version__ = "0.37" __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P\w+)' @@ -76,21 +76,21 @@ class UploadingCom(SimpleHoster): self.logInfo("%s: Waiting %d seconds." % (self.__name__, wait_time)) self.wait(wait_time) else: - self.parseError("AJAX/WAIT") + self.error("AJAX/WAIT") response = json_loads( self.load(ajax_url, post={'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'})) if 'answer' in response and 'link' in response['answer']: url = response['answer']['link'] else: - self.parseError("AJAX/URL") + self.error("AJAX/URL") self.html = self.load(url) m = re.search(r' Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/UploadingCom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 71a1eb4a0..656543a83 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -56,7 +56,7 @@ class UploadingCom(SimpleHoster): url = url.group(1).replace("\\/", "/") self.download(url) - raise Exception("Plugin defect.") + raise Exception("Plugin defect") def handleFree(self): @@ -73,30 +73,30 @@ class UploadingCom(SimpleHoster): response = json_loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.file_info['ID']})) if 'answer' in response and 'wait_time' in response['answer']: wait_time = int(response['answer']['wait_time']) - self.logInfo("%s: Waiting %d seconds." % (self.__name__, wait_time)) + self.logInfo(_("Waiting %d seconds") % wait_time) self.wait(wait_time) else: - self.error("AJAX/WAIT") + self.error(_("No AJAX/WAIT")) response = json_loads( self.load(ajax_url, post={'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'})) if 'answer' in response and 'link' in response['answer']: url = response['answer']['link'] else: - self.error("AJAX/URL") + self.error(_("No AJAX/URL")) self.html = self.load(url) m = re.search(r' Date: Tue, 28 Oct 2014 16:04:10 +0100 Subject: Update plugins to last changes --- module/plugins/hoster/UploadingCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 656543a83..6a435fb5a 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -64,7 +64,7 @@ class UploadingCom(SimpleHoster): if m: self.pyfile.error = m.group(1) self.logWarning(self.pyfile.error) - self.retry(max_tries=6, wait_time=6 * 60 * 60 if m.group(2) else 15 * 60, reason=self.pyfile.error) + self.retry(6, (6 * 60 if m.group(2) else 15) * 60, self.pyfile.error) ajax_url = "http://uploading.com/files/get/?ajax" self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/UploadingCom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 6a435fb5a..cf48f1ec4 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -9,17 +9,17 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class UploadingCom(SimpleHoster): - __name__ = "UploadingCom" - __type__ = "hoster" + __name__ = "UploadingCom" + __type__ = "hoster" __version__ = "0.37" __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P\w+)' __description__ = """Uploading.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("jeix", "jeix@hasnomail.de"), - ("mkaay", "mkaay@mkaay.de"), - ("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("jeix", "jeix@hasnomail.de"), + ("mkaay", "mkaay@mkaay.de"), + ("zoidberg", "zoidberg@mujmail.cz")] FILE_NAME_PATTERN = r'id="file_title">(?P.+) Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/UploadingCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index cf48f1ec4..12b4af0b7 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -22,8 +22,8 @@ class UploadingCom(SimpleHoster): ("zoidberg", "zoidberg@mujmail.cz")] - FILE_NAME_PATTERN = r'id="file_title">(?P.+)(?P[\d.,]+) (?P[\w^_]+)<' + NAME_PATTERN = r'id="file_title">(?P.+)(?P[\d.,]+) (?P[\w^_]+)<' OFFLINE_PATTERN = r'(Page|file) not found' COOKIES = [(".uploading.com", "lang", "1"), -- cgit v1.2.3 From 03f3b86f500c495932fd118b54569d92f700847c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Nov 2014 16:57:55 +0100 Subject: Code cosmetics about file_info and other stuff --- module/plugins/hoster/UploadingCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 12b4af0b7..be9b2bc00 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class UploadingCom(SimpleHoster): __name__ = "UploadingCom" __type__ = "hoster" - __version__ = "0.37" + __version__ = "0.38" __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P\w+)' @@ -37,7 +37,7 @@ class UploadingCom(SimpleHoster): pyfile.url = pyfile.url.replace("/files", "/files/get") self.html = self.load(pyfile.url, decode=True) - self.file_info = self.getFileInfo() + self.getFileInfo() if self.premium: self.handlePremium() @@ -47,7 +47,7 @@ class UploadingCom(SimpleHoster): def handlePremium(self): postData = {'action': 'get_link', - 'code': self.file_info['ID'], + 'code': self.info['ID'], 'pass': 'undefined'} self.html = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData) @@ -70,7 +70,7 @@ class UploadingCom(SimpleHoster): self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) self.req.http.lastURL = self.pyfile.url - response = json_loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.file_info['ID']})) + response = json_loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.info['ID']})) if 'answer' in response and 'wait_time' in response['answer']: wait_time = int(response['answer']['wait_time']) self.logInfo(_("Waiting %d seconds") % wait_time) @@ -79,7 +79,7 @@ class UploadingCom(SimpleHoster): self.error(_("No AJAX/WAIT")) response = json_loads( - self.load(ajax_url, post={'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'})) + self.load(ajax_url, post={'action': 'get_link', 'code': self.info['ID'], 'pass': 'false'})) if 'answer' in response and 'link' in response['answer']: url = response['answer']['link'] else: -- cgit v1.2.3 From c9e31d875d32de31e54959b82bc35eff2b3e0f3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 00:19:51 +0100 Subject: Code cosmetics --- module/plugins/hoster/UploadingCom.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index be9b2bc00..5510326d1 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -70,18 +70,19 @@ class UploadingCom(SimpleHoster): self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) self.req.http.lastURL = self.pyfile.url - response = json_loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.info['ID']})) - if 'answer' in response and 'wait_time' in response['answer']: - wait_time = int(response['answer']['wait_time']) + res = json_loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.info['ID']})) + + if 'answer' in res and 'wait_time' in res['answer']: + wait_time = int(res['answer']['wait_time']) self.logInfo(_("Waiting %d seconds") % wait_time) self.wait(wait_time) else: self.error(_("No AJAX/WAIT")) - response = json_loads( - self.load(ajax_url, post={'action': 'get_link', 'code': self.info['ID'], 'pass': 'false'})) - if 'answer' in response and 'link' in response['answer']: - url = response['answer']['link'] + res = json_loads(self.load(ajax_url, post={'action': 'get_link', 'code': self.info['ID'], 'pass': 'false'})) + + if 'answer' in res and 'link' in res['answer']: + url = res['answer']['link'] else: self.error(_("No AJAX/URL")) -- cgit v1.2.3 From e8246525f3106c152d6d1436c6a3111e0334520f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 18:04:47 +0100 Subject: Fix cookie domain --- module/plugins/hoster/UploadingCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 5510326d1..2b11e3bf4 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -26,7 +26,7 @@ class UploadingCom(SimpleHoster): SIZE_PATTERN = r'size tip_container">(?P[\d.,]+) (?P[\w^_]+)<' OFFLINE_PATTERN = r'(Page|file) not found' - COOKIES = [(".uploading.com", "lang", "1"), + COOKIES = [("uploading.com", "lang", "1"), (".uploading.com", "language", "1"), (".uploading.com", "setlang", "en"), (".uploading.com", "_lang", "en")] -- cgit v1.2.3 From 86d3b6249073947132ed3a9eeb1b1e987d19569a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 1 Dec 2014 18:17:13 +0100 Subject: Update some plugins --- module/plugins/hoster/UploadingCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/UploadingCom.py') diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 2b11e3bf4..b163f2252 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class UploadingCom(SimpleHoster): __name__ = "UploadingCom" __type__ = "hoster" - __version__ = "0.38" + __version__ = "0.39" __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P\w+)' @@ -47,7 +47,7 @@ class UploadingCom(SimpleHoster): def handlePremium(self): postData = {'action': 'get_link', - 'code': self.info['ID'], + 'code': self.info['pattern']['ID'], 'pass': 'undefined'} self.html = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData) @@ -70,7 +70,7 @@ class UploadingCom(SimpleHoster): self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) self.req.http.lastURL = self.pyfile.url - res = json_loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.info['ID']})) + res = json_loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.info['pattern']['ID']})) if 'answer' in res and 'wait_time' in res['answer']: wait_time = int(res['answer']['wait_time']) @@ -79,7 +79,7 @@ class UploadingCom(SimpleHoster): else: self.error(_("No AJAX/WAIT")) - res = json_loads(self.load(ajax_url, post={'action': 'get_link', 'code': self.info['ID'], 'pass': 'false'})) + res = json_loads(self.load(ajax_url, post={'action': 'get_link', 'code': self.info['pattern']['ID'], 'pass': 'false'})) if 'answer' in res and 'link' in res['answer']: url = res['answer']['link'] -- cgit v1.2.3