summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-07 22:46:19 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-07 22:46:19 +0200
commit8a8a521b3c4af39ca8d3fb29d1e322cca230b3c2 (patch)
tree9509772e03ac887ad73392da876f10f405ff0a0e /module/plugins
parentfile info prefetching (RapidshareCom UploadedTo), download folder fix, Serien... (diff)
downloadpyload-8a8a521b3c4af39ca8d3fb29d1e322cca230b3c2.tar.xz
better link checking
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hoster/RapidshareCom.py36
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