summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/crypter/TurbobitNetFolder.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-08 00:29:57 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 11:02:23 +0200
commit68d662e689cd42687341c550fb6ebb74e6968d21 (patch)
tree486cef41bd928b8db704894233b2cef94a6e346f /pyload/plugins/crypter/TurbobitNetFolder.py
parentsave_join -> safe_join & save_path -> safe_filename (diff)
downloadpyload-68d662e689cd42687341c550fb6ebb74e6968d21.tar.xz
module -> pyload
Diffstat (limited to 'pyload/plugins/crypter/TurbobitNetFolder.py')
-rw-r--r--pyload/plugins/crypter/TurbobitNetFolder.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/pyload/plugins/crypter/TurbobitNetFolder.py b/pyload/plugins/crypter/TurbobitNetFolder.py
new file mode 100644
index 000000000..48b28c28a
--- /dev/null
+++ b/pyload/plugins/crypter/TurbobitNetFolder.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from pyload.plugins.internal.SimpleCrypter import SimpleCrypter
+from pyload.common.json_layer import json_loads
+
+
+class TurbobitNetFolder(SimpleCrypter):
+ __name__ = "TurbobitNetFolder"
+ __type__ = "crypter"
+ __version__ = "0.03"
+
+ __pattern__ = r'http://(?:www\.)?turbobit\.net/download/folder/(?P<ID>\w+)'
+
+ __description__ = """Turbobit.net folder decrypter plugin"""
+ __author_name__ = ("stickell", "Walter Purcaro")
+ __author_mail__ = ("l.stickell@yahoo.it", "vuolter@gmail.com")
+
+ TITLE_PATTERN = r"src='/js/lib/grid/icon/folder.png'> <span>(?P<title>.+?)</span>"
+
+
+ def _getLinks(self, id, page=1):
+ gridFile = self.load("http://turbobit.net/downloadfolder/gridFile",
+ get={"rootId": id, "rows": 200, "page": page}, decode=True)
+ grid = json_loads(gridFile)
+
+ if grid['rows']:
+ for i in grid['rows']:
+ yield i['id']
+ for id in self._getLinks(id, page + 1):
+ yield id
+ else:
+ return
+
+ def getLinks(self):
+ id = re.match(self.__pattern__, self.pyfile.url).group("ID")
+ fixurl = lambda id: "http://turbobit.net/%s.html" % id
+ return map(fixurl, self._getLinks(id))