From 1da646a91a394b60761ef7f9aea8bf7ceb710836 Mon Sep 17 00:00:00 2001 From: z00nx Date: Sun, 20 Jan 2013 12:34:11 +1100 Subject: Added SpeedLoadOrg plugin --- module/plugins/hoster/SpeedLoadOrg.py | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 module/plugins/hoster/SpeedLoadOrg.py (limited to 'module/plugins/hoster/SpeedLoadOrg.py') diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py new file mode 100644 index 000000000..d5e89b93f --- /dev/null +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.network.RequestFactory import getURL +from module.plugins.ReCaptcha import ReCaptcha +import re + + +def getInfo(urls): + for url in urls: + header = getURL(url, just_header=True) + if 'Location: http://speedload.org/index.php' in header: + file_info = (url, 0, 1, url) + else: + file_info = parseFileInfo(SpeedLoadOrg, url, getURL(url, decode=True)) + yield file_info + + +class SpeedLoadOrg(SimpleHoster): + __name__ = "SpeedLoadOrg" + __type__ = "hoster" + __pattern__ = r"http://(www\.)?speedload\.org/(?P\w+).*" + __version__ = "0.01" + __description__ = """Speedload.org hoster plugin""" + __author_name__ = ("z00nx") + __author_mail__ = ("z00nx0@gmail.com") + + FILE_NAME_PATTERN = '
Date: Sun, 17 Feb 2013 20:35:38 +0100 Subject: More download check rules for SpeedLoadOrg --- module/plugins/hoster/SpeedLoadOrg.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/SpeedLoadOrg.py') diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py index d5e89b93f..92abbb04e 100644 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -19,7 +19,7 @@ class SpeedLoadOrg(SimpleHoster): __name__ = "SpeedLoadOrg" __type__ = "hoster" __pattern__ = r"http://(www\.)?speedload\.org/(?P\w+).*" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Speedload.org hoster plugin""" __author_name__ = ("z00nx") __author_mail__ = ("z00nx0@gmail.com") @@ -34,8 +34,16 @@ class SpeedLoadOrg(SimpleHoster): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, 'submit': 'continue', 'submitted': '1', 'd': '1'} self.download(self.pyfile.url, post=post_data) - check = self.checkDownload({"html": re.compile("\A Date: Mon, 18 Feb 2013 21:10:38 +0100 Subject: SpeedLoadOrg: Checksum verification implemented Loading API data to allow plugins such as Checksum to work --- module/plugins/hoster/SpeedLoadOrg.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/SpeedLoadOrg.py') diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py index 92abbb04e..e0d82ed08 100644 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -3,6 +3,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo from module.network.RequestFactory import getURL from module.plugins.ReCaptcha import ReCaptcha import re +from ast import literal_eval def getInfo(urls): @@ -19,16 +20,18 @@ class SpeedLoadOrg(SimpleHoster): __name__ = "SpeedLoadOrg" __type__ = "hoster" __pattern__ = r"http://(www\.)?speedload\.org/(?P\w+).*" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Speedload.org hoster plugin""" - __author_name__ = ("z00nx") - __author_mail__ = ("z00nx0@gmail.com") + __author_name__ = ("z00nx", "stickell") + __author_mail__ = ("z00nx0@gmail.com", "l.stickell@yahoo.it") FILE_NAME_PATTERN = '
Date: Mon, 18 Feb 2013 22:05:23 +0100 Subject: Using the JSON parser --- module/plugins/hoster/SpeedLoadOrg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/SpeedLoadOrg.py') diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py index e0d82ed08..b7599cabf 100644 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -2,8 +2,8 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo from module.network.RequestFactory import getURL from module.plugins.ReCaptcha import ReCaptcha +from module.common.json_layer import loads import re -from ast import literal_eval def getInfo(urls): @@ -20,7 +20,7 @@ class SpeedLoadOrg(SimpleHoster): __name__ = "SpeedLoadOrg" __type__ = "hoster" __pattern__ = r"http://(www\.)?speedload\.org/(?P\w+).*" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Speedload.org hoster plugin""" __author_name__ = ("z00nx", "stickell") __author_mail__ = ("z00nx0@gmail.com", "l.stickell@yahoo.it") @@ -52,5 +52,5 @@ class SpeedLoadOrg(SimpleHoster): def getApiData(self): self.file_id = re.search(self.__pattern__, self.pyfile.url).group('ID') - self.api_data = literal_eval(getURL(self.API_URL + self.file_id)) + self.api_data = loads(getURL(self.API_URL + self.file_id)) self.api_data['size'] = self.api_data['fileSize'] -- cgit v1.2.3 From a48b97491d0152140817a37f84c7beb046dad315 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 18 Feb 2013 23:18:29 +0100 Subject: Fixed incorrect function name --- module/plugins/hoster/SpeedLoadOrg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/SpeedLoadOrg.py') diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py index b7599cabf..e74114742 100644 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -2,7 +2,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo from module.network.RequestFactory import getURL from module.plugins.ReCaptcha import ReCaptcha -from module.common.json_layer import loads +from module.common.json_layer import json_loads import re @@ -52,5 +52,5 @@ class SpeedLoadOrg(SimpleHoster): def getApiData(self): self.file_id = re.search(self.__pattern__, self.pyfile.url).group('ID') - self.api_data = loads(getURL(self.API_URL + self.file_id)) + self.api_data = json_loads(getURL(self.API_URL + self.file_id)) self.api_data['size'] = self.api_data['fileSize'] -- cgit v1.2.3 From 3cbbb91b400cf6388523fbec945a6e97a6ae24e1 Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 21 Feb 2013 22:15:44 +0100 Subject: SpeedLoadOrg: Detect offline files Added the FILE_OFFLINE_PATTERN to detect offline files --- module/plugins/hoster/SpeedLoadOrg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/SpeedLoadOrg.py') diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py index e74114742..7035812eb 100644 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -20,13 +20,14 @@ class SpeedLoadOrg(SimpleHoster): __name__ = "SpeedLoadOrg" __type__ = "hoster" __pattern__ = r"http://(www\.)?speedload\.org/(?P\w+).*" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Speedload.org hoster plugin""" __author_name__ = ("z00nx", "stickell") __author_mail__ = ("z00nx0@gmail.com", "l.stickell@yahoo.it") FILE_NAME_PATTERN = '
' RECAPTCHA_KEY = '6LenSdkSAAAAAJyoP5jFZl4NNell2r4rzfXRZXGW' API_URL = 'http://speedload.org/api/single_link.php?shortUrl=' -- cgit v1.2.3 From 2d8da79200604a4672daf0b0fb07e8aed3ae2b22 Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 21 Feb 2013 22:19:20 +0100 Subject: SpeedLoadOrg: getInfo now uses API --- module/plugins/hoster/SpeedLoadOrg.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster/SpeedLoadOrg.py') diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py index 7035812eb..82ed23ad6 100644 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -8,19 +8,30 @@ import re def getInfo(urls): for url in urls: - header = getURL(url, just_header=True) - if 'Location: http://speedload.org/index.php' in header: - file_info = (url, 0, 1, url) + api_data = getAPIData(url) + online = False if 'File Not Found' in api_data else True + if online: + file_info = (api_data['originalFilename'], api_data['size'], 2 , url) else: - file_info = parseFileInfo(SpeedLoadOrg, url, getURL(url, decode=True)) + file_info = (url, 0, 1 , url) yield file_info +def getAPIData(url): + API_URL = 'http://speedload.org/api/single_link.php?shortUrl=' + + file_id = re.search(SpeedLoadOrg.__pattern__, url).group('ID') + api_data = json_loads(getURL(API_URL + file_id, decode = True)) + if isinstance(api_data, dict): + api_data['size'] = api_data['fileSize'] + + return api_data + class SpeedLoadOrg(SimpleHoster): __name__ = "SpeedLoadOrg" __type__ = "hoster" __pattern__ = r"http://(www\.)?speedload\.org/(?P\w+).*" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Speedload.org hoster plugin""" __author_name__ = ("z00nx", "stickell") __author_mail__ = ("z00nx0@gmail.com", "l.stickell@yahoo.it") @@ -32,9 +43,8 @@ class SpeedLoadOrg(SimpleHoster): API_URL = 'http://speedload.org/api/single_link.php?shortUrl=' def handleFree(self): - self.getApiData() + self.api_data = getAPIData(self.pyfile.url) recaptcha = ReCaptcha(self) - self.load challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, 'submit': 'continue', 'submitted': '1', 'd': '1'} self.download(self.pyfile.url, post=post_data) @@ -50,8 +60,3 @@ class SpeedLoadOrg(SimpleHoster): self.retry(10, 300, "Already downloading") elif check == "socket": self.fail("Server error: Could not open socket") - - def getApiData(self): - self.file_id = re.search(self.__pattern__, self.pyfile.url).group('ID') - self.api_data = json_loads(getURL(self.API_URL + self.file_id)) - self.api_data['size'] = self.api_data['fileSize'] -- cgit v1.2.3 From 64213890db8ab8e5e7197dbe23dff3e070532e31 Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 21 Feb 2013 22:22:05 +0100 Subject: SpeedLoadOrg: removed duplicated string --- module/plugins/hoster/SpeedLoadOrg.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hoster/SpeedLoadOrg.py') diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py index 82ed23ad6..a725d9ae0 100644 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -40,7 +40,6 @@ class SpeedLoadOrg(SimpleHoster): FILE_SIZE_PATTERN = 'File Size: (?P[^<]+)' FILE_OFFLINE_PATTERN = '
' RECAPTCHA_KEY = '6LenSdkSAAAAAJyoP5jFZl4NNell2r4rzfXRZXGW' - API_URL = 'http://speedload.org/api/single_link.php?shortUrl=' def handleFree(self): self.api_data = getAPIData(self.pyfile.url) -- cgit v1.2.3 From 436ae2009b6f29e6e82914f9c13c54824b92cff1 Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 28 Feb 2013 20:13:29 +0100 Subject: SpeedLoadOrg now uses XFileSharingPro --- module/plugins/hoster/SpeedLoadOrg.py | 65 ++++++----------------------------- 1 file changed, 11 insertions(+), 54 deletions(-) (limited to 'module/plugins/hoster/SpeedLoadOrg.py') diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py index a725d9ae0..65eead5a5 100644 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -1,61 +1,18 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo -from module.network.RequestFactory import getURL -from module.plugins.ReCaptcha import ReCaptcha -from module.common.json_layer import json_loads -import re +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo - -def getInfo(urls): - for url in urls: - api_data = getAPIData(url) - online = False if 'File Not Found' in api_data else True - if online: - file_info = (api_data['originalFilename'], api_data['size'], 2 , url) - else: - file_info = (url, 0, 1 , url) - yield file_info - -def getAPIData(url): - API_URL = 'http://speedload.org/api/single_link.php?shortUrl=' - - file_id = re.search(SpeedLoadOrg.__pattern__, url).group('ID') - api_data = json_loads(getURL(API_URL + file_id, decode = True)) - if isinstance(api_data, dict): - api_data['size'] = api_data['fileSize'] - - return api_data - - -class SpeedLoadOrg(SimpleHoster): +class SpeedLoadOrg(XFileSharingPro): __name__ = "SpeedLoadOrg" __type__ = "hoster" - __pattern__ = r"http://(www\.)?speedload\.org/(?P\w+).*" - __version__ = "0.06" + __pattern__ = r"http://(www\.)?speedload\.org/(?P\w+)" + __version__ = "1.00" __description__ = """Speedload.org hoster plugin""" - __author_name__ = ("z00nx", "stickell") - __author_mail__ = ("z00nx0@gmail.com", "l.stickell@yahoo.it") + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + FILE_NAME_PATTERN = r'Filename:(?P[^<]+)' + FILE_SIZE_PATTERN = r'Size:[\w. ]+\((?P\d+) bytes\)' - FILE_NAME_PATTERN = '
' - RECAPTCHA_KEY = '6LenSdkSAAAAAJyoP5jFZl4NNell2r4rzfXRZXGW' + HOSTER_NAME = "speedload.org" - def handleFree(self): - self.api_data = getAPIData(self.pyfile.url) - recaptcha = ReCaptcha(self) - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) - post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, 'submit': 'continue', 'submitted': '1', 'd': '1'} - self.download(self.pyfile.url, post=post_data) - check = self.checkDownload({ - "html": re.compile("\A Date: Fri, 15 Mar 2013 14:12:25 +0100 Subject: SpeedLoadOrg: now premium downloads works --- module/plugins/hoster/SpeedLoadOrg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/SpeedLoadOrg.py') diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py index 65eead5a5..32e7baf13 100644 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -5,7 +5,7 @@ class SpeedLoadOrg(XFileSharingPro): __name__ = "SpeedLoadOrg" __type__ = "hoster" __pattern__ = r"http://(www\.)?speedload\.org/(?P\w+)" - __version__ = "1.00" + __version__ = "1.01" __description__ = """Speedload.org hoster plugin""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -15,4 +15,7 @@ class SpeedLoadOrg(XFileSharingPro): HOSTER_NAME = "speedload.org" + def handlePremium(self): + self.download(self.pyfile.url, post = self.getPostParameters()) + getInfo = create_getInfo(SpeedLoadOrg) -- cgit v1.2.3