From c5c44335d970195780443d7ac2948e02f0e67ba1 Mon Sep 17 00:00:00 2001 From: Richard Lindner Date: Sat, 12 Sep 2015 13:55:48 +0200 Subject: fixed Go4UpCom plugin and added parameter for preferred hoster --- module/plugins/crypter/Go4UpCom.py | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) mode change 100644 => 100755 module/plugins/crypter/Go4UpCom.py (limited to 'module/plugins/crypter/Go4UpCom.py') diff --git a/module/plugins/crypter/Go4UpCom.py b/module/plugins/crypter/Go4UpCom.py old mode 100644 new mode 100755 index 026982014..2d423a1a9 --- a/module/plugins/crypter/Go4UpCom.py +++ b/module/plugins/crypter/Go4UpCom.py @@ -4,18 +4,20 @@ import re import urlparse from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo +import json class Go4UpCom(SimpleCrypter): __name__ = "Go4UpCom" __type__ = "crypter" - __version__ = "0.13" + __version__ = "0.14" __status__ = "testing" __pattern__ = r'http://go4up\.com/(dl/\w{12}|rd/\w{12}/\d+)' __config__ = [("use_premium" , "bool", "Use premium account if available" , True), ("use_subfolder" , "bool", "Save package to subfolder" , True), - ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] + ("subfolder_per_pack", "bool", "Create a subfolder for each package", True), + ("preferred_hoster" , "int" , "Id of preferred hoster or 0 for all", 0)] __description__ = """Go4Up.com decrypter plugin""" __license__ = "GPLv3" @@ -32,19 +34,20 @@ class Go4UpCom(SimpleCrypter): def get_links(self): links = [] - - m = re.search(r'(/download/gethosts/.+?)"', self.html) - if m: - self.html = self.load(urlparse.urljoin("http://go4up.com/", m.group(1))) - pages = [self.load(url) for url in re.findall(self.LINK_PATTERN, self.html)] - else: - pages = [self.html] - - for html in pages: - try: - links.append(re.search(r'