summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/SpeedLoadOrg.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-02-18 21:10:38 +0100
committerGravatar Stefano <l.stickell@yahoo.it> 2013-02-18 21:10:38 +0100
commit81849ccf245196cdc7963d9c3953d1b4623308e5 (patch)
tree9218ded56b3f3c565e283649e44a4e85a954c2b7 /module/plugins/hoster/SpeedLoadOrg.py
parentMerge pull request #7 from stickell/patch-1 (diff)
downloadpyload-81849ccf245196cdc7963d9c3953d1b4623308e5.tar.xz
SpeedLoadOrg: Checksum verification implemented
Loading API data to allow plugins such as Checksum to work
Diffstat (limited to 'module/plugins/hoster/SpeedLoadOrg.py')
-rw-r--r--module/plugins/hoster/SpeedLoadOrg.py13
1 files changed, 10 insertions, 3 deletions
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<ID>\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 = '<div class="d_file[^>]+>\s+<div>\s+<div[^>]+>(?P<N>[^<]+)</div>'
FILE_SIZE_PATTERN = 'File Size:&nbsp;</span>(?P<S>[^<]+)</span>'
RECAPTCHA_KEY = '6LenSdkSAAAAAJyoP5jFZl4NNell2r4rzfXRZXGW'
+ API_URL = 'http://speedload.org/api/single_link.php?shortUrl='
def handleFree(self):
+ self.getApiData()
recaptcha = ReCaptcha(self)
self.load
challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
@@ -47,3 +50,7 @@ class SpeedLoadOrg(SimpleHoster):
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 = literal_eval(getURL(self.API_URL + self.file_id))
+ self.api_data['size'] = self.api_data['fileSize']