summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/TurbobitNetFolder.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/crypter/TurbobitNetFolder.py')
-rw-r--r--module/plugins/crypter/TurbobitNetFolder.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/module/plugins/crypter/TurbobitNetFolder.py b/module/plugins/crypter/TurbobitNetFolder.py
index dcbd6a5d7..3a36f5032 100644
--- a/module/plugins/crypter/TurbobitNetFolder.py
+++ b/module/plugins/crypter/TurbobitNetFolder.py
@@ -9,7 +9,8 @@ from module.common.json_layer import json_loads
class TurbobitNetFolder(SimpleCrypter):
__name__ = "TurbobitNetFolder"
__type__ = "crypter"
- __version__ = "0.05"
+ __version__ = "0.06"
+ __status__ = "testing"
__pattern__ = r'http://(?:www\.)?turbobit\.net/download/folder/(?P<ID>\w+)'
__config__ = [("use_premium" , "bool", "Use premium account if available" , True),
@@ -25,24 +26,22 @@ class TurbobitNetFolder(SimpleCrypter):
NAME_PATTERN = r'src=\'/js/lib/grid/icon/folder.png\'> <span>(?P<N>.+?)</span>'
- def _getLinks(self, id, page=1):
+ def _get_links(self, id, page=1):
gridFile = self.load("http://turbobit.net/downloadfolder/gridFile",
- get={"rootId": id, "rows": 200, "page": page}, decode=True)
+ get={'rootId': id, 'rows': 200, 'page': page})
grid = json_loads(gridFile)
if grid['rows']:
for i in grid['rows']:
yield i['id']
- for id in self._getLinks(id, page + 1):
+ for id in self._get_links(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))
+ def get_links(self):
+ return ["http://turbobit.net/%s.html" % id for id in self._get_links(self.info['pattern']['ID'])]
getInfo = create_getInfo(TurbobitNetFolder)