diff options
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/RapidshareCom.py | 12 | ||||
-rw-r--r-- | module/plugins/hoster/UploadedTo.py | 9 |
2 files changed, 18 insertions, 3 deletions
diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index fa6dad837..07dc3ed21 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -31,7 +31,13 @@ class RapidshareCom(Hoster): self.url = self.pyfile.url self.prepare() self.proceed(self.url) - + + def getInfo(self): + self.url = self.pyfile.url + self.download_api_data() + self.pyfile.name = self.api_data["filename"] + self.pyfile.sync() + def prepare(self): # self.no_slots = True # self.want_reconnect = False @@ -69,10 +75,12 @@ class RapidshareCom(Hoster): else: self.fail("Unknown response code.") - def download_api_data(self): + def download_api_data(self, force=False): """ http://images.rapidshare.com/apidoc.txt """ + if self.api_data and not force: + return api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param_file = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1"} m = re.compile(self.__pattern__).search(self.url) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 573119680..2226f2943 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -29,6 +29,11 @@ class UploadedTo(Hoster): self.prepare() self.proceed() + + def getInfo(self): + self.download_api_data() + self.pyfile.name = self.api_data["filename"] + self.pyfile.sync() def prepare(self): tries = 0 @@ -66,7 +71,9 @@ class UploadedTo(Hoster): self.fail("Error while preparing DL") return True - def download_api_data(self): + def download_api_data(self, force=False): + if self.api_data and not force: + return match = re.compile(self.__pattern__).search(self.pyfile.url) if match: src = self.load("http://uploaded.to/api/file", cookies=False, get={"id": match.group(1).split("/")[0]}) |