diff options
Diffstat (limited to 'module/plugins/hoster/RapidshareCom.py')
-rw-r--r-- | module/plugins/hoster/RapidshareCom.py | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 07dc3ed21..bf94e3702 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -5,9 +5,37 @@ import re from time import time +from module.network.Request import getURL from module.plugins.Hoster import Hoster import hashlib +def getInfo(urls): + + ids = "" + names = "" + + for url in urls: + tmp = url.split("/") + ids+= ","+tmp[-2] + names+= ","+tmp[-1] + + url = "http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=checkfiles_v1&files=%s&filenames=%s" % (ids[1:], names[1:]) + + + api = getURL(url) + result = [] + i = 0 + for res in api.split(): + tmp = res.split(",") + if tmp[4] in ("0", "4", "5"): status = 1 + elif tmp[4] == "1": status = 2 + else: status = 3 + + result.append( (tmp[1], tmp[2], status, urls[i]) ) + i += 1 + + yield result + class RapidshareCom(Hoster): __name__ = "RapidshareCom" __type__ = "hoster" @@ -31,13 +59,7 @@ 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 |