From 834a315649a0090812118f34618e48aff160c162 Mon Sep 17 00:00:00 2001 From: Ivo Buff Date: Fri, 12 Jul 2013 00:45:36 +0200 Subject: SimplydebridCOM plugin added SimplydebridCOM plugin added --- module/plugins/accounts/SimplydebridCOM.py | 39 +++++++++++++++++++++++ module/plugins/hooks/SimplydebridCOM.py | 19 ++++++++++++ module/plugins/hoster/SimplydebridCOM.py | 50 ++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 module/plugins/accounts/SimplydebridCOM.py create mode 100644 module/plugins/hooks/SimplydebridCOM.py create mode 100644 module/plugins/hoster/SimplydebridCOM.py diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py new file mode 100644 index 000000000..1679187f6 --- /dev/null +++ b/module/plugins/accounts/SimplydebridCOM.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +from module.plugins.Account import Account + +import re +from time import mktime, strptime + +class SimplydebridCOM(Account): + __name__ = "SimplydebridCOM" + __version__ = "0.1" + __type__ = "account" + __description__ = """Simply-Debrid.com account plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + def loadAccountInfo(self, user, req): + get_data = { + } + response = req.load("http://simply-debrid.com/api.php?login=2&u="+self.loginname+"&p="+self.password, get = get_data, decode = True, just_header = False) + if(response[len(response)-1] == ";"): #remove ; if the v entry ends with ; + response = response[0:len(response)-1] + data = [x.strip() for x in response.split(";")] + if str(data[0]) != "1": + account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} + else: + account_info = { + "trafficleft": -1, + "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")), + "premium": True + } + return account_info + + def login(self, user, data, req): + self.loginname = user + self.password = data["password"] + get_data = { + } + response = req.load("http://simply-debrid.com/api.php?login=1&u="+self.loginname+"&p="+self.password, get = get_data, decode = True, just_header = False) + if response != "02: loggin success": + self.wrongPassword() \ No newline at end of file diff --git a/module/plugins/hooks/SimplydebridCOM.py b/module/plugins/hooks/SimplydebridCOM.py new file mode 100644 index 000000000..af415db23 --- /dev/null +++ b/module/plugins/hooks/SimplydebridCOM.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster + +class SimplydebridCOM(MultiHoster): + __name__ = "SimplydebridCOM" + __version__ = "0.01" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", "False"),("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Simply-Debrid.com hook plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + def getHoster(self): + page = getURL("http://simply-debrid.com/api.php?list=1") + if(page[len(page)-1] == ";"): #remove ; if the page entry ends with ; + page = page[0:len(page)-1] + return [x.strip() for x in page.replace("\"","").split(";")] \ No newline at end of file diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py new file mode 100644 index 000000000..262b0b607 --- /dev/null +++ b/module/plugins/hoster/SimplydebridCOM.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from module.plugins.Hoster import Hoster +from module.utils import html_unescape +from urllib import quote, unquote +from time import sleep +import re + +class SimplydebridCOM(Hoster): + __name__ = "SimplydebridCOM" + __version__ = "0.1" + __type__ = "hoster" + __pattern__ = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd.php/*" + __description__ = """simply-debrid.com hoster plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + def setup(self): + self.resumeDownload = self.multiDL = True + self.chunkLimit = 1 + + def process(self, pyfile): + #print pyfile.url + if not self.account: + self.logError(_("Please enter your simply-debrid.com account or deactivate this plugin")) + self.fail("No simply-debrid.com account provided") + + self.logDebug("simply-debrid.com: Old URL: %s" % pyfile.url) + + #fix the links for simply-debrid.com! + new_url = pyfile.url + new_url = new_url.replace("clz.to", "cloudzer.net/file") + new_url = new_url.replace("http://share-online", "http://www.share-online") + + if re.match(self.__pattern__, new_url): + new_url = new_url + else: + page = self.req.load('http://simply-debrid.com/api.php?dl='+new_url)#+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) + if(re.search(r'tiger\sLink',page,re.I) or re.search(r'Invalid\sLink',page,re.I) or (re.search(r'api',page,re.I) and re.search(r'error',page,re.I))): + self.fail('Unable to unrestrict link') + #print page + new_url = page + + #print new_url + self.setWait(5) + self.wait() + self.logDebug("Unrestricted URL: " + new_url) + + self.download(new_url, disposition=True) \ No newline at end of file -- cgit v1.2.3 From 88f6fcac584da7e822d9ac4084553972c521f044 Mon Sep 17 00:00:00 2001 From: Ivo Buff Date: Fri, 12 Jul 2013 11:28:40 +0200 Subject: Cleanup Some cleanup and changed tabs to 4 spaces --- module/plugins/accounts/SimplydebridCOM.py | 56 ++++++++++------------ module/plugins/hooks/SimplydebridCOM.py | 24 +++++----- module/plugins/hoster/SimplydebridCOM.py | 75 ++++++++++++++---------------- 3 files changed, 73 insertions(+), 82 deletions(-) diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py index 1679187f6..53d707877 100644 --- a/module/plugins/accounts/SimplydebridCOM.py +++ b/module/plugins/accounts/SimplydebridCOM.py @@ -5,35 +5,29 @@ import re from time import mktime, strptime class SimplydebridCOM(Account): - __name__ = "SimplydebridCOM" - __version__ = "0.1" - __type__ = "account" - __description__ = """Simply-Debrid.com account plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - def loadAccountInfo(self, user, req): - get_data = { - } - response = req.load("http://simply-debrid.com/api.php?login=2&u="+self.loginname+"&p="+self.password, get = get_data, decode = True, just_header = False) - if(response[len(response)-1] == ";"): #remove ; if the v entry ends with ; - response = response[0:len(response)-1] - data = [x.strip() for x in response.split(";")] - if str(data[0]) != "1": - account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} - else: - account_info = { - "trafficleft": -1, - "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")), - "premium": True - } - return account_info + __name__ = "SimplydebridCOM" + __version__ = "0.1" + __type__ = "account" + __description__ = """Simply-Debrid.com account plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") - def login(self, user, data, req): - self.loginname = user - self.password = data["password"] - get_data = { - } - response = req.load("http://simply-debrid.com/api.php?login=1&u="+self.loginname+"&p="+self.password, get = get_data, decode = True, just_header = False) - if response != "02: loggin success": - self.wrongPassword() \ No newline at end of file + def loadAccountInfo(self, user, req): + response = req.load("http://simply-debrid.com/api.php?login=2&u="+self.loginname+"&p="+self.password, decode = True, just_header = False) + data = [x.strip() for x in response.split(";")] + if str(data[0]) != "1": + account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} + else: + account_info = { + "trafficleft": -1, + "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")), + "premium": True + } + return account_info + + def login(self, user, data, req): + self.loginname = user + self.password = data["password"] + response = req.load("http://simply-debrid.com/api.php?login=1&u="+self.loginname+"&p="+self.password, decode = True, just_header = False) + if response != "02: loggin success": + self.wrongPassword() \ No newline at end of file diff --git a/module/plugins/hooks/SimplydebridCOM.py b/module/plugins/hooks/SimplydebridCOM.py index af415db23..79083f724 100644 --- a/module/plugins/hooks/SimplydebridCOM.py +++ b/module/plugins/hooks/SimplydebridCOM.py @@ -4,16 +4,16 @@ from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster class SimplydebridCOM(MultiHoster): - __name__ = "SimplydebridCOM" - __version__ = "0.01" - __type__ = "hook" - __config__ = [("activated", "bool", "Activated", "False"),("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),("hosterList", "str", "Hoster list (comma separated)", "")] - __description__ = """Simply-Debrid.com hook plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") + __name__ = "SimplydebridCOM" + __version__ = "0.01" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", "False"),("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Simply-Debrid.com hook plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") - def getHoster(self): - page = getURL("http://simply-debrid.com/api.php?list=1") - if(page[len(page)-1] == ";"): #remove ; if the page entry ends with ; - page = page[0:len(page)-1] - return [x.strip() for x in page.replace("\"","").split(";")] \ No newline at end of file + def getHoster(self): + page = getURL("http://simply-debrid.com/api.php?list=1") + if(page[len(page)-1] == ";"): #remove ; if the page entry ends with ; + page = page[0:len(page)-1] + return [x.strip() for x in page.replace("\"","").split(";")] \ No newline at end of file diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py index 262b0b607..c4bce15b1 100644 --- a/module/plugins/hoster/SimplydebridCOM.py +++ b/module/plugins/hoster/SimplydebridCOM.py @@ -8,43 +8,40 @@ from time import sleep import re class SimplydebridCOM(Hoster): - __name__ = "SimplydebridCOM" - __version__ = "0.1" - __type__ = "hoster" - __pattern__ = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd.php/*" - __description__ = """simply-debrid.com hoster plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - def setup(self): - self.resumeDownload = self.multiDL = True - self.chunkLimit = 1 - - def process(self, pyfile): - #print pyfile.url - if not self.account: - self.logError(_("Please enter your simply-debrid.com account or deactivate this plugin")) - self.fail("No simply-debrid.com account provided") - - self.logDebug("simply-debrid.com: Old URL: %s" % pyfile.url) - - #fix the links for simply-debrid.com! - new_url = pyfile.url - new_url = new_url.replace("clz.to", "cloudzer.net/file") - new_url = new_url.replace("http://share-online", "http://www.share-online") - - if re.match(self.__pattern__, new_url): - new_url = new_url - else: - page = self.req.load('http://simply-debrid.com/api.php?dl='+new_url)#+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) - if(re.search(r'tiger\sLink',page,re.I) or re.search(r'Invalid\sLink',page,re.I) or (re.search(r'api',page,re.I) and re.search(r'error',page,re.I))): - self.fail('Unable to unrestrict link') - #print page - new_url = page - - #print new_url - self.setWait(5) - self.wait() - self.logDebug("Unrestricted URL: " + new_url) + __name__ = "SimplydebridCOM" + __version__ = "0.1" + __type__ = "hoster" + __pattern__ = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd.php/*" + __description__ = """simply-debrid.com hoster plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") - self.download(new_url, disposition=True) \ No newline at end of file + def setup(self): + self.resumeDownload = self.multiDL = True + self.chunkLimit = 1 + + def process(self, pyfile): + if not self.account: + self.logError(_("Please enter your simply-debrid.com account or deactivate this plugin")) + self.fail("No simply-debrid.com account provided") + + self.logDebug("simply-debrid.com: Old URL: %s" % pyfile.url) + + #fix the links for simply-debrid.com! + new_url = pyfile.url + new_url = new_url.replace("clz.to", "cloudzer.net/file") + new_url = new_url.replace("http://share-online", "http://www.share-online") + + if re.match(self.__pattern__, new_url): + new_url = new_url + else: + page = self.req.load('http://simply-debrid.com/api.php?dl='+new_url)#+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) + if('tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page)): + self.fail('Unable to unrestrict link') + new_url = page + + self.setWait(5) + self.wait() + self.logDebug("Unrestricted URL: " + new_url) + + self.download(new_url, disposition=True) \ No newline at end of file -- cgit v1.2.3 From abac8315248b6a72b0b4906548d9372f459cdd2e Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 20 Jul 2013 18:14:08 +0200 Subject: Code optimized --- module/plugins/accounts/SimplydebridCOM.py | 18 +++++++++--------- module/plugins/hooks/SimplydebridCOM.py | 8 ++++---- module/plugins/hoster/SimplydebridCOM.py | 20 +++++++++----------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py index 53d707877..faa6091c5 100644 --- a/module/plugins/accounts/SimplydebridCOM.py +++ b/module/plugins/accounts/SimplydebridCOM.py @@ -10,24 +10,24 @@ class SimplydebridCOM(Account): __type__ = "account" __description__ = """Simply-Debrid.com account plugin""" __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") + __author_mail__ = ("kagenoshin@gmx.ch") def loadAccountInfo(self, user, req): - response = req.load("http://simply-debrid.com/api.php?login=2&u="+self.loginname+"&p="+self.password, decode = True, just_header = False) + get_data = {'login': 2, 'u': self.loginname, 'p': self.password} + response = req.load("http://simply-debrid.com/api.php, get=get_data, decode=True) data = [x.strip() for x in response.split(";")] if str(data[0]) != "1": - account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} + return {"premium": False} else: - account_info = { + return { "trafficleft": -1, - "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")), - "premium": True + "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")) } - return account_info def login(self, user, data, req): self.loginname = user self.password = data["password"] - response = req.load("http://simply-debrid.com/api.php?login=1&u="+self.loginname+"&p="+self.password, decode = True, just_header = False) + get_data = {'login': 1, 'u': self.loginname, 'p': self.password} + response = req.load("http://simply-debrid.com/api.php, get=get_data, decode=True) if response != "02: loggin success": - self.wrongPassword() \ No newline at end of file + self.wrongPassword() diff --git a/module/plugins/hooks/SimplydebridCOM.py b/module/plugins/hooks/SimplydebridCOM.py index 79083f724..721dce6ca 100644 --- a/module/plugins/hooks/SimplydebridCOM.py +++ b/module/plugins/hooks/SimplydebridCOM.py @@ -7,13 +7,13 @@ class SimplydebridCOM(MultiHoster): __name__ = "SimplydebridCOM" __version__ = "0.01" __type__ = "hook" - __config__ = [("activated", "bool", "Activated", "False"),("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),("hosterList", "str", "Hoster list (comma separated)", "")] + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Simply-Debrid.com hook plugin""" __author_name__ = ("Kagenoshin") __author_mail__ = ("kagenoshin@gmx.ch") def getHoster(self): page = getURL("http://simply-debrid.com/api.php?list=1") - if(page[len(page)-1] == ";"): #remove ; if the page entry ends with ; - page = page[0:len(page)-1] - return [x.strip() for x in page.replace("\"","").split(";")] \ No newline at end of file + return [x.strip() for x in page.rstrip(';').replace("\"","").split(";")] diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py index c4bce15b1..499c17145 100644 --- a/module/plugins/hoster/SimplydebridCOM.py +++ b/module/plugins/hoster/SimplydebridCOM.py @@ -24,24 +24,22 @@ class SimplydebridCOM(Hoster): if not self.account: self.logError(_("Please enter your simply-debrid.com account or deactivate this plugin")) self.fail("No simply-debrid.com account provided") - - self.logDebug("simply-debrid.com: Old URL: %s" % pyfile.url) - + + self.logDebug("Old URL: %s" % pyfile.url) + #fix the links for simply-debrid.com! new_url = pyfile.url new_url = new_url.replace("clz.to", "cloudzer.net/file") new_url = new_url.replace("http://share-online", "http://www.share-online") - - if re.match(self.__pattern__, new_url): - new_url = new_url - else: - page = self.req.load('http://simply-debrid.com/api.php?dl='+new_url)#+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) + + if not re.match(self.__pattern__, new_url): + page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) #+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) if('tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page)): self.fail('Unable to unrestrict link') new_url = page - + self.setWait(5) self.wait() self.logDebug("Unrestricted URL: " + new_url) - - self.download(new_url, disposition=True) \ No newline at end of file + + self.download(new_url, disposition=True) -- cgit v1.2.3 From 3964f4231fa5ff68b07a50d23d3b233a0735612d Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 20 Jul 2013 20:35:18 +0200 Subject: Simplydebrid: fixed syntax error + code reformatted + removed unused imports --- module/plugins/accounts/SimplydebridCOM.py | 13 +++++-------- module/plugins/hooks/SimplydebridCOM.py | 3 ++- module/plugins/hoster/SimplydebridCOM.py | 8 ++++---- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py index faa6091c5..2b14a37c2 100644 --- a/module/plugins/accounts/SimplydebridCOM.py +++ b/module/plugins/accounts/SimplydebridCOM.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- +from time import mktime, strptime + from module.plugins.Account import Account -import re -from time import mktime, strptime class SimplydebridCOM(Account): __name__ = "SimplydebridCOM" @@ -14,20 +14,17 @@ class SimplydebridCOM(Account): def loadAccountInfo(self, user, req): get_data = {'login': 2, 'u': self.loginname, 'p': self.password} - response = req.load("http://simply-debrid.com/api.php, get=get_data, decode=True) + response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) data = [x.strip() for x in response.split(";")] if str(data[0]) != "1": return {"premium": False} else: - return { - "trafficleft": -1, - "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")) - } + return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))} def login(self, user, data, req): self.loginname = user self.password = data["password"] get_data = {'login': 1, 'u': self.loginname, 'p': self.password} - response = req.load("http://simply-debrid.com/api.php, get=get_data, decode=True) + response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) if response != "02: loggin success": self.wrongPassword() diff --git a/module/plugins/hooks/SimplydebridCOM.py b/module/plugins/hooks/SimplydebridCOM.py index 721dce6ca..b45d289ee 100644 --- a/module/plugins/hooks/SimplydebridCOM.py +++ b/module/plugins/hooks/SimplydebridCOM.py @@ -3,6 +3,7 @@ from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster + class SimplydebridCOM(MultiHoster): __name__ = "SimplydebridCOM" __version__ = "0.01" @@ -16,4 +17,4 @@ class SimplydebridCOM(MultiHoster): def getHoster(self): page = getURL("http://simply-debrid.com/api.php?list=1") - return [x.strip() for x in page.rstrip(';').replace("\"","").split(";")] + return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py index 499c17145..69c5b8af1 100644 --- a/module/plugins/hoster/SimplydebridCOM.py +++ b/module/plugins/hoster/SimplydebridCOM.py @@ -1,12 +1,12 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from module.plugins.Hoster import Hoster -from module.utils import html_unescape from urllib import quote, unquote -from time import sleep import re +from module.plugins.Hoster import Hoster + + class SimplydebridCOM(Hoster): __name__ = "SimplydebridCOM" __version__ = "0.1" @@ -34,7 +34,7 @@ class SimplydebridCOM(Hoster): if not re.match(self.__pattern__, new_url): page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) #+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) - if('tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page)): + if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): self.fail('Unable to unrestrict link') new_url = page -- cgit v1.2.3 From 4d6f805c40f48cda9c57bc2e4a8f09bc37e046ec Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 20 Jul 2013 20:43:35 +0200 Subject: Simplydebrid: renamed to standard --- module/plugins/accounts/SimplydebridCOM.py | 30 -------------------- module/plugins/accounts/SimplydebridCom.py | 30 ++++++++++++++++++++ module/plugins/hooks/SimplydebridCOM.py | 20 ------------- module/plugins/hooks/SimplydebridCom.py | 20 +++++++++++++ module/plugins/hoster/SimplydebridCOM.py | 45 ------------------------------ module/plugins/hoster/SimplydebridCom.py | 45 ++++++++++++++++++++++++++++++ 6 files changed, 95 insertions(+), 95 deletions(-) delete mode 100644 module/plugins/accounts/SimplydebridCOM.py create mode 100644 module/plugins/accounts/SimplydebridCom.py delete mode 100644 module/plugins/hooks/SimplydebridCOM.py create mode 100644 module/plugins/hooks/SimplydebridCom.py delete mode 100644 module/plugins/hoster/SimplydebridCOM.py create mode 100644 module/plugins/hoster/SimplydebridCom.py diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py deleted file mode 100644 index 2b14a37c2..000000000 --- a/module/plugins/accounts/SimplydebridCOM.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from time import mktime, strptime - -from module.plugins.Account import Account - - -class SimplydebridCOM(Account): - __name__ = "SimplydebridCOM" - __version__ = "0.1" - __type__ = "account" - __description__ = """Simply-Debrid.com account plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - def loadAccountInfo(self, user, req): - get_data = {'login': 2, 'u': self.loginname, 'p': self.password} - response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) - data = [x.strip() for x in response.split(";")] - if str(data[0]) != "1": - return {"premium": False} - else: - return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))} - - def login(self, user, data, req): - self.loginname = user - self.password = data["password"] - get_data = {'login': 1, 'u': self.loginname, 'p': self.password} - response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) - if response != "02: loggin success": - self.wrongPassword() diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py new file mode 100644 index 000000000..82b499bbd --- /dev/null +++ b/module/plugins/accounts/SimplydebridCom.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +from time import mktime, strptime + +from module.plugins.Account import Account + + +class SimplydebridCom(Account): + __name__ = "SimplydebridCom" + __version__ = "0.1" + __type__ = "account" + __description__ = """Simply-Debrid.com account plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + def loadAccountInfo(self, user, req): + get_data = {'login': 2, 'u': self.loginname, 'p': self.password} + response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) + data = [x.strip() for x in response.split(";")] + if str(data[0]) != "1": + return {"premium": False} + else: + return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))} + + def login(self, user, data, req): + self.loginname = user + self.password = data["password"] + get_data = {'login': 1, 'u': self.loginname, 'p': self.password} + response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) + if response != "02: loggin success": + self.wrongPassword() diff --git a/module/plugins/hooks/SimplydebridCOM.py b/module/plugins/hooks/SimplydebridCOM.py deleted file mode 100644 index b45d289ee..000000000 --- a/module/plugins/hooks/SimplydebridCOM.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster - - -class SimplydebridCOM(MultiHoster): - __name__ = "SimplydebridCOM" - __version__ = "0.01" - __type__ = "hook" - __config__ = [("activated", "bool", "Activated", "False"), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] - __description__ = """Simply-Debrid.com hook plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - def getHoster(self): - page = getURL("http://simply-debrid.com/api.php?list=1") - return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py new file mode 100644 index 000000000..3272df567 --- /dev/null +++ b/module/plugins/hooks/SimplydebridCom.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster + + +class SimplydebridCom(MultiHoster): + __name__ = "SimplydebridCom" + __version__ = "0.01" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Simply-Debrid.com hook plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + def getHoster(self): + page = getURL("http://simply-debrid.com/api.php?list=1") + return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py deleted file mode 100644 index 69c5b8af1..000000000 --- a/module/plugins/hoster/SimplydebridCOM.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from urllib import quote, unquote -import re - -from module.plugins.Hoster import Hoster - - -class SimplydebridCOM(Hoster): - __name__ = "SimplydebridCOM" - __version__ = "0.1" - __type__ = "hoster" - __pattern__ = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd.php/*" - __description__ = """simply-debrid.com hoster plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - def setup(self): - self.resumeDownload = self.multiDL = True - self.chunkLimit = 1 - - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your simply-debrid.com account or deactivate this plugin")) - self.fail("No simply-debrid.com account provided") - - self.logDebug("Old URL: %s" % pyfile.url) - - #fix the links for simply-debrid.com! - new_url = pyfile.url - new_url = new_url.replace("clz.to", "cloudzer.net/file") - new_url = new_url.replace("http://share-online", "http://www.share-online") - - if not re.match(self.__pattern__, new_url): - page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) #+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) - if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): - self.fail('Unable to unrestrict link') - new_url = page - - self.setWait(5) - self.wait() - self.logDebug("Unrestricted URL: " + new_url) - - self.download(new_url, disposition=True) diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py new file mode 100644 index 000000000..2dcbd0f21 --- /dev/null +++ b/module/plugins/hoster/SimplydebridCom.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from urllib import quote, unquote +import re + +from module.plugins.Hoster import Hoster + + +class SimplydebridCom(Hoster): + __name__ = "SimplydebridCom" + __version__ = "0.1" + __type__ = "hoster" + __pattern__ = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd.php/*" + __description__ = """simply-debrid.com hoster plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + def setup(self): + self.resumeDownload = self.multiDL = True + self.chunkLimit = 1 + + def process(self, pyfile): + if not self.account: + self.logError(_("Please enter your simply-debrid.com account or deactivate this plugin")) + self.fail("No simply-debrid.com account provided") + + self.logDebug("Old URL: %s" % pyfile.url) + + #fix the links for simply-debrid.com! + new_url = pyfile.url + new_url = new_url.replace("clz.to", "cloudzer.net/file") + new_url = new_url.replace("http://share-online", "http://www.share-online") + + if not re.match(self.__pattern__, new_url): + page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) #+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) + if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): + self.fail('Unable to unrestrict link') + new_url = page + + self.setWait(5) + self.wait() + self.logDebug("Unrestricted URL: " + new_url) + + self.download(new_url, disposition=True) -- cgit v1.2.3 From b57439b737a749bf40f62662b6c4434331cc79b0 Mon Sep 17 00:00:00 2001 From: Ivo Buff Date: Sun, 21 Jul 2013 12:35:39 +0200 Subject: More link transformation Added all link transformations I got from the support --- module/plugins/hoster/SimplydebridCom.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 2dcbd0f21..f13b16ae0 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -31,6 +31,15 @@ class SimplydebridCom(Hoster): new_url = pyfile.url new_url = new_url.replace("clz.to", "cloudzer.net/file") new_url = new_url.replace("http://share-online", "http://www.share-online") + new_url = new_url.replace("ul.to", "uploaded.net/file") + new_url = new_url.replace("uploaded.com", "uploaded.net") + new_url = new_url.replace("filerio.com", "filerio.in") + new_url = new_url.replace("lumfile.com", "lumfile.se") + if('fileparadox' in new_url): + new_url = new_url.replace("http://", "https://") + + if re.match(self.__pattern__, new_url): + new_url = new_url if not re.match(self.__pattern__, new_url): page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) #+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) -- cgit v1.2.3 From 37d898f681e41fe9c9a8719a540eda59bfedd448 Mon Sep 17 00:00:00 2001 From: Stefano Date: Sun, 21 Jul 2013 12:58:42 +0200 Subject: Normalize line endings to avoid line endings merge conflicts --- .gitattributes | 21 + module/config/default.conf | 130 +- module/plugins/accounts/AlldebridCom.py | 78 +- module/plugins/accounts/Premium4Me.py | 44 +- module/plugins/accounts/PremiumizeMe.py | 88 +- module/plugins/accounts/RealdebridCom.py | 50 +- module/plugins/accounts/UploadheroCom.py | 68 +- module/plugins/accounts/X7To.py | 132 +- module/plugins/crypter/ILoadTo.py | 122 +- module/plugins/crypter/LinkSaveIn.py | 454 +++---- module/plugins/crypter/NCryptIn.py | 502 ++++---- module/plugins/crypter/ShareLinksBiz.py | 536 ++++---- module/plugins/crypter/UploadedToFolder.py | 100 +- module/plugins/crypter/WiiReloadedOrg.py | 102 +- module/plugins/hooks/Captcha9kw.py | 326 ++--- module/plugins/hooks/Premium4Me.py | 64 +- module/plugins/hoster/AlldebridCom.py | 168 +-- module/plugins/hoster/EgoFilesCom.py | 206 ++-- module/plugins/hoster/FreakshareCom.py | 334 ++--- module/plugins/hoster/Ftp.py | 180 +-- module/plugins/hoster/LuckyShareNet.py | 144 +-- module/plugins/hoster/PornhostCom.py | 152 +-- module/plugins/hoster/PornhubCom.py | 166 +-- module/plugins/hoster/Premium4Me.py | 140 +-- module/plugins/hoster/PremiumizeMe.py | 100 +- module/plugins/hoster/RealdebridCom.py | 176 +-- module/plugins/hoster/RedtubeCom.py | 112 +- module/plugins/hoster/ShareplaceCom.py | 168 +-- module/plugins/hoster/UploadStationCom.py | 40 +- module/plugins/hoster/UploadingCom.py | 218 ++-- module/plugins/hoster/X7To.py | 186 +-- module/plugins/hoster/Xdcc.py | 458 +++---- module/plugins/hoster/YourfilesTo.py | 166 +-- module/plugins/hoster/ZeveraCom.py | 214 ++-- module/web/media/default/css/default.css | 1814 ++++++++++++++-------------- module/web/media/default/css/window.css | 146 +-- module/web/templates/default/base.html | 360 +++--- module/web/templates/default/captcha.html | 82 +- module/web/templates/default/home.html | 530 ++++---- module/web/templates/default/queue.html | 206 ++-- module/web/templates/default/window.html | 90 +- 41 files changed, 4697 insertions(+), 4676 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..e34533a0d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,21 @@ +# Set default behaviour, in case users don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files we want to always be normalized and converted +# to native line endings on checkout. +*.py text +*.js text +*.po text +*.cfg text +*.md text +*.in text +*.txt text +*.sh text +*.json text +*.html text +.htm text + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.mo binary \ No newline at end of file diff --git a/module/config/default.conf b/module/config/default.conf index 335ca10fe..2e9152ba2 100644 --- a/module/config/default.conf +++ b/module/config/default.conf @@ -1,65 +1,65 @@ -version: 1 - -remote - "Remote": - int port : "Port" = 7227 - ip listenaddr : "Adress" = 0.0.0.0 - bool nolocalauth : "No authentication on local connections" = True - bool activated : "Activated" = True -ssl - "SSL": - bool activated : "Activated"= False - file cert : "SSL Certificate" = ssl.crt - file key : "SSL Key" = ssl.key -webinterface - "Webinterface": - bool activated : "Activated" = True - builtin;threaded;fastcgi;lightweight server : "Server" = builtin - bool https : "Use HTTPS" = False - ip host : "IP" = 0.0.0.0 - int port : "Port" = 8001 - str template : "Template" = default - str prefix: "Path Prefix" = -log - "Log": - bool file_log : "File Log" = True - folder log_folder : "Folder" = Logs - int log_count : "Count" = 5 - int log_size : "Size in kb" = 100 - bool log_rotate : "Log Rotate" = True -general - "General": - en;de;fr;it;es;nl;sv;ru;pl;cs;sr;pt_BR language : "Language" = en - folder download_folder : "Download Folder" = Downloads - bool debug_mode : "Debug Mode" = False - bool checksum : "Use Checksum" = False - int min_free_space : "Min Free Space (MB)" = 200 - bool folder_per_package : "Create folder for each package" = True - int renice : "CPU Priority" = 0 -download - "Download": - int chunks : "Max connections for one download" = 3 - int max_downloads : "Max Parallel Downloads" = 3 - int max_speed : "Max Download Speed in kb/s" = -1 - bool limit_speed : "Limit Download Speed" = False - str interface : "Download interface to bind (ip or Name)" = None - bool ipv6 : "Allow IPv6" = False - bool skip_existing : "Skip already existing files" = False -permission - "Permissions": - bool change_user : "Change user of running process" = False - str user : "Username" = user - str folder : "Folder Permission mode" = 0755 - bool change_file : "Change file mode of downloads" = False - str file : "Filemode for Downloads" = 0644 - bool change_group : "Change group of running process" = False - str group : "Groupname" = users - bool change_dl : "Change Group and User of Downloads" = False -reconnect - "Reconnect": - bool activated : "Use Reconnect" = False - str method : "Method" = None - time startTime : "Start" = 0:00 - time endTime : "End" = 0:00 -downloadTime - "Download Time": - time start : "Start" = 0:00 - time end : "End" = 0:00 -proxy - "Proxy": - str address : "Address" = "localhost" - int port : "Port" = 7070 - http;socks4;socks5 type : "Protocol" = http - str username : "Username" = None - password password : "Password" = None - bool proxy : "Use Proxy" = False +version: 1 + +remote - "Remote": + int port : "Port" = 7227 + ip listenaddr : "Adress" = 0.0.0.0 + bool nolocalauth : "No authentication on local connections" = True + bool activated : "Activated" = True +ssl - "SSL": + bool activated : "Activated"= False + file cert : "SSL Certificate" = ssl.crt + file key : "SSL Key" = ssl.key +webinterface - "Webinterface": + bool activated : "Activated" = True + builtin;threaded;fastcgi;lightweight server : "Server" = builtin + bool https : "Use HTTPS" = False + ip host : "IP" = 0.0.0.0 + int port : "Port" = 8001 + str template : "Template" = default + str prefix: "Path Prefix" = +log - "Log": + bool file_log : "File Log" = True + folder log_folder : "Folder" = Logs + int log_count : "Count" = 5 + int log_size : "Size in kb" = 100 + bool log_rotate : "Log Rotate" = True +general - "General": + en;de;fr;it;es;nl;sv;ru;pl;cs;sr;pt_BR language : "Language" = en + folder download_folder : "Download Folder" = Downloads + bool debug_mode : "Debug Mode" = False + bool checksum : "Use Checksum" = False + int min_free_space : "Min Free Space (MB)" = 200 + bool folder_per_package : "Create folder for each package" = True + int renice : "CPU Priority" = 0 +download - "Download": + int chunks : "Max connections for one download" = 3 + int max_downloads : "Max Parallel Downloads" = 3 + int max_speed : "Max Download Speed in kb/s" = -1 + bool limit_speed : "Limit Download Speed" = False + str interface : "Download interface to bind (ip or Name)" = None + bool ipv6 : "Allow IPv6" = False + bool skip_existing : "Skip already existing files" = False +permission - "Permissions": + bool change_user : "Change user of running process" = False + str user : "Username" = user + str folder : "Folder Permission mode" = 0755 + bool change_file : "Change file mode of downloads" = False + str file : "Filemode for Downloads" = 0644 + bool change_group : "Change group of running process" = False + str group : "Groupname" = users + bool change_dl : "Change Group and User of Downloads" = False +reconnect - "Reconnect": + bool activated : "Use Reconnect" = False + str method : "Method" = None + time startTime : "Start" = 0:00 + time endTime : "End" = 0:00 +downloadTime - "Download Time": + time start : "Start" = 0:00 + time end : "End" = 0:00 +proxy - "Proxy": + str address : "Address" = "localhost" + int port : "Port" = 7070 + http;socks4;socks5 type : "Protocol" = http + str username : "Username" = None + password password : "Password" = None + bool proxy : "Use Proxy" = False diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index beaddeac9..baaa9d264 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -1,46 +1,46 @@ -from module.plugins.Account import Account -import xml.dom.minidom as dom -from BeautifulSoup import BeautifulSoup -from time import time -import re +from module.plugins.Account import Account +import xml.dom.minidom as dom +from BeautifulSoup import BeautifulSoup +from time import time +import re import urllib - -class AlldebridCom(Account): - __name__ = "AlldebridCom" - __version__ = "0.21" - __type__ = "account" - __description__ = """AllDebrid.com account plugin""" - __author_name__ = ("Andy, Voigt") - __author_mail__ = ("spamsales@online.de") - - def loadAccountInfo(self, user, req): - data = self.getAccountData(user) - page = req.load("http://www.alldebrid.com/account/") - soup=BeautifulSoup(page) - #Try to parse expiration date directly from the control panel page (better accuracy) - try: - time_text=soup.find('div',attrs={'class':'remaining_time_text'}).strong.string - self.log.debug("Account expires in: %s" % time_text) - p = re.compile('\d+') - exp_data=p.findall(time_text) - exp_time=time()+int(exp_data[0])*24*60*60+int(exp_data[1])*60*60+(int(exp_data[2])-1)*60 - #Get expiration date from API - except: - data = self.getAccountData(user) - page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, data["password"])) - self.log.debug(page) - xml = dom.parseString(page) - exp_time=time()+int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue)*86400 - account_info = {"validuntil": exp_time, "trafficleft": -1} - return account_info - - def login(self, user, data, req): + +class AlldebridCom(Account): + __name__ = "AlldebridCom" + __version__ = "0.21" + __type__ = "account" + __description__ = """AllDebrid.com account plugin""" + __author_name__ = ("Andy, Voigt") + __author_mail__ = ("spamsales@online.de") + + def loadAccountInfo(self, user, req): + data = self.getAccountData(user) + page = req.load("http://www.alldebrid.com/account/") + soup=BeautifulSoup(page) + #Try to parse expiration date directly from the control panel page (better accuracy) + try: + time_text=soup.find('div',attrs={'class':'remaining_time_text'}).strong.string + self.log.debug("Account expires in: %s" % time_text) + p = re.compile('\d+') + exp_data=p.findall(time_text) + exp_time=time()+int(exp_data[0])*24*60*60+int(exp_data[1])*60*60+(int(exp_data[2])-1)*60 + #Get expiration date from API + except: + data = self.getAccountData(user) + page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, data["password"])) + self.log.debug(page) + xml = dom.parseString(page) + exp_time=time()+int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue)*86400 + account_info = {"validuntil": exp_time, "trafficleft": -1} + return account_info + + def login(self, user, data, req): urlparams = urllib.urlencode({'action':'login','login_login':user,'login_password':data["password"]}) page = req.load("http://www.alldebrid.com/register/?%s" % (urlparams)) - - if "This login doesn't exist" in page: - self.wrongPassword() + + if "This login doesn't exist" in page: + self.wrongPassword() if "The password is not valid" in page: self.wrongPassword() diff --git a/module/plugins/accounts/Premium4Me.py b/module/plugins/accounts/Premium4Me.py index c95b9b129..fbca3ce84 100644 --- a/module/plugins/accounts/Premium4Me.py +++ b/module/plugins/accounts/Premium4Me.py @@ -1,23 +1,23 @@ -from module.plugins.Account import Account - -class Premium4Me(Account): - __name__ = "Premium4Me" - __version__ = "0.03" - __type__ = "account" - __description__ = """Premium.to account plugin""" - __author_name__ = ("RaNaN", "zoidberg", "stickell") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") - - def loadAccountInfo(self, user, req): - traffic = req.load("http://premium.to/api/traffic.php?authcode=%s" % self.authcode) - - account_info = {"trafficleft": int(traffic) / 1024, - "validuntil": -1} - - return account_info - - def login(self, user, data, req): - self.authcode = req.load("http://premium.to/api/getauthcode.php?username=%s&password=%s" % (user, data["password"])).strip() - - if "wrong username" in self.authcode: +from module.plugins.Account import Account + +class Premium4Me(Account): + __name__ = "Premium4Me" + __version__ = "0.03" + __type__ = "account" + __description__ = """Premium.to account plugin""" + __author_name__ = ("RaNaN", "zoidberg", "stickell") + __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") + + def loadAccountInfo(self, user, req): + traffic = req.load("http://premium.to/api/traffic.php?authcode=%s" % self.authcode) + + account_info = {"trafficleft": int(traffic) / 1024, + "validuntil": -1} + + return account_info + + def login(self, user, data, req): + self.authcode = req.load("http://premium.to/api/getauthcode.php?username=%s&password=%s" % (user, data["password"])).strip() + + if "wrong username" in self.authcode: self.wrongPassword() \ No newline at end of file diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index 1a446b842..696fdf88f 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -1,44 +1,44 @@ -from module.plugins.Account import Account - -from module.common.json_layer import json_loads - -class PremiumizeMe(Account): - __name__ = "PremiumizeMe" - __version__ = "0.11" - __type__ = "account" - __description__ = """Premiumize.Me account plugin""" - - __author_name__ = ("Florian Franzen") - __author_mail__ = ("FlorianFranzen@gmail.com") - - def loadAccountInfo(self, user, req): - - # Get user data from premiumize.me - status = self.getAccountStatus(user, req) - self.logDebug(status) - - # Parse account info - account_info = {"validuntil": float(status['result']['expires']), - "trafficleft": max(0, status['result']['trafficleft_bytes'] / 1024)} - - if status['result']['type'] == 'free': - account_info['premium'] = False - - return account_info - - def login(self, user, data, req): - - # Get user data from premiumize.me - status = self.getAccountStatus(user, req) - - # Check if user and password are valid - if status['status'] != 200: - self.wrongPassword() - - - def getAccountStatus(self, user, req): - - # Use premiumize.me API v1 (see https://secure.premiumize.me/?show=api) to retrieve account info and return the parsed json answer - answer = req.load("https://api.premiumize.me/pm-api/v1.php?method=accountstatus¶ms[login]=%s¶ms[pass]=%s" % (user, self.accounts[user]['password'])) - return json_loads(answer) - +from module.plugins.Account import Account + +from module.common.json_layer import json_loads + +class PremiumizeMe(Account): + __name__ = "PremiumizeMe" + __version__ = "0.11" + __type__ = "account" + __description__ = """Premiumize.Me account plugin""" + + __author_name__ = ("Florian Franzen") + __author_mail__ = ("FlorianFranzen@gmail.com") + + def loadAccountInfo(self, user, req): + + # Get user data from premiumize.me + status = self.getAccountStatus(user, req) + self.logDebug(status) + + # Parse account info + account_info = {"validuntil": float(status['result']['expires']), + "trafficleft": max(0, status['result']['trafficleft_bytes'] / 1024)} + + if status['result']['type'] == 'free': + account_info['premium'] = False + + return account_info + + def login(self, user, data, req): + + # Get user data from premiumize.me + status = self.getAccountStatus(user, req) + + # Check if user and password are valid + if status['status'] != 200: + self.wrongPassword() + + + def getAccountStatus(self, user, req): + + # Use premiumize.me API v1 (see https://secure.premiumize.me/?show=api) to retrieve account info and return the parsed json answer + answer = req.load("https://api.premiumize.me/pm-api/v1.php?method=accountstatus¶ms[login]=%s¶ms[pass]=%s" % (user, self.accounts[user]['password'])) + return json_loads(answer) + diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index adbd090db..847a925d4 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -1,25 +1,25 @@ -from module.plugins.Account import Account -import xml.dom.minidom as dom - -class RealdebridCom(Account): - __name__ = "RealdebridCom" - __version__ = "0.41" - __type__ = "account" - __description__ = """Real-Debrid.com account plugin""" - __author_name__ = ("Devirex, Hazzard") - __author_mail__ = ("naibaf_11@yahoo.de") - - def loadAccountInfo(self, user, req): - page = req.load("http://real-debrid.com/api/account.php") - xml = dom.parseString(page) - account_info = {"validuntil": int(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue), - "trafficleft": -1} - - return account_info - - def login(self, user, data, req): - page = req.load("https://real-debrid.com/ajax/login.php", get = {"user": user, "pass": data["password"]}) - #page = req.load("https://real-debrid.com/login.html", post={"user": user, "pass": data["password"]}, cookies=True) - - if "Your login informations are incorrect" in page: - self.wrongPassword() +from module.plugins.Account import Account +import xml.dom.minidom as dom + +class RealdebridCom(Account): + __name__ = "RealdebridCom" + __version__ = "0.41" + __type__ = "account" + __description__ = """Real-Debrid.com account plugin""" + __author_name__ = ("Devirex, Hazzard") + __author_mail__ = ("naibaf_11@yahoo.de") + + def loadAccountInfo(self, user, req): + page = req.load("http://real-debrid.com/api/account.php") + xml = dom.parseString(page) + account_info = {"validuntil": int(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue), + "trafficleft": -1} + + return account_info + + def login(self, user, data, req): + page = req.load("https://real-debrid.com/ajax/login.php", get = {"user": user, "pass": data["password"]}) + #page = req.load("https://real-debrid.com/login.html", post={"user": user, "pass": data["password"]}, cookies=True) + + if "Your login informations are incorrect" in page: + self.wrongPassword() diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index f1e0649e6..18ed69ae6 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -1,35 +1,35 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from module.plugins.Account import Account -import re,datetime,time - -class UploadheroCom(Account): - __name__ = "UploadheroCom" - __version__ = "0.1" - __type__ = "account" - __description__ = """Uploadhero.com account plugin""" - __author_name__ = ("mcmyst") - __author_mail__ = ("mcmyst@hotmail.fr") - - - def loadAccountInfo(self, user, req): - premium_pattern = re.compile('Il vous reste ([0-9]+) jours premium.') - - data = self.getAccountData(user) - page = req.load("http://uploadhero.com/my-account") - - if premium_pattern.search(page): - end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(page).group(1))) - end_date = time.mktime(future.timetuple()) - account_info = {"validuntil": end_date, "trafficleft": -1, "premium": True} - else: - account_info = {"validuntil": -1, "trafficleft": -1, "premium": False} - - return account_info - - def login(self, user, data, req): - page = req.load("http://uploadhero.com/lib/connexion.php", post={"pseudo_login": user, "password_login": data["password"]}) - - if "mot de passe invalide" in page: +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from module.plugins.Account import Account +import re,datetime,time + +class UploadheroCom(Account): + __name__ = "UploadheroCom" + __version__ = "0.1" + __type__ = "account" + __description__ = """Uploadhero.com account plugin""" + __author_name__ = ("mcmyst") + __author_mail__ = ("mcmyst@hotmail.fr") + + + def loadAccountInfo(self, user, req): + premium_pattern = re.compile('Il vous reste ([0-9]+) jours premium.') + + data = self.getAccountData(user) + page = req.load("http://uploadhero.com/my-account") + + if premium_pattern.search(page): + end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(page).group(1))) + end_date = time.mktime(future.timetuple()) + account_info = {"validuntil": end_date, "trafficleft": -1, "premium": True} + else: + account_info = {"validuntil": -1, "trafficleft": -1, "premium": False} + + return account_info + + def login(self, user, data, req): + page = req.load("http://uploadhero.com/lib/connexion.php", post={"pseudo_login": user, "password_login": data["password"]}) + + if "mot de passe invalide" in page: self.wrongPassword() \ No newline at end of file diff --git a/module/plugins/accounts/X7To.py b/module/plugins/accounts/X7To.py index 8c2bf245a..90f65d55e 100644 --- a/module/plugins/accounts/X7To.py +++ b/module/plugins/accounts/X7To.py @@ -1,66 +1,66 @@ -# -*- coding: utf-8 -*- - -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - @author: ernieb -""" - -import re -from time import strptime, mktime - -from module.plugins.Account import Account - -class X7To(Account): - __name__ = "X7To" - __version__ = "0.1" - __type__ = "account" - __description__ = """X7.To account plugin""" - __author_name__ = ("ernieb") - __author_mail__ = ("ernieb") - - def loadAccountInfo(self, user, req): - page = req.load("http://www.x7.to/my") - - validCheck = re.search("Premium-Mitglied bis ([0-9]*-[0-9]*-[0-9]*)", page, re.IGNORECASE) - if validCheck: - valid = validCheck.group(1) - valid = int(mktime(strptime(valid, "%Y-%m-%d"))) - else: - validCheck = re.search("Premium member until ([0-9]*-[0-9]*-[0-9]*)", page, re.IGNORECASE) - if validCheck: - valid = validCheck.group(1) - valid = int(mktime(strptime(valid, "%Y-%m-%d"))) - else: - valid = 0 - - trafficleft = re.search(r'([\d]*[,]?[\d]?[\d]?) (KB|MB|GB)', page, re.IGNORECASE) - if trafficleft: - units = float(trafficleft.group(1).replace(",", ".")) - pow = {'KB': 0, 'MB': 1, 'GB': 2}[trafficleft.group(2)] - trafficleft = int(units * 1024 ** pow) - else: - trafficleft = -1 - - return {"trafficleft": trafficleft, "validuntil": valid} - - - def login(self, user, data, req): - #req.cj.setCookie("share.cx", "lang", "english") - page = req.load("http://x7.to/lang/en", None, {}) - page = req.load("http://x7.to/james/login", None, - {"redirect": "http://www.x7.to/", "id": user, "pw": data['password'], "submit": "submit"}) - - if "Username and password are not matching." in page: - self.wrongPassword() +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + @author: ernieb +""" + +import re +from time import strptime, mktime + +from module.plugins.Account import Account + +class X7To(Account): + __name__ = "X7To" + __version__ = "0.1" + __type__ = "account" + __description__ = """X7.To account plugin""" + __author_name__ = ("ernieb") + __author_mail__ = ("ernieb") + + def loadAccountInfo(self, user, req): + page = req.load("http://www.x7.to/my") + + validCheck = re.search("Premium-Mitglied bis ([0-9]*-[0-9]*-[0-9]*)", page, re.IGNORECASE) + if validCheck: + valid = validCheck.group(1) + valid = int(mktime(strptime(valid, "%Y-%m-%d"))) + else: + validCheck = re.search("Premium member until ([0-9]*-[0-9]*-[0-9]*)", page, re.IGNORECASE) + if validCheck: + valid = validCheck.group(1) + valid = int(mktime(strptime(valid, "%Y-%m-%d"))) + else: + valid = 0 + + trafficleft = re.search(r'([\d]*[,]?[\d]?[\d]?) (KB|MB|GB)', page, re.IGNORECASE) + if trafficleft: + units = float(trafficleft.group(1).replace(",", ".")) + pow = {'KB': 0, 'MB': 1, 'GB': 2}[trafficleft.group(2)] + trafficleft = int(units * 1024 ** pow) + else: + trafficleft = -1 + + return {"trafficleft": trafficleft, "validuntil": valid} + + + def login(self, user, data, req): + #req.cj.setCookie("share.cx", "lang", "english") + page = req.load("http://x7.to/lang/en", None, {}) + page = req.load("http://x7.to/james/login", None, + {"redirect": "http://www.x7.to/", "id": user, "pw": data['password'], "submit": "submit"}) + + if "Username and password are not matching." in page: + self.wrongPassword() diff --git a/module/plugins/crypter/ILoadTo.py b/module/plugins/crypter/ILoadTo.py index 9815ae266..100ba2bc6 100644 --- a/module/plugins/crypter/ILoadTo.py +++ b/module/plugins/crypter/ILoadTo.py @@ -1,62 +1,62 @@ - -import re -import urllib - -from module.plugins.Crypter import Crypter -from module.lib.BeautifulSoup import BeautifulSoup - -class ILoadTo(Crypter): - __name__ = "ILoadTo" - __type__ = "crypter" - __pattern__ = r"http://iload\.to/go/\d+-[\w\.-]+/" - __config__ = [] - __version__ = "0.1" - __description__ = """iload.to Crypter Plugin""" - __author_name__ = ("hzpz") - __author_mail__ = ("none") - - - def decrypt(self, pyfile): - url = pyfile.url - src = self.req.load(str(url)) - soup = BeautifulSoup(src) - - # find captcha URL and decrypt - captchaTag = soup.find("img", attrs={"id": "Captcha"}) - if not captchaTag: - self.fail("Cannot find Captcha") - - captchaUrl = "http://iload.to" + captchaTag["src"] - self.logDebug("Captcha URL: %s" % captchaUrl) - result = self.decryptCaptcha(str(captchaUrl)) - - # find captcha form URL - formTag = soup.find("form", attrs={"id": "CaptchaForm"}) - formUrl = "http://iload.to" + formTag["action"] - self.logDebug("Form URL: %s" % formUrl) - - # submit decrypted captcha - self.req.lastURL = url - src = self.req.load(str(formUrl), post={'captcha': result}) - - # find decrypted links - links = re.findall(r"", src) - - if not len(links) > 0: - self.retry() - - self.correctCaptcha() - - cleanedLinks = [] - for link in links: - if link.startswith("http://dontknow.me/at/?"): - cleanedLink = urllib.unquote(link[23:]) - else: - cleanedLink = link - self.logDebug("Link: %s" % cleanedLink) - cleanedLinks.append(cleanedLink) - - self.logDebug("Decrypted %d links" % len(links)) - - self.pyfile.package().password = "iload.to" + +import re +import urllib + +from module.plugins.Crypter import Crypter +from module.lib.BeautifulSoup import BeautifulSoup + +class ILoadTo(Crypter): + __name__ = "ILoadTo" + __type__ = "crypter" + __pattern__ = r"http://iload\.to/go/\d+-[\w\.-]+/" + __config__ = [] + __version__ = "0.1" + __description__ = """iload.to Crypter Plugin""" + __author_name__ = ("hzpz") + __author_mail__ = ("none") + + + def decrypt(self, pyfile): + url = pyfile.url + src = self.req.load(str(url)) + soup = BeautifulSoup(src) + + # find captcha URL and decrypt + captchaTag = soup.find("img", attrs={"id": "Captcha"}) + if not captchaTag: + self.fail("Cannot find Captcha") + + captchaUrl = "http://iload.to" + captchaTag["src"] + self.logDebug("Captcha URL: %s" % captchaUrl) + result = self.decryptCaptcha(str(captchaUrl)) + + # find captcha form URL + formTag = soup.find("form", attrs={"id": "CaptchaForm"}) + formUrl = "http://iload.to" + formTag["action"] + self.logDebug("Form URL: %s" % formUrl) + + # submit decrypted captcha + self.req.lastURL = url + src = self.req.load(str(formUrl), post={'captcha': result}) + + # find decrypted links + links = re.findall(r"", src) + + if not len(links) > 0: + self.retry() + + self.correctCaptcha() + + cleanedLinks = [] + for link in links: + if link.startswith("http://dontknow.me/at/?"): + cleanedLink = urllib.unquote(link[23:]) + else: + cleanedLink = link + self.logDebug("Link: %s" % cleanedLink) + cleanedLinks.append(cleanedLink) + + self.logDebug("Decrypted %d links" % len(links)) + + self.pyfile.package().password = "iload.to" self.packages.append((self.pyfile.package().name, cleanedLinks, self.pyfile.package().folder)) \ No newline at end of file diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 30cc61055..e021316bf 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -1,227 +1,227 @@ -# -*- coding: utf-8 -*- - -# -# v2.01 - hagg -# * cnl2 and web links are skipped if JS is not available (instead of failing the package) -# * only best available link source is used (priority: cnl2>rsdf>ccf>dlc>web -# - -from Crypto.Cipher import AES -from module.plugins.Crypter import Crypter -from module.unescape import unescape -import base64 -import binascii -import re - -class LinkSaveIn(Crypter): - __name__ = "LinkSaveIn" - __type__ = "crypter" - __pattern__ = r"http://(www\.)?linksave.in/(?P\w+)$" - __version__ = "2.01" - __description__ = """LinkSave.in Crypter Plugin""" - __author_name__ = ("fragonib") - __author_mail__ = ("fragonib[AT]yahoo[DOT]es") - - # Constants - _JK_KEY_ = "jk" - _CRYPTED_KEY_ = "crypted" - HOSTER_DOMAIN = "linksave.in" - - def setup(self): - self.html = None - self.fileid = None - self.captcha = False - self.package = None - self.preferred_sources = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web'] - - def decrypt(self, pyfile): - - # Init - self.package = pyfile.package() - self.fileid = re.match(self.__pattern__, pyfile.url).group('id') - self.req.cj.setCookie(self.HOSTER_DOMAIN, "Linksave_Language", "english") - - # Request package - self.html = self.load(self.pyfile.url) - if not self.isOnline(): - self.offline() - - # Check for protection - if self.isPasswordProtected(): - self.unlockPasswordProtection() - self.handleErrors() - - if self.isCaptchaProtected(): - self.captcha = True - self.unlockCaptchaProtection() - self.handleErrors() - - # Get package name and folder - (package_name, folder_name) = self.getPackageInfo() - - # Extract package links - package_links = [] - for type_ in self.preferred_sources: - package_links.extend(self.handleLinkSource(type_)) - if package_links: # use only first source which provides links - break - package_links = set(package_links) - - # Pack - if package_links: - self.packages = [(package_name, package_links, folder_name)] - else: - self.fail('Could not extract any links') - - def isOnline(self): - if "Error 404 - Folder not found!" in self.html: - self.logDebug("File not found") - return False - return True - - def isPasswordProtected(self): - if re.search(r'''Captcha:" in self.html: - self.logDebug("Links are captcha protected") - return True - return False - - def unlockPasswordProtection(self): - password = self.getPassword() - self.logDebug("Submitting password [%s] for protected links" % password) - post = {"id": self.fileid, "besucherpasswort": password, 'login': 'submit'} - self.html = self.load(self.pyfile.url, post=post) - - def unlockCaptchaProtection(self): - captcha_hash = re.search(r'name="hash" value="([^"]+)', self.html).group(1) - captcha_url = re.search(r'src=".(/captcha/cap.php\?hsh=[^"]+)', self.html).group(1) - captcha_code = self.decryptCaptcha("http://linksave.in" + captcha_url, forceUser=True) - self.html = self.load(self.pyfile.url, post={"id": self.fileid, "hash": captcha_hash, "code": captcha_code}) - - def getPackageInfo(self): - name = self.pyfile.package().name - folder = self.pyfile.package().folder - self.logDebug("Defaulting to pyfile name [%s] and folder [%s] for package" % (name, folder)) - return name, folder - - def handleErrors(self): - if "The visitorpassword you have entered is wrong" in self.html: - self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail("Incorrect password, please set right password on 'Edit package' form and retry") - - if self.captcha: - if "Wrong code. Please retry" in self.html: - self.logDebug("Invalid captcha, retrying") - self.invalidCaptcha() - self.retry() - else: - self.correctCaptcha() - - def handleLinkSource(self, type_): - if type_ == 'cnl2': - return self.handleCNL2() - elif type_ in ('rsdf', 'ccf', 'dlc'): - return self.handleContainer(type_) - elif type_ == 'web': - return self.handleWebLinks() - else: - self.fail('unknown source type "%s" (this is probably a bug)' % type_) - - def handleWebLinks(self): - package_links = [] - self.logDebug("Search for Web links") - if not self.js: - self.logDebug("no JS -> skip Web links") - else: - #@TODO: Gather paginated web links - pattern = r'(.*)', response)[-1] - jseval = self.js.eval("document = { write: function(e) { return e; } }; %s" % jscode) - dlLink = re.search(r'http://linksave\.in/dl-\w+', jseval).group(0) - self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink) - response = self.load(dlLink) - link = unescape(re.search(r'') - for pattern in patterns: - rexpr = re.compile(pattern, re.DOTALL) - content = re.sub(rexpr, "", content) - return content - - def removeContainers(self,package_links): - tmp_package_links = package_links[:] - for link in tmp_package_links: - self.logDebug(link) - if ".dlc" in link or ".ccf" in link or ".rsdf" in link: - self.logDebug("Removing [%s] from package_links" % link) - package_links.remove(link) - - if len(package_links) > 0: - return package_links - else: - return tmp_package_links - - def isOnline(self): - if "Your folder does not exist" in self.cleanedHtml: - self.logDebug("File not found") - return False - return True - - def isProtected(self): - if re.search(r'''''', self.cleanedHtml): - self.logDebug("Links are protected") - return True - return False - - def getPackageInfo(self): - title_re = r'

(?P[^<]+).*?</span>.*?</h2>' - m = re.findall(title_re, self.html, re.DOTALL) - if m is not None: - title = m[-1].strip() - name = folder = title - self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) - else: - name = self.package.name - folder = self.package.folder - self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) - return name, folder - - def unlockProtection(self): - - postData = {} - - form = re.search(r'''<form\ name="protected"(.*?)</form>''', self.cleanedHtml, re.DOTALL).group(1) - - # Submit package password - if "password" in form: - password = self.getPassword() - self.logDebug("Submitting password [%s] for protected links" % password) - postData['password'] = password - - # Resolve anicaptcha - if "anicaptcha" in form: - self.captcha = True - self.logDebug("Captcha protected, resolving captcha") - captchaUri = re.search(r'src="(/temp/anicaptcha/[^"]+)', form).group(1) - captcha = self.decryptCaptcha("http://ncrypt.in" + captchaUri) - self.logDebug("Captcha resolved [%s]" % captcha) - postData['captcha'] = captcha - - # Resolve recaptcha - if "recaptcha" in form: - self.captcha = True - id = re.search(r'\?k=(.*?)"', form).group(1) - self.logDebug("Resolving ReCaptcha with key [%s]" % id) - recaptcha = ReCaptcha(self) - challenge, code = recaptcha.challenge(id) - postData['recaptcha_challenge_field'] = challenge - postData['recaptcha_response_field'] = code - - # Resolve circlecaptcha - if "circlecaptcha" in form: - self.captcha = True - self.logDebug("Captcha protected") - captcha_img_url = "http://ncrypt.in/classes/captcha/circlecaptcha.php" - coords = self.decryptCaptcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') - self.logDebug("Captcha resolved, coords [%s]" % str(coords)) - self.captcha_post_url = self.pyfile.url - - postData['circle.x'] = coords[0] - postData['circle.y'] = coords[1] - - - # Unlock protection - postData['submit_protected'] = 'Continue to folder ' - return self.load(self.pyfile.url, post=postData) - - def handleErrors(self): - - if "This password is invalid!" in self.cleanedHtml: - self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail("Incorrect password, please set right password on 'Edit package' form and retry") - - if self.captcha: - if "The securitycheck was wrong!" in self.cleanedHtml: - self.logDebug("Invalid captcha, retrying") - self.invalidCaptcha() - self.retry() - else: - self.correctCaptcha() - - def handleWebLinks(self): - package_links = [] - self.logDebug("Handling Web links") - - pattern = r"(http://ncrypt\.in/link-.*?=)" - links = re.findall(pattern, self.html) - self.logDebug("Decrypting %d Web links" % len(links)) - for i, link in enumerate(links): - self.logDebug("Decrypting Web link %d, %s" % (i+1, link)) - try: - url = link.replace("link-", "frame-") - link = self.load(url, just_header=True)['location'] - package_links.append(link) - except Exception, detail: - self.logDebug("Error decrypting Web link %s, %s" % (link, detail)) - return package_links - - def handleContainers(self): - package_links = [] - self.logDebug("Handling Container links") - - pattern = r"/container/(rsdf|dlc|ccf)/([a-z0-9]+)" - containersLinks = re.findall(pattern, self.html) - self.logDebug("Decrypting %d Container links" % len(containersLinks)) - for containerLink in containersLinks: - link = "http://ncrypt.in/container/%s/%s.%s" % (containerLink[0], containerLink[1], containerLink[0]) - package_links.append(link) - return package_links - - def handleCNL2(self): - package_links = [] - self.logDebug("Handling CNL2 links") - - if 'cnl2_output' in self.cleanedHtml: - try: - (vcrypted, vjk) = self._getCipherParams() - for (crypted, jk) in zip(vcrypted, vjk): - package_links.extend(self._getLinks(crypted, jk)) - except: - self.fail("Unable to decrypt CNL2 links") - return package_links - - def _getCipherParams(self): - - pattern = r'<input.*?name="%s".*?value="(.*?)"' - - # Get jk - jk_re = pattern % NCryptIn._JK_KEY_ - vjk = re.findall(jk_re, self.html) - - # Get crypted - crypted_re = pattern % NCryptIn._CRYPTED_KEY_ - vcrypted = re.findall(crypted_re, self.html) - - # Log and return - self.logDebug("Detected %d crypted blocks" % len(vcrypted)) - return vcrypted, vjk - - def _getLinks(self, crypted, jk): - - # Get key - jreturn = self.js.eval("%s f()" % jk) - self.logDebug("JsEngine returns value [%s]" % jreturn) - key = binascii.unhexlify(jreturn) - - # Decode crypted - crypted = base64.standard_b64decode(crypted) - - # Decrypt - Key = key - IV = key - obj = AES.new(Key, AES.MODE_CBC, IV) - text = obj.decrypt(crypted) - - # Extract links - text = text.replace("\x00", "").replace("\r", "") - links = text.split("\n") - links = filter(lambda x: x != "", links) - - # Log and return - self.logDebug("Block has %d links" % len(links)) - return links +# -*- coding: utf-8 -*- + +from Crypto.Cipher import AES +from module.plugins.Crypter import Crypter +from module.plugins.ReCaptcha import ReCaptcha +import base64 +import binascii +import re + +class NCryptIn(Crypter): + __name__ = "NCryptIn" + __type__ = "crypter" + __pattern__ = r"http://(?:www\.)?ncrypt.in/folder-([^/\?]+)" + __version__ = "1.22" + __description__ = """NCrypt.in Crypter Plugin""" + __author_name__ = ("fragonib") + __author_mail__ = ("fragonib[AT]yahoo[DOT]es") + + # Constants + _JK_KEY_ = "jk" + _CRYPTED_KEY_ = "crypted" + + def setup(self): + self.html = None + self.cleanedHtml = None + self.captcha = False + self.package = None + + def decrypt(self, pyfile): + + # Init + self.package = pyfile.package() + + # Request package + self.html = self.load(self.pyfile.url) + self.cleanedHtml = self.removeCrap(self.html) + if not self.isOnline(): + self.offline() + + # Check for protection + if self.isProtected(): + self.html = self.unlockProtection() + self.cleanedHtml = self.removeCrap(self.html) + self.handleErrors() + + # Get package name and folder + (package_name, folder_name) = self.getPackageInfo() + + # Extract package links + package_links = [] + package_links.extend(self.handleWebLinks()) + package_links.extend(self.handleContainers()) + package_links.extend(self.handleCNL2()) + package_links = self.removeContainers(package_links) + package_links = set(package_links) + + # Pack + self.packages = [(package_name, package_links, folder_name)] + + def removeCrap(self, content): + patterns = (r'(type="hidden".*?(name=".*?")?.*?value=".*?")', + r'display:none;">(.*?)</(div|span)>', + r'<div\s+class="jdownloader"(.*?)</div>', + r'<iframe\s+style="display:none(.*?)</iframe>') + for pattern in patterns: + rexpr = re.compile(pattern, re.DOTALL) + content = re.sub(rexpr, "", content) + return content + + def removeContainers(self,package_links): + tmp_package_links = package_links[:] + for link in tmp_package_links: + self.logDebug(link) + if ".dlc" in link or ".ccf" in link or ".rsdf" in link: + self.logDebug("Removing [%s] from package_links" % link) + package_links.remove(link) + + if len(package_links) > 0: + return package_links + else: + return tmp_package_links + + def isOnline(self): + if "Your folder does not exist" in self.cleanedHtml: + self.logDebug("File not found") + return False + return True + + def isProtected(self): + if re.search(r'''<form.*?name.*?protected.*?>''', self.cleanedHtml): + self.logDebug("Links are protected") + return True + return False + + def getPackageInfo(self): + title_re = r'<h2><span.*?class="arrow".*?>(?P<title>[^<]+).*?</span>.*?</h2>' + m = re.findall(title_re, self.html, re.DOTALL) + if m is not None: + title = m[-1].strip() + name = folder = title + self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) + else: + name = self.package.name + folder = self.package.folder + self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) + return name, folder + + def unlockProtection(self): + + postData = {} + + form = re.search(r'''<form\ name="protected"(.*?)</form>''', self.cleanedHtml, re.DOTALL).group(1) + + # Submit package password + if "password" in form: + password = self.getPassword() + self.logDebug("Submitting password [%s] for protected links" % password) + postData['password'] = password + + # Resolve anicaptcha + if "anicaptcha" in form: + self.captcha = True + self.logDebug("Captcha protected, resolving captcha") + captchaUri = re.search(r'src="(/temp/anicaptcha/[^"]+)', form).group(1) + captcha = self.decryptCaptcha("http://ncrypt.in" + captchaUri) + self.logDebug("Captcha resolved [%s]" % captcha) + postData['captcha'] = captcha + + # Resolve recaptcha + if "recaptcha" in form: + self.captcha = True + id = re.search(r'\?k=(.*?)"', form).group(1) + self.logDebug("Resolving ReCaptcha with key [%s]" % id) + recaptcha = ReCaptcha(self) + challenge, code = recaptcha.challenge(id) + postData['recaptcha_challenge_field'] = challenge + postData['recaptcha_response_field'] = code + + # Resolve circlecaptcha + if "circlecaptcha" in form: + self.captcha = True + self.logDebug("Captcha protected") + captcha_img_url = "http://ncrypt.in/classes/captcha/circlecaptcha.php" + coords = self.decryptCaptcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') + self.logDebug("Captcha resolved, coords [%s]" % str(coords)) + self.captcha_post_url = self.pyfile.url + + postData['circle.x'] = coords[0] + postData['circle.y'] = coords[1] + + + # Unlock protection + postData['submit_protected'] = 'Continue to folder ' + return self.load(self.pyfile.url, post=postData) + + def handleErrors(self): + + if "This password is invalid!" in self.cleanedHtml: + self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") + self.fail("Incorrect password, please set right password on 'Edit package' form and retry") + + if self.captcha: + if "The securitycheck was wrong!" in self.cleanedHtml: + self.logDebug("Invalid captcha, retrying") + self.invalidCaptcha() + self.retry() + else: + self.correctCaptcha() + + def handleWebLinks(self): + package_links = [] + self.logDebug("Handling Web links") + + pattern = r"(http://ncrypt\.in/link-.*?=)" + links = re.findall(pattern, self.html) + self.logDebug("Decrypting %d Web links" % len(links)) + for i, link in enumerate(links): + self.logDebug("Decrypting Web link %d, %s" % (i+1, link)) + try: + url = link.replace("link-", "frame-") + link = self.load(url, just_header=True)['location'] + package_links.append(link) + except Exception, detail: + self.logDebug("Error decrypting Web link %s, %s" % (link, detail)) + return package_links + + def handleContainers(self): + package_links = [] + self.logDebug("Handling Container links") + + pattern = r"/container/(rsdf|dlc|ccf)/([a-z0-9]+)" + containersLinks = re.findall(pattern, self.html) + self.logDebug("Decrypting %d Container links" % len(containersLinks)) + for containerLink in containersLinks: + link = "http://ncrypt.in/container/%s/%s.%s" % (containerLink[0], containerLink[1], containerLink[0]) + package_links.append(link) + return package_links + + def handleCNL2(self): + package_links = [] + self.logDebug("Handling CNL2 links") + + if 'cnl2_output' in self.cleanedHtml: + try: + (vcrypted, vjk) = self._getCipherParams() + for (crypted, jk) in zip(vcrypted, vjk): + package_links.extend(self._getLinks(crypted, jk)) + except: + self.fail("Unable to decrypt CNL2 links") + return package_links + + def _getCipherParams(self): + + pattern = r'<input.*?name="%s".*?value="(.*?)"' + + # Get jk + jk_re = pattern % NCryptIn._JK_KEY_ + vjk = re.findall(jk_re, self.html) + + # Get crypted + crypted_re = pattern % NCryptIn._CRYPTED_KEY_ + vcrypted = re.findall(crypted_re, self.html) + + # Log and return + self.logDebug("Detected %d crypted blocks" % len(vcrypted)) + return vcrypted, vjk + + def _getLinks(self, crypted, jk): + + # Get key + jreturn = self.js.eval("%s f()" % jk) + self.logDebug("JsEngine returns value [%s]" % jreturn) + key = binascii.unhexlify(jreturn) + + # Decode crypted + crypted = base64.standard_b64decode(crypted) + + # Decrypt + Key = key + IV = key + obj = AES.new(Key, AES.MODE_CBC, IV) + text = obj.decrypt(crypted) + + # Extract links + text = text.replace("\x00", "").replace("\r", "") + links = text.split("\n") + links = filter(lambda x: x != "", links) + + # Log and return + self.logDebug("Block has %d links" % len(links)) + return links diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 1ffa5d41a..b0e735896 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -1,269 +1,269 @@ -# -*- coding: utf-8 -*- - -from Crypto.Cipher import AES -from module.plugins.Crypter import Crypter -from module.plugins.ReCaptcha import ReCaptcha -import base64 -import binascii -import re - - -class ShareLinksBiz(Crypter): - __name__ = "ShareLinksBiz" - __type__ = "crypter" - __pattern__ = r"(?P<base>http://[\w\.]*?(share-links|s2l)\.biz)/(?P<id>_?[0-9a-z]+)(/.*)?" - __version__ = "1.12" - __description__ = """Share-Links.biz Crypter""" - __author_name__ = ("fragonib") - __author_mail__ = ("fragonib[AT]yahoo[DOT]es") - - - def setup(self): - self.baseUrl = None - self.fileId = None - self.package = None - self.html = None - self.captcha = False - - def decrypt(self, pyfile): - - # Init - self.initFile(pyfile) - - # Request package - url = self.baseUrl + '/' + self.fileId - self.html = self.load(url, decode=True) - - # Unblock server (load all images) - self.unblockServer() - - # Check for protection - if self.isPasswordProtected(): - self.unlockPasswordProtection() - self.handleErrors() - - if self.isCaptchaProtected(): - self.captcha = True - self.unlockCaptchaProtection() - self.handleErrors() - - # Extract package links - package_links = [] - package_links.extend(self.handleWebLinks()) - package_links.extend(self.handleContainers()) - package_links.extend(self.handleCNL2()) - package_links = set(package_links) - - # Get package info - package_name, package_folder = self.getPackageInfo() - - # Pack - self.packages = [(package_name, package_links, package_folder)] - - def initFile(self, pyfile): - url = pyfile.url - if 's2l.biz' in url: - url = self.load(url, just_header=True)['location'] - self.baseUrl = re.search(self.__pattern__, url).group(1) - self.fileId = re.match(self.__pattern__, url).group('id') - self.package = pyfile.package() - - def isOnline(self): - if "No usable content was found" in self.html: - self.logDebug("File not found") - return False - return True - - def isPasswordProtected(self): - if re.search(r'''<form.*?id="passwordForm".*?>''', self.html): - self.logDebug("Links are protected") - return True - return False - - def isCaptchaProtected(self): - if '<map id="captchamap"' in self.html: - self.logDebug("Links are captcha protected") - return True - return False - - def unblockServer(self): - imgs = re.findall("(/template/images/.*?\.gif)", self.html) - for img in imgs: - self.load(self.baseUrl + img) - - def unlockPasswordProtection(self): - password = self.getPassword() - self.logDebug("Submitting password [%s] for protected links" % password) - post = {"password": password, 'login': 'Submit form'} - url = self.baseUrl + '/' + self.fileId - self.html = self.load(url, post=post, decode=True) - - def unlockCaptchaProtection(self): - # Get captcha map - captchaMap = self._getCaptchaMap() - self.logDebug("Captcha map with [%d] positions" % len(captchaMap.keys())) - - # Request user for captcha coords - m = re.search(r'<img src="/captcha.gif\?d=(.*?)&PHPSESSID=(.*?)&legend=1"', self.html) - captchaUrl = self.baseUrl + '/captcha.gif?d=%s&PHPSESSID=%s' % (m.group(1), m.group(2)) - self.logDebug("Waiting user for correct position") - coords = self.decryptCaptcha(captchaUrl, forceUser=True, imgtype="gif", result_type='positional') - self.logDebug("Captcha resolved, coords [%s]" % str(coords)) - - # Resolve captcha - href = self._resolveCoords(coords, captchaMap) - if href is None: - self.logDebug("Invalid captcha resolving, retrying") - self.invalidCaptcha() - self.setWait(5, False) - self.wait() - self.retry() - url = self.baseUrl + href - self.html = self.load(url, decode=True) - - def _getCaptchaMap(self): - map = {} - for m in re.finditer(r'<area shape="rect" coords="(.*?)" href="(.*?)"', self.html): - rect = eval('(' + m.group(1) + ')') - href = m.group(2) - map[rect] = href - return map - - def _resolveCoords(self, coords, captchaMap): - x, y = coords - for rect, href in captchaMap.items(): - x1, y1, x2, y2 = rect - if (x>=x1 and x<=x2) and (y>=y1 and y<=y2): - return href - - def handleErrors(self): - if "The inserted password was wrong" in self.html: - self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail("Incorrect password, please set right password on 'Edit package' form and retry") - - if self.captcha: - if "Your choice was wrong" in self.html: - self.logDebug("Invalid captcha, retrying") - self.invalidCaptcha() - self.setWait(5) - self.wait() - self.retry() - else: - self.correctCaptcha() - - def getPackageInfo(self): - name = folder = None - - # Extract from web package header - title_re = r'<h2><img.*?/>(.*)</h2>' - m = re.search(title_re, self.html, re.DOTALL) - if m is not None: - title = m.group(1).strip() - if 'unnamed' not in title: - name = folder = title - self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) - - # Fallback to defaults - if not name or not folder: - name = self.package.name - folder = self.package.folder - self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) - - # Return package info - return name, folder - - def handleWebLinks(self): - package_links = [] - self.logDebug("Handling Web links") - - #@TODO: Gather paginated web links - pattern = r"javascript:_get\('(.*?)', \d+, ''\)" - ids = re.findall(pattern, self.html) - self.logDebug("Decrypting %d Web links" % len(ids)) - for i, id in enumerate(ids): - try: - self.logDebug("Decrypting Web link %d, [%s]" % (i+1, id)) - dwLink = self.baseUrl + "/get/lnk/" + id - response = self.load(dwLink) - code = re.search(r'frm/(\d+)', response).group(1) - fwLink = self.baseUrl + "/get/frm/" + code - response = self.load(fwLink) - jscode = re.search(r'<script language="javascript">\s*eval\((.*)\)\s*</script>', response, re.DOTALL).group(1) - jscode = self.js.eval("f = %s" % jscode) - jslauncher = "window=''; parent={frames:{Main:{location:{href:''}}},location:''}; %s; parent.frames.Main.location.href" - dlLink = self.js.eval(jslauncher % jscode) - self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink) - package_links.append(dlLink) - except Exception, detail: - self.logDebug("Error decrypting Web link [%s], %s" % (id, detail)) - return package_links - - def handleContainers(self): - package_links = [] - self.logDebug("Handling Container links") - - pattern = r"javascript:_get\('(.*?)', 0, '(rsdf|ccf|dlc)'\)" - containersLinks = re.findall(pattern, self.html) - self.logDebug("Decrypting %d Container links" % len(containersLinks)) - for containerLink in containersLinks: - link = "%s/get/%s/%s" % (self.baseUrl, containerLink[1], containerLink[0]) - package_links.append(link) - return package_links - - def handleCNL2(self): - package_links = [] - self.logDebug("Handling CNL2 links") - - if '/lib/cnl2/ClicknLoad.swf' in self.html: - try: - (crypted, jk) = self._getCipherParams() - package_links.extend(self._getLinks(crypted, jk)) - except: - self.fail("Unable to decrypt CNL2 links") - return package_links - - def _getCipherParams(self): - - # Request CNL2 - code = re.search(r'ClicknLoad.swf\?code=(.*?)"', self.html).group(1) - url = "%s/get/cnl2/%s" % (self.baseUrl, code) - response = self.load(url) - params = response.split(";;") - - # Get jk - strlist = list(base64.standard_b64decode(params[1])) - strlist.reverse() - jk = ''.join(strlist) - - # Get crypted - strlist = list(base64.standard_b64decode(params[2])) - strlist.reverse() - crypted = ''.join(strlist) - - # Log and return - return crypted, jk - - def _getLinks(self, crypted, jk): - - # Get key - jreturn = self.js.eval("%s f()" % jk) - self.logDebug("JsEngine returns value [%s]" % jreturn) - key = binascii.unhexlify(jreturn) - - # Decode crypted - crypted = base64.standard_b64decode(crypted) - - # Decrypt - Key = key - IV = key - obj = AES.new(Key, AES.MODE_CBC, IV) - text = obj.decrypt(crypted) - - # Extract links - text = text.replace("\x00", "").replace("\r", "") - links = text.split("\n") - links = filter(lambda x: x != "", links) - - # Log and return - self.logDebug("Block has %d links" % len(links)) +# -*- coding: utf-8 -*- + +from Crypto.Cipher import AES +from module.plugins.Crypter import Crypter +from module.plugins.ReCaptcha import ReCaptcha +import base64 +import binascii +import re + + +class ShareLinksBiz(Crypter): + __name__ = "ShareLinksBiz" + __type__ = "crypter" + __pattern__ = r"(?P<base>http://[\w\.]*?(share-links|s2l)\.biz)/(?P<id>_?[0-9a-z]+)(/.*)?" + __version__ = "1.12" + __description__ = """Share-Links.biz Crypter""" + __author_name__ = ("fragonib") + __author_mail__ = ("fragonib[AT]yahoo[DOT]es") + + + def setup(self): + self.baseUrl = None + self.fileId = None + self.package = None + self.html = None + self.captcha = False + + def decrypt(self, pyfile): + + # Init + self.initFile(pyfile) + + # Request package + url = self.baseUrl + '/' + self.fileId + self.html = self.load(url, decode=True) + + # Unblock server (load all images) + self.unblockServer() + + # Check for protection + if self.isPasswordProtected(): + self.unlockPasswordProtection() + self.handleErrors() + + if self.isCaptchaProtected(): + self.captcha = True + self.unlockCaptchaProtection() + self.handleErrors() + + # Extract package links + package_links = [] + package_links.extend(self.handleWebLinks()) + package_links.extend(self.handleContainers()) + package_links.extend(self.handleCNL2()) + package_links = set(package_links) + + # Get package info + package_name, package_folder = self.getPackageInfo() + + # Pack + self.packages = [(package_name, package_links, package_folder)] + + def initFile(self, pyfile): + url = pyfile.url + if 's2l.biz' in url: + url = self.load(url, just_header=True)['location'] + self.baseUrl = re.search(self.__pattern__, url).group(1) + self.fileId = re.match(self.__pattern__, url).group('id') + self.package = pyfile.package() + + def isOnline(self): + if "No usable content was found" in self.html: + self.logDebug("File not found") + return False + return True + + def isPasswordProtected(self): + if re.search(r'''<form.*?id="passwordForm".*?>''', self.html): + self.logDebug("Links are protected") + return True + return False + + def isCaptchaProtected(self): + if '<map id="captchamap"' in self.html: + self.logDebug("Links are captcha protected") + return True + return False + + def unblockServer(self): + imgs = re.findall("(/template/images/.*?\.gif)", self.html) + for img in imgs: + self.load(self.baseUrl + img) + + def unlockPasswordProtection(self): + password = self.getPassword() + self.logDebug("Submitting password [%s] for protected links" % password) + post = {"password": password, 'login': 'Submit form'} + url = self.baseUrl + '/' + self.fileId + self.html = self.load(url, post=post, decode=True) + + def unlockCaptchaProtection(self): + # Get captcha map + captchaMap = self._getCaptchaMap() + self.logDebug("Captcha map with [%d] positions" % len(captchaMap.keys())) + + # Request user for captcha coords + m = re.search(r'<img src="/captcha.gif\?d=(.*?)&PHPSESSID=(.*?)&legend=1"', self.html) + captchaUrl = self.baseUrl + '/captcha.gif?d=%s&PHPSESSID=%s' % (m.group(1), m.group(2)) + self.logDebug("Waiting user for correct position") + coords = self.decryptCaptcha(captchaUrl, forceUser=True, imgtype="gif", result_type='positional') + self.logDebug("Captcha resolved, coords [%s]" % str(coords)) + + # Resolve captcha + href = self._resolveCoords(coords, captchaMap) + if href is None: + self.logDebug("Invalid captcha resolving, retrying") + self.invalidCaptcha() + self.setWait(5, False) + self.wait() + self.retry() + url = self.baseUrl + href + self.html = self.load(url, decode=True) + + def _getCaptchaMap(self): + map = {} + for m in re.finditer(r'<area shape="rect" coords="(.*?)" href="(.*?)"', self.html): + rect = eval('(' + m.group(1) + ')') + href = m.group(2) + map[rect] = href + return map + + def _resolveCoords(self, coords, captchaMap): + x, y = coords + for rect, href in captchaMap.items(): + x1, y1, x2, y2 = rect + if (x>=x1 and x<=x2) and (y>=y1 and y<=y2): + return href + + def handleErrors(self): + if "The inserted password was wrong" in self.html: + self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") + self.fail("Incorrect password, please set right password on 'Edit package' form and retry") + + if self.captcha: + if "Your choice was wrong" in self.html: + self.logDebug("Invalid captcha, retrying") + self.invalidCaptcha() + self.setWait(5) + self.wait() + self.retry() + else: + self.correctCaptcha() + + def getPackageInfo(self): + name = folder = None + + # Extract from web package header + title_re = r'<h2><img.*?/>(.*)</h2>' + m = re.search(title_re, self.html, re.DOTALL) + if m is not None: + title = m.group(1).strip() + if 'unnamed' not in title: + name = folder = title + self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) + + # Fallback to defaults + if not name or not folder: + name = self.package.name + folder = self.package.folder + self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) + + # Return package info + return name, folder + + def handleWebLinks(self): + package_links = [] + self.logDebug("Handling Web links") + + #@TODO: Gather paginated web links + pattern = r"javascript:_get\('(.*?)', \d+, ''\)" + ids = re.findall(pattern, self.html) + self.logDebug("Decrypting %d Web links" % len(ids)) + for i, id in enumerate(ids): + try: + self.logDebug("Decrypting Web link %d, [%s]" % (i+1, id)) + dwLink = self.baseUrl + "/get/lnk/" + id + response = self.load(dwLink) + code = re.search(r'frm/(\d+)', response).group(1) + fwLink = self.baseUrl + "/get/frm/" + code + response = self.load(fwLink) + jscode = re.search(r'<script language="javascript">\s*eval\((.*)\)\s*</script>', response, re.DOTALL).group(1) + jscode = self.js.eval("f = %s" % jscode) + jslauncher = "window=''; parent={frames:{Main:{location:{href:''}}},location:''}; %s; parent.frames.Main.location.href" + dlLink = self.js.eval(jslauncher % jscode) + self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink) + package_links.append(dlLink) + except Exception, detail: + self.logDebug("Error decrypting Web link [%s], %s" % (id, detail)) + return package_links + + def handleContainers(self): + package_links = [] + self.logDebug("Handling Container links") + + pattern = r"javascript:_get\('(.*?)', 0, '(rsdf|ccf|dlc)'\)" + containersLinks = re.findall(pattern, self.html) + self.logDebug("Decrypting %d Container links" % len(containersLinks)) + for containerLink in containersLinks: + link = "%s/get/%s/%s" % (self.baseUrl, containerLink[1], containerLink[0]) + package_links.append(link) + return package_links + + def handleCNL2(self): + package_links = [] + self.logDebug("Handling CNL2 links") + + if '/lib/cnl2/ClicknLoad.swf' in self.html: + try: + (crypted, jk) = self._getCipherParams() + package_links.extend(self._getLinks(crypted, jk)) + except: + self.fail("Unable to decrypt CNL2 links") + return package_links + + def _getCipherParams(self): + + # Request CNL2 + code = re.search(r'ClicknLoad.swf\?code=(.*?)"', self.html).group(1) + url = "%s/get/cnl2/%s" % (self.baseUrl, code) + response = self.load(url) + params = response.split(";;") + + # Get jk + strlist = list(base64.standard_b64decode(params[1])) + strlist.reverse() + jk = ''.join(strlist) + + # Get crypted + strlist = list(base64.standard_b64decode(params[2])) + strlist.reverse() + crypted = ''.join(strlist) + + # Log and return + return crypted, jk + + def _getLinks(self, crypted, jk): + + # Get key + jreturn = self.js.eval("%s f()" % jk) + self.logDebug("JsEngine returns value [%s]" % jreturn) + key = binascii.unhexlify(jreturn) + + # Decode crypted + crypted = base64.standard_b64decode(crypted) + + # Decrypt + Key = key + IV = key + obj = AES.new(Key, AES.MODE_CBC, IV) + text = obj.decrypt(crypted) + + # Extract links + text = text.replace("\x00", "").replace("\r", "") + links = text.split("\n") + links = filter(lambda x: x != "", links) + + # Log and return + self.logDebug("Block has %d links" % len(links)) return links \ No newline at end of file diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py index c514f23d0..88d4e04e8 100644 --- a/module/plugins/crypter/UploadedToFolder.py +++ b/module/plugins/crypter/UploadedToFolder.py @@ -1,50 +1,50 @@ -# -*- coding: utf-8 -*- - -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ - -import re - -from module.plugins.internal.SimpleCrypter import SimpleCrypter - - -class UploadedToFolder(SimpleCrypter): - __name__ = "UploadedToFolder" - __type__ = "crypter" - __pattern__ = r"http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<id>\w+)" - __version__ = "0.3" - __description__ = """UploadedTo Crypter Plugin""" - __author_name__ = ("stickell") - __author_mail__ = ("l.stickell@yahoo.it") - - PLAIN_PATTERN = r'<small class="date"><a href="(?P<plain>[\w/]+)" onclick=' - TITLE_PATTERN = r'<title>(?P<title>[^<]+)' - - def decrypt(self, pyfile): - self.html = self.load(pyfile.url) - - package_name, folder_name = self.getPackageNameAndFolder() - - m = re.search(self.PLAIN_PATTERN, self.html) - if m: - plain_link = 'http://uploaded.net/' + m.group('plain') - else: - self.fail('Parse error - Unable to find plain url list') - - self.html = self.load(plain_link) - package_links = self.html.split('\n')[:-1] - self.logDebug('Package has %d links' % len(package_links)) - - self.packages = [(package_name, package_links, folder_name)] +# -*- coding: utf-8 -*- + +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ + +import re + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class UploadedToFolder(SimpleCrypter): + __name__ = "UploadedToFolder" + __type__ = "crypter" + __pattern__ = r"http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P\w+)" + __version__ = "0.3" + __description__ = """UploadedTo Crypter Plugin""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + PLAIN_PATTERN = r'(?P[^<]+)' + + def decrypt(self, pyfile): + self.html = self.load(pyfile.url) + + package_name, folder_name = self.getPackageNameAndFolder() + + m = re.search(self.PLAIN_PATTERN, self.html) + if m: + plain_link = 'http://uploaded.net/' + m.group('plain') + else: + self.fail('Parse error - Unable to find plain url list') + + self.html = self.load(plain_link) + package_links = self.html.split('\n')[:-1] + self.logDebug('Package has %d links' % len(package_links)) + + self.packages = [(package_name, package_links, folder_name)] diff --git a/module/plugins/crypter/WiiReloadedOrg.py b/module/plugins/crypter/WiiReloadedOrg.py index 574a147c4..ba101892d 100644 --- a/module/plugins/crypter/WiiReloadedOrg.py +++ b/module/plugins/crypter/WiiReloadedOrg.py @@ -1,52 +1,52 @@ - -import re - -from module.plugins.Crypter import Crypter - -class WiiReloadedOrg(Crypter): - __name__ = "WiiReloadedOrg" - __type__ = "crypter" - __pattern__ = r"http://www\.wii-reloaded\.org/protect/get\.php\?i=.+" - __config__ = [("changeName", "bool", "Use Wii-Reloaded.org folder name", "True")] - __version__ = "0.1" - __description__ = """Wii-Reloaded.org Crypter Plugin""" - __author_name__ = ("hzpz") - __author_mail__ = ("none") - - - def decrypt(self, pyfile): - url = pyfile.url - src = self.req.load(str(url)) - - ids = re.findall(r"onClick=\"popup_dl\((.+)\)\"", src) - if len(ids) == 0: - self.fail("Unable to decrypt links, this plugin probably needs to be updated") - - packageName = self.pyfile.package().name - if self.getConfig("changeName"): - packageNameMatch = re.search(r"
(.+)
", src) - if not packageNameMatch: - self.logWarning("Unable to get folder name, this plugin probably needs to be updated") - else: - packageName = packageNameMatch.group(1) - - self.pyfile.package().password = "wii-reloaded.info" - - self.logDebug("Processing %d links" % len(ids)) - links = [] - for id in ids: - self.req.lastURL = str(url) - header = self.req.load("http://www.wii-reloaded.org/protect/hastesosiehtsaus.php?i=" + id, just_header=True) - self.logDebug("Header:\n" + header) - redirectLocationMatch = re.search(r"^Location: (.+)$", header, flags=re.MULTILINE) - if not redirectLocationMatch: - self.offline() - redirectLocation = redirectLocationMatch.group(1) - self.logDebug(len(redirectLocation)) - if not redirectLocation.startswith("http"): - self.offline() - self.logDebug("Decrypted link: %s" % redirectLocation) - links.append(redirectLocation) - - self.logDebug("Decrypted %d links" % len(links)) + +import re + +from module.plugins.Crypter import Crypter + +class WiiReloadedOrg(Crypter): + __name__ = "WiiReloadedOrg" + __type__ = "crypter" + __pattern__ = r"http://www\.wii-reloaded\.org/protect/get\.php\?i=.+" + __config__ = [("changeName", "bool", "Use Wii-Reloaded.org folder name", "True")] + __version__ = "0.1" + __description__ = """Wii-Reloaded.org Crypter Plugin""" + __author_name__ = ("hzpz") + __author_mail__ = ("none") + + + def decrypt(self, pyfile): + url = pyfile.url + src = self.req.load(str(url)) + + ids = re.findall(r"onClick=\"popup_dl\((.+)\)\"", src) + if len(ids) == 0: + self.fail("Unable to decrypt links, this plugin probably needs to be updated") + + packageName = self.pyfile.package().name + if self.getConfig("changeName"): + packageNameMatch = re.search(r"
(.+)
", src) + if not packageNameMatch: + self.logWarning("Unable to get folder name, this plugin probably needs to be updated") + else: + packageName = packageNameMatch.group(1) + + self.pyfile.package().password = "wii-reloaded.info" + + self.logDebug("Processing %d links" % len(ids)) + links = [] + for id in ids: + self.req.lastURL = str(url) + header = self.req.load("http://www.wii-reloaded.org/protect/hastesosiehtsaus.php?i=" + id, just_header=True) + self.logDebug("Header:\n" + header) + redirectLocationMatch = re.search(r"^Location: (.+)$", header, flags=re.MULTILINE) + if not redirectLocationMatch: + self.offline() + redirectLocation = redirectLocationMatch.group(1) + self.logDebug(len(redirectLocation)) + if not redirectLocation.startswith("http"): + self.offline() + self.logDebug("Decrypted link: %s" % redirectLocation) + links.append(redirectLocation) + + self.logDebug("Decrypted %d links" % len(links)) self.packages.append((packageName, links, packageName)) \ No newline at end of file diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 3bc00d8c2..cd622b7cd 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -1,163 +1,163 @@ -# -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - @author: mkaay, RaNaN, zoidberg -""" -from __future__ import with_statement - -from thread import start_new_thread -from base64 import b64encode -import cStringIO -import pycurl -import time - -from module.network.RequestFactory import getURL, getRequest -from module.network.HTTPRequest import BadHeader - -from module.plugins.Hook import Hook - -class Captcha9kw(Hook): - __name__ = "Captcha9kw" - __version__ = "0.07" - __description__ = """send captchas to 9kw.eu""" - __config__ = [("activated", "bool", "Activated", False), - ("force", "bool", "Force CT even if client is connected", True), - ("https", "bool", "Enable HTTPS", "False"), - ("confirm", "bool", "Confirm Captcha (Cost +6)", "False"), - ("captchaperhour", "int", "Captcha per hour (max. 9999)", "9999"), - ("prio", "int", "Prio 1-10 (Cost +1-10)", "0"), - ("timeout", "int", "Timeout (max. 300)", "220"), - ("passkey", "password", "API key", ""),] - __author_name__ = ("RaNaN") - __author_mail__ = ("RaNaN@pyload.org") - - API_URL = "://www.9kw.eu/index.cgi" - - def setup(self): - self.API_URL = "https"+self.API_URL if self.getConfig("https") else "http"+self.API_URL - self.info = {} - - def getCredits(self): - response = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "pyload": "1", "source": "pyload", "action": "usercaptchaguthaben" }) - - if response.isdigit(): - self.logInfo(_("%s credits left") % response) - self.info["credits"] = credits = int(response) - return credits - else: - self.logError(response) - return 0 - - def processCaptcha(self, task): - result = None - - with open(task.captchaFile, 'rb') as f: - data = f.read() - data = b64encode(data) - self.logDebug("%s : %s" % (task.captchaFile, data)) - if task.isPositional(): - mouse = 1 - else: - mouse = 0 - - response = getURL(self.API_URL, post = { - "apikey": self.getConfig("passkey"), - "prio": self.getConfig("prio"), - "confirm": self.getConfig("confirm"), - "captchaperhour": self.getConfig("captchaperhour"), - "maxtimeout": self.getConfig("timeout"), - "pyload": "1", - "source": "pyload", - "base64": "1", - "mouse": mouse, - "file-upload-01": data, - "action": "usercaptchaupload" }) - - if response.isdigit(): - self.logInfo(_("New CaptchaID from upload: %s : %s") % (response,task.captchaFile)) - - for i in range(1, 100, 1): - response2 = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "id": response,"pyload": "1","source": "pyload", "action": "usercaptchacorrectdata" }) - - if(response2 != ""): - break; - - time.sleep(3) - - result = response2 - task.data["ticket"] = response - self.logInfo("result %s : %s" % (response, result)) - task.setResult(result) - else: - self.logError("Bad upload: %s" % response) - return False - - def newCaptchaTask(self, task): - if not task.isTextual() and not task.isPositional(): - return False - - if not self.getConfig("passkey"): - return False - - if self.core.isClientConnected() and not self.getConfig("force"): - return False - - if self.getCredits() > 0: - task.handler.append(self) - task.setWaiting(self.getConfig("timeout")) - start_new_thread(self.processCaptcha, (task,)) - - else: - self.logError(_("Your Captcha 9kw.eu Account has not enough credits")) - - def captchaCorrect(self, task): - if "ticket" in task.data: - - try: - response = getURL(self.API_URL, - post={ "action": "usercaptchacorrectback", - "apikey": self.getConfig("passkey"), - "api_key": self.getConfig("passkey"), - "correct": "1", - "pyload": "1", - "source": "pyload", - "id": task.data["ticket"] } - ) - self.logInfo("Request correct: %s" % response) - - except BadHeader, e: - self.logError("Could not send correct request.", str(e)) - else: - self.logError("No CaptchaID for correct request (task %s) found." % task) - - def captchaInvalid(self, task): - if "ticket" in task.data: - - try: - response = getURL(self.API_URL, - post={ "action": "usercaptchacorrectback", - "apikey": self.getConfig("passkey"), - "api_key": self.getConfig("passkey"), - "correct": "2", - "pyload": "1", - "source": "pyload", - "id": task.data["ticket"] } - ) - self.logInfo("Request refund: %s" % response) - - except BadHeader, e: - self.logError("Could not send refund request.", str(e)) - else: - self.logError("No CaptchaID for not correct request (task %s) found." % task) +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + @author: mkaay, RaNaN, zoidberg +""" +from __future__ import with_statement + +from thread import start_new_thread +from base64 import b64encode +import cStringIO +import pycurl +import time + +from module.network.RequestFactory import getURL, getRequest +from module.network.HTTPRequest import BadHeader + +from module.plugins.Hook import Hook + +class Captcha9kw(Hook): + __name__ = "Captcha9kw" + __version__ = "0.07" + __description__ = """send captchas to 9kw.eu""" + __config__ = [("activated", "bool", "Activated", False), + ("force", "bool", "Force CT even if client is connected", True), + ("https", "bool", "Enable HTTPS", "False"), + ("confirm", "bool", "Confirm Captcha (Cost +6)", "False"), + ("captchaperhour", "int", "Captcha per hour (max. 9999)", "9999"), + ("prio", "int", "Prio 1-10 (Cost +1-10)", "0"), + ("timeout", "int", "Timeout (max. 300)", "220"), + ("passkey", "password", "API key", ""),] + __author_name__ = ("RaNaN") + __author_mail__ = ("RaNaN@pyload.org") + + API_URL = "://www.9kw.eu/index.cgi" + + def setup(self): + self.API_URL = "https"+self.API_URL if self.getConfig("https") else "http"+self.API_URL + self.info = {} + + def getCredits(self): + response = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "pyload": "1", "source": "pyload", "action": "usercaptchaguthaben" }) + + if response.isdigit(): + self.logInfo(_("%s credits left") % response) + self.info["credits"] = credits = int(response) + return credits + else: + self.logError(response) + return 0 + + def processCaptcha(self, task): + result = None + + with open(task.captchaFile, 'rb') as f: + data = f.read() + data = b64encode(data) + self.logDebug("%s : %s" % (task.captchaFile, data)) + if task.isPositional(): + mouse = 1 + else: + mouse = 0 + + response = getURL(self.API_URL, post = { + "apikey": self.getConfig("passkey"), + "prio": self.getConfig("prio"), + "confirm": self.getConfig("confirm"), + "captchaperhour": self.getConfig("captchaperhour"), + "maxtimeout": self.getConfig("timeout"), + "pyload": "1", + "source": "pyload", + "base64": "1", + "mouse": mouse, + "file-upload-01": data, + "action": "usercaptchaupload" }) + + if response.isdigit(): + self.logInfo(_("New CaptchaID from upload: %s : %s") % (response,task.captchaFile)) + + for i in range(1, 100, 1): + response2 = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "id": response,"pyload": "1","source": "pyload", "action": "usercaptchacorrectdata" }) + + if(response2 != ""): + break; + + time.sleep(3) + + result = response2 + task.data["ticket"] = response + self.logInfo("result %s : %s" % (response, result)) + task.setResult(result) + else: + self.logError("Bad upload: %s" % response) + return False + + def newCaptchaTask(self, task): + if not task.isTextual() and not task.isPositional(): + return False + + if not self.getConfig("passkey"): + return False + + if self.core.isClientConnected() and not self.getConfig("force"): + return False + + if self.getCredits() > 0: + task.handler.append(self) + task.setWaiting(self.getConfig("timeout")) + start_new_thread(self.processCaptcha, (task,)) + + else: + self.logError(_("Your Captcha 9kw.eu Account has not enough credits")) + + def captchaCorrect(self, task): + if "ticket" in task.data: + + try: + response = getURL(self.API_URL, + post={ "action": "usercaptchacorrectback", + "apikey": self.getConfig("passkey"), + "api_key": self.getConfig("passkey"), + "correct": "1", + "pyload": "1", + "source": "pyload", + "id": task.data["ticket"] } + ) + self.logInfo("Request correct: %s" % response) + + except BadHeader, e: + self.logError("Could not send correct request.", str(e)) + else: + self.logError("No CaptchaID for correct request (task %s) found." % task) + + def captchaInvalid(self, task): + if "ticket" in task.data: + + try: + response = getURL(self.API_URL, + post={ "action": "usercaptchacorrectback", + "apikey": self.getConfig("passkey"), + "api_key": self.getConfig("passkey"), + "correct": "2", + "pyload": "1", + "source": "pyload", + "id": task.data["ticket"] } + ) + self.logInfo("Request refund: %s" % response) + + except BadHeader, e: + self.logError("Could not send refund request.", str(e)) + else: + self.logError("No CaptchaID for not correct request (task %s) found." % task) diff --git a/module/plugins/hooks/Premium4Me.py b/module/plugins/hooks/Premium4Me.py index 16b02ce87..edbdfbdb9 100644 --- a/module/plugins/hooks/Premium4Me.py +++ b/module/plugins/hooks/Premium4Me.py @@ -1,33 +1,33 @@ -# -*- coding: utf-8 -*- - -from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster - -class Premium4Me(MultiHoster): - __name__ = "Premium4Me" - __version__ = "0.03" - __type__ = "hook" - - __config__ = [("activated", "bool", "Activated", "False"), - ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] - __description__ = """Premium.to hook plugin""" - __author_name__ = ("RaNaN", "zoidberg", "stickell") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") - - def getHoster(self): - - page = getURL("http://premium.to/api/hosters.php?authcode=%s" % self.account.authcode) - return [x.strip() for x in page.replace("\"", "").split(";")] - - def coreReady(self): - - self.account = self.core.accountManager.getAccountPlugin("Premium4Me") - - user = self.account.selectAccount()[0] - - if not user: - self.logError(_("Please add your premium.to account first and restart pyLoad")) - return - +# -*- coding: utf-8 -*- + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster + +class Premium4Me(MultiHoster): + __name__ = "Premium4Me" + __version__ = "0.03" + __type__ = "hook" + + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), + ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Premium.to hook plugin""" + __author_name__ = ("RaNaN", "zoidberg", "stickell") + __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") + + def getHoster(self): + + page = getURL("http://premium.to/api/hosters.php?authcode=%s" % self.account.authcode) + return [x.strip() for x in page.replace("\"", "").split(";")] + + def coreReady(self): + + self.account = self.core.accountManager.getAccountPlugin("Premium4Me") + + user = self.account.selectAccount()[0] + + if not user: + self.logError(_("Please add your premium.to account first and restart pyLoad")) + return + return MultiHoster.coreReady(self) \ No newline at end of file diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index 08a1d1cf9..cdb5ccc08 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -1,84 +1,84 @@ -# -*- coding: utf-8 -*- - -import re -from urllib import unquote -from random import randrange -from module.plugins.Hoster import Hoster -from module.common.json_layer import json_loads -from module.utils import parseFileSize - - -class AlldebridCom(Hoster): - __name__ = "AlldebridCom" - __version__ = "0.33" - __type__ = "hoster" - - __pattern__ = r"https?://.*alldebrid\..*" - __description__ = """Alldebrid.com hoster plugin""" - __author_name__ = ("Andy, Voigt") - __author_mail__ = ("spamsales@online.de") - - def getFilename(self, url): - try: - name = unquote(url.rsplit("/", 1)[1]) - except IndexError: - name = "Unknown_Filename..." - if name.endswith("..."): #incomplete filename, append random stuff - name += "%s.tmp" % randrange(100, 999) - return name - - def init(self): - self.tries = 0 - self.chunkLimit = 3 - self.resumeDownload = True - - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "AllDebrid") - self.fail("No AllDebrid account provided") - - self.logDebug("AllDebrid: Old URL: %s" % pyfile.url) - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - else: - password = self.getPassword().splitlines() - password = "" if not password else password[0] - - url = "http://www.alldebrid.com/service.php?link=%s&json=true&pw=%s" % (pyfile.url, password) - page = self.load(url) - data = json_loads(page) - - self.logDebug("Json data: %s" % str(data)) - - if data["error"]: - if data["error"] == "This link isn't available on the hoster website.": - self.offline() - else: - self.logWarning(data["error"]) - self.tempOffline() - else: - if self.pyfile.name and not self.pyfile.name.endswith('.tmp'): - self.pyfile.name = data["filename"] - self.pyfile.size = parseFileSize(data["filesize"]) - new_url = data["link"] - - if self.getConfig("https"): - new_url = new_url.replace("http://", "https://") - else: - new_url = new_url.replace("https://", "http://") - - self.logDebug("AllDebrid: New URL: %s" % new_url) - - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): - #only use when name wasnt already set - pyfile.name = self.getFilename(new_url) - - self.download(new_url, disposition=True) - - check = self.checkDownload({"error": "An error occured while processing your request", - "empty": re.compile(r"^$")}) - - if check == "error": - self.retry(reason="An error occured while generating link.", wait_time=60) - elif check == "empty": - self.retry(reason="Downloaded File was empty.", wait_time=60) +# -*- coding: utf-8 -*- + +import re +from urllib import unquote +from random import randrange +from module.plugins.Hoster import Hoster +from module.common.json_layer import json_loads +from module.utils import parseFileSize + + +class AlldebridCom(Hoster): + __name__ = "AlldebridCom" + __version__ = "0.33" + __type__ = "hoster" + + __pattern__ = r"https?://.*alldebrid\..*" + __description__ = """Alldebrid.com hoster plugin""" + __author_name__ = ("Andy, Voigt") + __author_mail__ = ("spamsales@online.de") + + def getFilename(self, url): + try: + name = unquote(url.rsplit("/", 1)[1]) + except IndexError: + name = "Unknown_Filename..." + if name.endswith("..."): #incomplete filename, append random stuff + name += "%s.tmp" % randrange(100, 999) + return name + + def init(self): + self.tries = 0 + self.chunkLimit = 3 + self.resumeDownload = True + + def process(self, pyfile): + if not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "AllDebrid") + self.fail("No AllDebrid account provided") + + self.logDebug("AllDebrid: Old URL: %s" % pyfile.url) + if re.match(self.__pattern__, pyfile.url): + new_url = pyfile.url + else: + password = self.getPassword().splitlines() + password = "" if not password else password[0] + + url = "http://www.alldebrid.com/service.php?link=%s&json=true&pw=%s" % (pyfile.url, password) + page = self.load(url) + data = json_loads(page) + + self.logDebug("Json data: %s" % str(data)) + + if data["error"]: + if data["error"] == "This link isn't available on the hoster website.": + self.offline() + else: + self.logWarning(data["error"]) + self.tempOffline() + else: + if self.pyfile.name and not self.pyfile.name.endswith('.tmp'): + self.pyfile.name = data["filename"] + self.pyfile.size = parseFileSize(data["filesize"]) + new_url = data["link"] + + if self.getConfig("https"): + new_url = new_url.replace("http://", "https://") + else: + new_url = new_url.replace("https://", "http://") + + self.logDebug("AllDebrid: New URL: %s" % new_url) + + if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): + #only use when name wasnt already set + pyfile.name = self.getFilename(new_url) + + self.download(new_url, disposition=True) + + check = self.checkDownload({"error": "An error occured while processing your request", + "empty": re.compile(r"^$")}) + + if check == "error": + self.retry(reason="An error occured while generating link.", wait_time=60) + elif check == "empty": + self.retry(reason="Downloaded File was empty.", wait_time=60) diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index e203e2a1b..274286cf1 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -1,103 +1,103 @@ -# -*- coding: utf-8 -*- - -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ - -# Test link (random.bin): -# http://egofiles.com/mOZfMI1WLZ6HBkGG/random.bin - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.plugins.internal.CaptchaService import ReCaptcha - - -class EgoFilesCom(SimpleHoster): - __name__ = "EgoFilesCom" - __type__ = "hoster" - __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" - __version__ = "0.13" - __description__ = """Egofiles.com Download Hoster""" - __author_name__ = ("stickell") - __author_mail__ = ("l.stickell@yahoo.it") - - FILE_INFO_PATTERN = r'
\s+(?P[^\t]+)\s+
\s+(File size|Rozmiar): (?P[\w.]+) (?P\w+) \|' - FILE_OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB' - WAIT_TIME_PATTERN = r'For next free download you have to wait ((?P\d*)m)? ?((?P\d+)s)?' - DIRECT_LINK_PATTERN = r'Download >' - RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' - - def init(self): - self.file_info = {} - # Set English language - self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) - - def process(self, pyfile): - if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): - self.handlePremium() - else: - self.handleFree() - - def handleFree(self): - self.html = self.load(self.pyfile.url, decode=True) - self.getFileInfo() - - # Wait time between free downloads - if 'For next free download you have to wait' in self.html: - m = re.search(self.WAIT_TIME_PATTERN, self.html).groupdict('0') - waittime = int(m['m']) * 60 + int(m['s']) - self.setWait(waittime, True) - self.wait() - - downloadURL = '' - recaptcha = ReCaptcha(self) - for i in xrange(5): - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) - post_data = {'recaptcha_challenge_field': challenge, - 'recaptcha_response_field': response} - self.html = self.load(self.pyfile.url, post=post_data, decode=True) - m = re.search(self.DIRECT_LINK_PATTERN, self.html) - if not m: - self.logInfo('Wrong captcha') - self.invalidCaptcha() - elif hasattr(m, 'group'): - downloadURL = m.group('link') - self.correctCaptcha() - break - else: - self.fail('Unknown error - Plugin may be out of date') - - if not downloadURL: - self.fail("No Download url retrieved/all captcha attempts failed") - - self.download(downloadURL, disposition=True) - - def handlePremium(self): - header = self.load(self.pyfile.url, just_header=True) - if header.has_key('location'): - self.logDebug('DIRECT LINK from header: ' + header['location']) - self.download(header['location']) - else: - self.html = self.load(self.pyfile.url, decode=True) - self.getFileInfo() - m = re.search(r'Download >', self.html) - if not m: - self.parseError('Unable to detect direct download url') - else: - self.logDebug('DIRECT URL from html: ' + m.group('link')) - self.download(m.group('link'), disposition=True) - - -getInfo = create_getInfo(EgoFilesCom) +# -*- coding: utf-8 -*- + +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ + +# Test link (random.bin): +# http://egofiles.com/mOZfMI1WLZ6HBkGG/random.bin + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.internal.CaptchaService import ReCaptcha + + +class EgoFilesCom(SimpleHoster): + __name__ = "EgoFilesCom" + __type__ = "hoster" + __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" + __version__ = "0.13" + __description__ = """Egofiles.com Download Hoster""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + FILE_INFO_PATTERN = r'
\s+(?P[^\t]+)\s+
\s+(File size|Rozmiar): (?P[\w.]+) (?P\w+) \|' + FILE_OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB' + WAIT_TIME_PATTERN = r'For next free download you have to wait ((?P\d*)m)? ?((?P\d+)s)?' + DIRECT_LINK_PATTERN = r'Download >' + RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' + + def init(self): + self.file_info = {} + # Set English language + self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) + + def process(self, pyfile): + if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): + self.handlePremium() + else: + self.handleFree() + + def handleFree(self): + self.html = self.load(self.pyfile.url, decode=True) + self.getFileInfo() + + # Wait time between free downloads + if 'For next free download you have to wait' in self.html: + m = re.search(self.WAIT_TIME_PATTERN, self.html).groupdict('0') + waittime = int(m['m']) * 60 + int(m['s']) + self.setWait(waittime, True) + self.wait() + + downloadURL = '' + recaptcha = ReCaptcha(self) + for i in xrange(5): + challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + post_data = {'recaptcha_challenge_field': challenge, + 'recaptcha_response_field': response} + self.html = self.load(self.pyfile.url, post=post_data, decode=True) + m = re.search(self.DIRECT_LINK_PATTERN, self.html) + if not m: + self.logInfo('Wrong captcha') + self.invalidCaptcha() + elif hasattr(m, 'group'): + downloadURL = m.group('link') + self.correctCaptcha() + break + else: + self.fail('Unknown error - Plugin may be out of date') + + if not downloadURL: + self.fail("No Download url retrieved/all captcha attempts failed") + + self.download(downloadURL, disposition=True) + + def handlePremium(self): + header = self.load(self.pyfile.url, just_header=True) + if header.has_key('location'): + self.logDebug('DIRECT LINK from header: ' + header['location']) + self.download(header['location']) + else: + self.html = self.load(self.pyfile.url, decode=True) + self.getFileInfo() + m = re.search(r'Download >', self.html) + if not m: + self.parseError('Unable to detect direct download url') + else: + self.logDebug('DIRECT URL from html: ' + m.group('link')) + self.download(m.group('link'), disposition=True) + + +getInfo = create_getInfo(EgoFilesCom) diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index e34edd165..156f697c3 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -1,167 +1,167 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster -from module.plugins.internal.CaptchaService import ReCaptcha - -class FreakshareCom(Hoster): - __name__ = "FreakshareCom" - __type__ = "hoster" - __pattern__ = r"http://(?:www\.)?freakshare\.(net|com)/files/\S*?/" - __version__ = "0.37" - __description__ = """Freakshare.com Download Hoster""" - __author_name__ = ("sitacuisses","spoob","mkaay", "Toilal") - __author_mail__ = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de", "toilal.dev@gmail.com") - - def setup(self): - self.html = None - self.wantReconnect = False - self.multiDL = False - self.req_opts = [] - - def process(self, pyfile): - self.pyfile = pyfile - - pyfile.url = pyfile.url.replace("freakshare.net/","freakshare.com/") - - if self.account: - self.html = self.load(pyfile.url, cookies=False) - pyfile.name = self.get_file_name() - self.download(pyfile.url) - - else: - self.prepare() - self.get_file_url() - - self.download(self.pyfile.url, post=self.req_opts) - - - check = self.checkDownload({"bad": "bad try", - "paralell": "> Sorry, you cant download more then 1 files at time. <", - "empty": "Warning: Unknown: Filename cannot be empty", - "wrong_captcha": "Wrong Captcha!"}) - - if check == "bad": - self.fail("Bad Try.") - if check == "paralell": - self.setWait(300, True) - self.wait() - self.retry() - if check == "empty": - self.fail("File not downloadable") - if check == "wrong_captcha": - self.invalidCaptcha() - self.retry() - - def prepare(self): - pyfile = self.pyfile - - self.wantReconnect = False - - self.download_html() - - if not self.file_exists(): - self.offline() - - self.setWait( self.get_waiting_time() ) - - pyfile.name = self.get_file_name() - pyfile.size = self.get_file_size() - - self.wait() - - return True - - def download_html(self): - self.load("http://freakshare.com/index.php", {"language": "EN"}); # Set english language in server session - self.html = self.load(self.pyfile.url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html is None: - self.download_html() - if not self.wantReconnect: - self.req_opts = self.get_download_options() # get the Post options for the Request - #file_url = self.pyfile.url - #return file_url - else: - self.offline() - - def get_file_name(self): - if self.html is None: - self.download_html() - if not self.wantReconnect: - file_name = re.search(r"([^ ]+)", self.html) - if file_name is not None: - file_name = file_name.group(1) - else: - file_name = self.pyfile.url - return file_name - else: - return self.pyfile.url - - def get_file_size(self): - size = 0 - if self.html is None: - self.download_html() - if not self.wantReconnect: - file_size_check = re.search(r"[^ ]+ - ([^ ]+) (\w\w)yte", self.html) - if file_size_check is not None: - units = float(file_size_check.group(1).replace(",", "")) - pow = {'KB': 1, 'MB': 2, 'GB': 3}[file_size_check.group(2)] - size = int(units * 1024 ** pow) - - return size - - def get_waiting_time(self): - if self.html is None: - self.download_html() - - if "Your Traffic is used up for today" in self.html: - self.wantReconnect = True - return 24*3600 - - timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[.\d]*;', self.html) - if timestring: - return int(timestring.group(1)) + 1 #add 1 sec as tenths of seconds are cut off - else: - return 60 - - - def file_exists(self): - """ returns True or False - """ - if self.html is None: - self.download_html() - if re.search(r"This file does not exist!", self.html) is not None: - return False - else: - return True - - def get_download_options(self): - re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?", self.html).group(0) #get the whole request - to_sort = re.findall(r"", re_envelope) - request_options = dict((n, v) for (v, n) in to_sort) - - herewego = self.load(self.pyfile.url, None, request_options) # the actual download-Page - - # comment this in, when it doesnt work - # with open("DUMP__FS_.HTML", "w") as fp: - # fp.write(herewego) - - to_sort = re.findall(r"", herewego) - request_options = dict((n, v) for (v, n) in to_sort) - - # comment this in, when it doesnt work as well - #print "\n\n%s\n\n" % ";".join(["%s=%s" % x for x in to_sort]) - - challenge = re.search(r"http://api\.recaptcha\.net/challenge\?k=([0-9A-Za-z]+)", herewego) - - if challenge: - re_captcha = ReCaptcha(self) - request_options["recaptcha_challenge_field"], request_options["recaptcha_response_field"] \ - = re_captcha.challenge(challenge.group(1)) - - return request_options +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.plugins.Hoster import Hoster +from module.plugins.internal.CaptchaService import ReCaptcha + +class FreakshareCom(Hoster): + __name__ = "FreakshareCom" + __type__ = "hoster" + __pattern__ = r"http://(?:www\.)?freakshare\.(net|com)/files/\S*?/" + __version__ = "0.37" + __description__ = """Freakshare.com Download Hoster""" + __author_name__ = ("sitacuisses","spoob","mkaay", "Toilal") + __author_mail__ = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de", "toilal.dev@gmail.com") + + def setup(self): + self.html = None + self.wantReconnect = False + self.multiDL = False + self.req_opts = [] + + def process(self, pyfile): + self.pyfile = pyfile + + pyfile.url = pyfile.url.replace("freakshare.net/","freakshare.com/") + + if self.account: + self.html = self.load(pyfile.url, cookies=False) + pyfile.name = self.get_file_name() + self.download(pyfile.url) + + else: + self.prepare() + self.get_file_url() + + self.download(self.pyfile.url, post=self.req_opts) + + + check = self.checkDownload({"bad": "bad try", + "paralell": "> Sorry, you cant download more then 1 files at time. <", + "empty": "Warning: Unknown: Filename cannot be empty", + "wrong_captcha": "Wrong Captcha!"}) + + if check == "bad": + self.fail("Bad Try.") + if check == "paralell": + self.setWait(300, True) + self.wait() + self.retry() + if check == "empty": + self.fail("File not downloadable") + if check == "wrong_captcha": + self.invalidCaptcha() + self.retry() + + def prepare(self): + pyfile = self.pyfile + + self.wantReconnect = False + + self.download_html() + + if not self.file_exists(): + self.offline() + + self.setWait( self.get_waiting_time() ) + + pyfile.name = self.get_file_name() + pyfile.size = self.get_file_size() + + self.wait() + + return True + + def download_html(self): + self.load("http://freakshare.com/index.php", {"language": "EN"}); # Set english language in server session + self.html = self.load(self.pyfile.url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html is None: + self.download_html() + if not self.wantReconnect: + self.req_opts = self.get_download_options() # get the Post options for the Request + #file_url = self.pyfile.url + #return file_url + else: + self.offline() + + def get_file_name(self): + if self.html is None: + self.download_html() + if not self.wantReconnect: + file_name = re.search(r"([^ ]+)", self.html) + if file_name is not None: + file_name = file_name.group(1) + else: + file_name = self.pyfile.url + return file_name + else: + return self.pyfile.url + + def get_file_size(self): + size = 0 + if self.html is None: + self.download_html() + if not self.wantReconnect: + file_size_check = re.search(r"[^ ]+ - ([^ ]+) (\w\w)yte", self.html) + if file_size_check is not None: + units = float(file_size_check.group(1).replace(",", "")) + pow = {'KB': 1, 'MB': 2, 'GB': 3}[file_size_check.group(2)] + size = int(units * 1024 ** pow) + + return size + + def get_waiting_time(self): + if self.html is None: + self.download_html() + + if "Your Traffic is used up for today" in self.html: + self.wantReconnect = True + return 24*3600 + + timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[.\d]*;', self.html) + if timestring: + return int(timestring.group(1)) + 1 #add 1 sec as tenths of seconds are cut off + else: + return 60 + + + def file_exists(self): + """ returns True or False + """ + if self.html is None: + self.download_html() + if re.search(r"This file does not exist!", self.html) is not None: + return False + else: + return True + + def get_download_options(self): + re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?", self.html).group(0) #get the whole request + to_sort = re.findall(r"", re_envelope) + request_options = dict((n, v) for (v, n) in to_sort) + + herewego = self.load(self.pyfile.url, None, request_options) # the actual download-Page + + # comment this in, when it doesnt work + # with open("DUMP__FS_.HTML", "w") as fp: + # fp.write(herewego) + + to_sort = re.findall(r"", herewego) + request_options = dict((n, v) for (v, n) in to_sort) + + # comment this in, when it doesnt work as well + #print "\n\n%s\n\n" % ";".join(["%s=%s" % x for x in to_sort]) + + challenge = re.search(r"http://api\.recaptcha\.net/challenge\?k=([0-9A-Za-z]+)", herewego) + + if challenge: + re_captcha = ReCaptcha(self) + request_options["recaptcha_challenge_field"], request_options["recaptcha_response_field"] \ + = re_captcha.challenge(challenge.group(1)) + + return request_options diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 3bda3b32e..c68f3b237 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -1,91 +1,91 @@ -# -*- coding: utf-8 -*- - -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - @author: jeix - @author: mkaay -""" -from urlparse import urlparse, urljoin -from urllib import quote, unquote -import pycurl, re - -from module.plugins.Hoster import Hoster -from module.network.HTTPRequest import BadHeader - -class Ftp(Hoster): - __name__ = "Ftp" - __version__ = "0.41" - __pattern__ = r'(ftps?|sftp)://(.*?:.*?@)?.*?/.*' # ftp://user:password@ftp.server.org/path/to/file - __type__ = "hoster" - __description__ = """A Plugin that allows you to download from an from an ftp directory""" - __author_name__ = ("jeix", "mkaay", "zoidberg") - __author_mail__ = ("jeix@hasnomail.com", "mkaay@mkaay.de", "zoidberg@mujmail.cz") - - def setup(self): - self.chunkLimit = -1 - self.resumeDownload = True - - def process(self, pyfile): - parsed_url = urlparse(pyfile.url) - netloc = parsed_url.netloc - - pyfile.name = parsed_url.path.rpartition('/')[2] - try: - pyfile.name = unquote(str(pyfile.name)).decode('utf8') - except: - pass - - if not "@" in netloc: - servers = [ x['login'] for x in self.account.getAllAccounts() ] if self.account else [] - - if netloc in servers: - self.logDebug("Logging on to %s" % netloc) - self.req.addAuth(self.account.accounts[netloc]["password"]) - else: - for pwd in pyfile.package().password.splitlines(): - if ":" in pwd: - self.req.addAuth(pwd.strip()) - break - - self.req.http.c.setopt(pycurl.NOBODY, 1) - - try: - response = self.load(pyfile.url) - except pycurl.error, e: - self.fail("Error %d: %s" % e.args) - - self.req.http.c.setopt(pycurl.NOBODY, 0) - self.logDebug(self.req.http.header) - - found = re.search(r"Content-Length:\s*(\d+)", response) - if found: - pyfile.size = int(found.group(1)) - self.download(pyfile.url) - else: - #Naive ftp directory listing - if re.search(r'^25\d.*?"', self.req.http.header, re.M): - pyfile.url = pyfile.url.rstrip('/') - pkgname = "/".join((pyfile.package().name,urlparse(pyfile.url).path.rpartition('/')[2])) - pyfile.url += '/' - self.req.http.c.setopt(48, 1) # CURLOPT_DIRLISTONLY - response = self.load(pyfile.url, decode = False) - links = [ pyfile.url + quote(x) for x in response.splitlines() ] - self.logDebug("LINKS", links) - self.core.api.addPackage(pkgname, links, 1) - #self.core.files.addLinks(links, pyfile.package().id) - else: - self.fail("Unexpected server response") - +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + @author: jeix + @author: mkaay +""" +from urlparse import urlparse, urljoin +from urllib import quote, unquote +import pycurl, re + +from module.plugins.Hoster import Hoster +from module.network.HTTPRequest import BadHeader + +class Ftp(Hoster): + __name__ = "Ftp" + __version__ = "0.41" + __pattern__ = r'(ftps?|sftp)://(.*?:.*?@)?.*?/.*' # ftp://user:password@ftp.server.org/path/to/file + __type__ = "hoster" + __description__ = """A Plugin that allows you to download from an from an ftp directory""" + __author_name__ = ("jeix", "mkaay", "zoidberg") + __author_mail__ = ("jeix@hasnomail.com", "mkaay@mkaay.de", "zoidberg@mujmail.cz") + + def setup(self): + self.chunkLimit = -1 + self.resumeDownload = True + + def process(self, pyfile): + parsed_url = urlparse(pyfile.url) + netloc = parsed_url.netloc + + pyfile.name = parsed_url.path.rpartition('/')[2] + try: + pyfile.name = unquote(str(pyfile.name)).decode('utf8') + except: + pass + + if not "@" in netloc: + servers = [ x['login'] for x in self.account.getAllAccounts() ] if self.account else [] + + if netloc in servers: + self.logDebug("Logging on to %s" % netloc) + self.req.addAuth(self.account.accounts[netloc]["password"]) + else: + for pwd in pyfile.package().password.splitlines(): + if ":" in pwd: + self.req.addAuth(pwd.strip()) + break + + self.req.http.c.setopt(pycurl.NOBODY, 1) + + try: + response = self.load(pyfile.url) + except pycurl.error, e: + self.fail("Error %d: %s" % e.args) + + self.req.http.c.setopt(pycurl.NOBODY, 0) + self.logDebug(self.req.http.header) + + found = re.search(r"Content-Length:\s*(\d+)", response) + if found: + pyfile.size = int(found.group(1)) + self.download(pyfile.url) + else: + #Naive ftp directory listing + if re.search(r'^25\d.*?"', self.req.http.header, re.M): + pyfile.url = pyfile.url.rstrip('/') + pkgname = "/".join((pyfile.package().name,urlparse(pyfile.url).path.rpartition('/')[2])) + pyfile.url += '/' + self.req.http.c.setopt(48, 1) # CURLOPT_DIRLISTONLY + response = self.load(pyfile.url, decode = False) + links = [ pyfile.url + quote(x) for x in response.splitlines() ] + self.logDebug("LINKS", links) + self.core.api.addPackage(pkgname, links, 1) + #self.core.files.addLinks(links, pyfile.package().id) + else: + self.fail("Unexpected server response") + \ No newline at end of file diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index 5a4a583ff..08e44d9f6 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -1,72 +1,72 @@ -# -*- coding: utf-8 -*- - -import re -from module.lib.bottle import json_loads - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.plugins.internal.CaptchaService import ReCaptcha - - -class LuckyShareNet(SimpleHoster): - __name__ = "LuckyShareNet" - __type__ = "hoster" - __pattern__ = r"https?://(www\.)?luckyshare.net/(?P\d{10,})" - __version__ = "0.02" - __description__ = """LuckyShare.net Download Hoster""" - __author_name__ = ("stickell") - __author_mail__ = ("l.stickell@yahoo.it") - - FILE_INFO_PATTERN = r"

(?P\S+)

\s*Filesize: (?P[\d.]+)(?P\w+)" - FILE_OFFLINE_PATTERN = 'There is no such file available' - RECAPTCHA_KEY = '6LdivsgSAAAAANWh-d7rPE1mus4yVWuSQIJKIYNw' - - def parseJson(self, rep): - if 'AJAX Error' in rep: - html = self.load(self.pyfile.url, decode=True) - m = re.search(r"waitingtime = (\d+);", html) - if m: - waittime = int(m.group(1)) - self.logDebug('You have to wait %d seconds between free downloads' % waittime) - self.retry(wait_time=waittime) - else: - self.parseError('Unable to detect wait time between free downloads') - elif 'Hash expired' in rep: - self.retry(reason='Hash expired') - return json_loads(rep) - - # TODO: There should be a filesize limit for free downloads - # TODO: Some files could not be downloaded in free mode - def handleFree(self): - file_id = re.search(self.__pattern__, self.pyfile.url).group('ID') - self.logDebug('File ID: ' + file_id) - rep = self.load(r"http://luckyshare.net/download/request/type/time/file/" + file_id, decode=True) - self.logDebug('JSON: ' + rep) - json = self.parseJson(rep) - - self.setWait(int(json['time'])) - self.wait() - - recaptcha = ReCaptcha(self) - for i in xrange(5): - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) - rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % - (challenge, response, json['hash']), decode=True) - self.logDebug('JSON: ' + rep) - if 'link' in rep: - json.update(self.parseJson(rep)) - self.correctCaptcha() - break - elif 'Verification failed' in rep: - self.logInfo('Wrong captcha') - self.invalidCaptcha() - else: - self.parseError('Unable to get downlaod link') - - if not json['link']: - self.fail("No Download url retrieved/all captcha attempts failed") - - self.logDebug('Direct URL: ' + json['link']) - self.download(json['link']) - - -getInfo = create_getInfo(LuckyShareNet) +# -*- coding: utf-8 -*- + +import re +from module.lib.bottle import json_loads + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.internal.CaptchaService import ReCaptcha + + +class LuckyShareNet(SimpleHoster): + __name__ = "LuckyShareNet" + __type__ = "hoster" + __pattern__ = r"https?://(www\.)?luckyshare.net/(?P\d{10,})" + __version__ = "0.02" + __description__ = """LuckyShare.net Download Hoster""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + FILE_INFO_PATTERN = r"

(?P\S+)

\s*Filesize: (?P[\d.]+)(?P\w+)" + FILE_OFFLINE_PATTERN = 'There is no such file available' + RECAPTCHA_KEY = '6LdivsgSAAAAANWh-d7rPE1mus4yVWuSQIJKIYNw' + + def parseJson(self, rep): + if 'AJAX Error' in rep: + html = self.load(self.pyfile.url, decode=True) + m = re.search(r"waitingtime = (\d+);", html) + if m: + waittime = int(m.group(1)) + self.logDebug('You have to wait %d seconds between free downloads' % waittime) + self.retry(wait_time=waittime) + else: + self.parseError('Unable to detect wait time between free downloads') + elif 'Hash expired' in rep: + self.retry(reason='Hash expired') + return json_loads(rep) + + # TODO: There should be a filesize limit for free downloads + # TODO: Some files could not be downloaded in free mode + def handleFree(self): + file_id = re.search(self.__pattern__, self.pyfile.url).group('ID') + self.logDebug('File ID: ' + file_id) + rep = self.load(r"http://luckyshare.net/download/request/type/time/file/" + file_id, decode=True) + self.logDebug('JSON: ' + rep) + json = self.parseJson(rep) + + self.setWait(int(json['time'])) + self.wait() + + recaptcha = ReCaptcha(self) + for i in xrange(5): + challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % + (challenge, response, json['hash']), decode=True) + self.logDebug('JSON: ' + rep) + if 'link' in rep: + json.update(self.parseJson(rep)) + self.correctCaptcha() + break + elif 'Verification failed' in rep: + self.logInfo('Wrong captcha') + self.invalidCaptcha() + else: + self.parseError('Unable to get downlaod link') + + if not json['link']: + self.fail("No Download url retrieved/all captcha attempts failed") + + self.logDebug('Direct URL: ' + json['link']) + self.download(json['link']) + + +getInfo = create_getInfo(LuckyShareNet) diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py index a4124c4a4..ef7961d81 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -1,76 +1,76 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster - -class PornhostCom(Hoster): - __name__ = "PornhostCom" - __type__ = "hoster" - __pattern__ = r'http://[\w\.]*?pornhost\.com/([0-9]+/[0-9]+\.html|[0-9]+)' - __version__ = "0.2" - __description__ = """Pornhost.com Download Hoster""" - __author_name__ = ("jeix") - __author_mail__ = ("jeix@hasnomail.de") - - def process(self, pyfile): - self.download_html() - if not self.file_exists(): - self.offline() - - pyfile.name = self.get_file_name() - self.download(self.get_file_url()) - - - ### old interface - def download_html(self): - url = self.pyfile.url - self.html = self.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html is None: - self.download_html() - - file_url = re.search(r'download this file.*?.*?pornhost\.com - free file hosting with a twist - gallery(.*?)', self.html) - if not name: - name = re.search(r'id="url" value="http://www\.pornhost\.com/(.*?)/"', self.html) - if not name: - name = re.search(r'pornhost\.com - free file hosting with a twist -(.*?)', self.html) - if not name: - name = re.search(r'"http://file[0-9]+\.pornhost\.com/.*?/(.*?)"', self.html) - - name = name.group(1).strip() + ".flv" - - return name - - def file_exists(self): - """ returns True or False - """ - if self.html is None: - self.download_html() - - if re.search(r'gallery not found', self.html) is not None \ - or re.search(r'You will be redirected to', self.html) is not None: - return False - else: - return True - - +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.plugins.Hoster import Hoster + +class PornhostCom(Hoster): + __name__ = "PornhostCom" + __type__ = "hoster" + __pattern__ = r'http://[\w\.]*?pornhost\.com/([0-9]+/[0-9]+\.html|[0-9]+)' + __version__ = "0.2" + __description__ = """Pornhost.com Download Hoster""" + __author_name__ = ("jeix") + __author_mail__ = ("jeix@hasnomail.de") + + def process(self, pyfile): + self.download_html() + if not self.file_exists(): + self.offline() + + pyfile.name = self.get_file_name() + self.download(self.get_file_url()) + + + ### old interface + def download_html(self): + url = self.pyfile.url + self.html = self.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html is None: + self.download_html() + + file_url = re.search(r'download this file.*?.*?pornhost\.com - free file hosting with a twist - gallery(.*?)', self.html) + if not name: + name = re.search(r'id="url" value="http://www\.pornhost\.com/(.*?)/"', self.html) + if not name: + name = re.search(r'pornhost\.com - free file hosting with a twist -(.*?)', self.html) + if not name: + name = re.search(r'"http://file[0-9]+\.pornhost\.com/.*?/(.*?)"', self.html) + + name = name.group(1).strip() + ".flv" + + return name + + def file_exists(self): + """ returns True or False + """ + if self.html is None: + self.download_html() + + if re.search(r'gallery not found', self.html) is not None \ + or re.search(r'You will be redirected to', self.html) is not None: + return False + else: + return True + + diff --git a/module/plugins/hoster/PornhubCom.py b/module/plugins/hoster/PornhubCom.py index e1ed612b9..c431004d8 100644 --- a/module/plugins/hoster/PornhubCom.py +++ b/module/plugins/hoster/PornhubCom.py @@ -1,83 +1,83 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster - -class PornhubCom(Hoster): - __name__ = "PornhubCom" - __type__ = "hoster" - __pattern__ = r'http://[\w\.]*?pornhub\.com/view_video\.php\?viewkey=[\w\d]+' - __version__ = "0.5" - __description__ = """Pornhub.com Download Hoster""" - __author_name__ = ("jeix") - __author_mail__ = ("jeix@hasnomail.de") - - def process(self, pyfile): - self.download_html() - if not self.file_exists(): - self.offline() - - pyfile.name = self.get_file_name() - self.download(self.get_file_url()) - - def download_html(self): - url = self.pyfile.url - self.html = self.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html is None: - self.download_html() - - url = "http://www.pornhub.com//gateway.php" - video_id = self.pyfile.url.split('=')[-1] - # thanks to jD team for this one v - post_data = "\x00\x03\x00\x00\x00\x01\x00\x0c\x70\x6c\x61\x79\x65\x72\x43\x6f\x6e\x66\x69\x67\x00\x02\x2f\x31\x00\x00\x00\x44\x0a\x00\x00\x00\x03\x02\x00" - post_data += chr(len(video_id)) - post_data += video_id - post_data += "\x02\x00\x02\x2d\x31\x02\x00\x20" - post_data += "add299463d4410c6d1b1c418868225f7" - - content = self.req.load(url, post=str(post_data)) - - new_content = "" - for x in content: - if ord(x) < 32 or ord(x) > 176: - new_content += '#' - else: - new_content += x - - content = new_content - - file_url = re.search(r'flv_url.*(http.*?)##post_roll', content).group(1) - - return file_url - - def get_file_name(self): - if self.html is None: - self.download_html() - - match = re.search(r']+>([^<]+) - ', self.html) - if match: - name = match.group(1) - else: - matches = re.findall('

(.*?)

', self.html) - if len(matches) > 1: - name = matches[1] - else: - name = matches[0] - - return name + '.flv' - - def file_exists(self): - """ returns True or False - """ - if self.html is None: - self.download_html() - - if re.search(r'This video is no longer in our database or is in conversion', self.html) is not None: - return False - else: - return True +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.plugins.Hoster import Hoster + +class PornhubCom(Hoster): + __name__ = "PornhubCom" + __type__ = "hoster" + __pattern__ = r'http://[\w\.]*?pornhub\.com/view_video\.php\?viewkey=[\w\d]+' + __version__ = "0.5" + __description__ = """Pornhub.com Download Hoster""" + __author_name__ = ("jeix") + __author_mail__ = ("jeix@hasnomail.de") + + def process(self, pyfile): + self.download_html() + if not self.file_exists(): + self.offline() + + pyfile.name = self.get_file_name() + self.download(self.get_file_url()) + + def download_html(self): + url = self.pyfile.url + self.html = self.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html is None: + self.download_html() + + url = "http://www.pornhub.com//gateway.php" + video_id = self.pyfile.url.split('=')[-1] + # thanks to jD team for this one v + post_data = "\x00\x03\x00\x00\x00\x01\x00\x0c\x70\x6c\x61\x79\x65\x72\x43\x6f\x6e\x66\x69\x67\x00\x02\x2f\x31\x00\x00\x00\x44\x0a\x00\x00\x00\x03\x02\x00" + post_data += chr(len(video_id)) + post_data += video_id + post_data += "\x02\x00\x02\x2d\x31\x02\x00\x20" + post_data += "add299463d4410c6d1b1c418868225f7" + + content = self.req.load(url, post=str(post_data)) + + new_content = "" + for x in content: + if ord(x) < 32 or ord(x) > 176: + new_content += '#' + else: + new_content += x + + content = new_content + + file_url = re.search(r'flv_url.*(http.*?)##post_roll', content).group(1) + + return file_url + + def get_file_name(self): + if self.html is None: + self.download_html() + + match = re.search(r']+>([^<]+) - ', self.html) + if match: + name = match.group(1) + else: + matches = re.findall('

(.*?)

', self.html) + if len(matches) > 1: + name = matches[1] + else: + name = matches[0] + + return name + '.flv' + + def file_exists(self): + """ returns True or False + """ + if self.html is None: + self.download_html() + + if re.search(r'This video is no longer in our database or is in conversion', self.html) is not None: + return False + else: + return True diff --git a/module/plugins/hoster/Premium4Me.py b/module/plugins/hoster/Premium4Me.py index 63b3baa83..9a359b9cb 100644 --- a/module/plugins/hoster/Premium4Me.py +++ b/module/plugins/hoster/Premium4Me.py @@ -1,70 +1,70 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from urllib import quote -from os.path import exists -from os import remove - -from module.plugins.Hoster import Hoster -from module.utils import fs_encode - - -class Premium4Me(Hoster): - __name__ = "Premium4Me" - __version__ = "0.08" - __type__ = "hoster" - - __pattern__ = r"http://premium.to/.*" - __description__ = """Premium.to hoster plugin""" - __author_name__ = ("RaNaN", "zoidberg", "stickell") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") - - def setup(self): - self.resumeDownload = True - self.chunkLimit = 1 - - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "premium.to") - self.fail("No premium.to account provided") - - self.logDebug("premium.to: Old URL: %s" % pyfile.url) - - tra = self.getTraffic() - - #raise timeout to 2min - self.req.setOption("timeout", 120) - - self.download( - "http://premium.to/api/getfile.php?authcode=%s&link=%s" % (self.account.authcode, quote(pyfile.url, "")), - disposition=True) - - check = self.checkDownload({"nopremium": "No premium account available"}) - - if check == "nopremium": - self.retry(60, 300, 'No premium account available') - - err = '' - if self.req.http.code == '420': - # Custom error code send - fail - lastDownload = fs_encode(self.lastDownload) - - if exists(lastDownload): - f = open(lastDownload, "rb") - err = f.read(256).strip() - f.close() - remove(lastDownload) - else: - err = 'File does not exist' - - trb = self.getTraffic() - self.logInfo("Filesize: %d, Traffic used %d, traffic left %d" % (pyfile.size, tra - trb, trb)) - - if err: self.fail(err) - - def getTraffic(self): - try: - traffic = int(self.load("http://premium.to/api/traffic.php?authcode=%s" % self.account.authcode)) - except: - traffic = 0 - return traffic +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from urllib import quote +from os.path import exists +from os import remove + +from module.plugins.Hoster import Hoster +from module.utils import fs_encode + + +class Premium4Me(Hoster): + __name__ = "Premium4Me" + __version__ = "0.08" + __type__ = "hoster" + + __pattern__ = r"http://premium.to/.*" + __description__ = """Premium.to hoster plugin""" + __author_name__ = ("RaNaN", "zoidberg", "stickell") + __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") + + def setup(self): + self.resumeDownload = True + self.chunkLimit = 1 + + def process(self, pyfile): + if not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "premium.to") + self.fail("No premium.to account provided") + + self.logDebug("premium.to: Old URL: %s" % pyfile.url) + + tra = self.getTraffic() + + #raise timeout to 2min + self.req.setOption("timeout", 120) + + self.download( + "http://premium.to/api/getfile.php?authcode=%s&link=%s" % (self.account.authcode, quote(pyfile.url, "")), + disposition=True) + + check = self.checkDownload({"nopremium": "No premium account available"}) + + if check == "nopremium": + self.retry(60, 300, 'No premium account available') + + err = '' + if self.req.http.code == '420': + # Custom error code send - fail + lastDownload = fs_encode(self.lastDownload) + + if exists(lastDownload): + f = open(lastDownload, "rb") + err = f.read(256).strip() + f.close() + remove(lastDownload) + else: + err = 'File does not exist' + + trb = self.getTraffic() + self.logInfo("Filesize: %d, Traffic used %d, traffic left %d" % (pyfile.size, tra - trb, trb)) + + if err: self.fail(err) + + def getTraffic(self): + try: + traffic = int(self.load("http://premium.to/api/traffic.php?authcode=%s" % self.account.authcode)) + except: + traffic = 0 + return traffic diff --git a/module/plugins/hoster/PremiumizeMe.py b/module/plugins/hoster/PremiumizeMe.py index af21c578a..004bc4074 100644 --- a/module/plugins/hoster/PremiumizeMe.py +++ b/module/plugins/hoster/PremiumizeMe.py @@ -1,50 +1,50 @@ -from module.plugins.Hoster import Hoster - -from module.common.json_layer import json_loads - -class PremiumizeMe(Hoster): - __name__ = "PremiumizeMe" - __version__ = "0.12" - __type__ = "hoster" - __description__ = """Premiumize.Me hoster plugin""" - - # Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady create the regex patterns for us using getHosters in our PremiumizeMe hook. - __pattern__ = None - - __author_name__ = ("Florian Franzen") - __author_mail__ = ("FlorianFranzen@gmail.com") - - def process(self, pyfile): - # Check account - if not self.account or not self.account.canUse(): - self.logError(_("Please enter your %s account or deactivate this plugin") % "premiumize.me") - self.fail("No valid premiumize.me account provided") - - # In some cases hostsers do not supply us with a filename at download, so we are going to set a fall back filename (e.g. for freakshare or xfileshare) - self.pyfile.name = self.pyfile.name.split('/').pop() # Remove everthing before last slash - - # Correction for automatic assigned filename: Removing html at end if needed - suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"] - temp = self.pyfile.name.split('.') - if temp.pop() in suffix_to_remove: - self.pyfile.name = ".".join(temp) - - # Get account data - (user, data) = self.account.selectAccount() - - # Get rewritten link using the premiumize.me api v1 (see https://secure.premiumize.me/?show=api) - answer = self.load("https://api.premiumize.me/pm-api/v1.php?method=directdownloadlink¶ms[login]=%s¶ms[pass]=%s¶ms[link]=%s" % (user, data['password'], self.pyfile.url)) - data = json_loads(answer) - - # Check status and decide what to do - status = data['status'] - if status == 200: - self.download(data['result']['location'], disposition=True) - elif status == 400: - self.fail("Invalid link") - elif status == 404: - self.offline() - elif status >= 500: - self.tempOffline() - else: - self.fail(data['statusmessage']) +from module.plugins.Hoster import Hoster + +from module.common.json_layer import json_loads + +class PremiumizeMe(Hoster): + __name__ = "PremiumizeMe" + __version__ = "0.12" + __type__ = "hoster" + __description__ = """Premiumize.Me hoster plugin""" + + # Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady create the regex patterns for us using getHosters in our PremiumizeMe hook. + __pattern__ = None + + __author_name__ = ("Florian Franzen") + __author_mail__ = ("FlorianFranzen@gmail.com") + + def process(self, pyfile): + # Check account + if not self.account or not self.account.canUse(): + self.logError(_("Please enter your %s account or deactivate this plugin") % "premiumize.me") + self.fail("No valid premiumize.me account provided") + + # In some cases hostsers do not supply us with a filename at download, so we are going to set a fall back filename (e.g. for freakshare or xfileshare) + self.pyfile.name = self.pyfile.name.split('/').pop() # Remove everthing before last slash + + # Correction for automatic assigned filename: Removing html at end if needed + suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"] + temp = self.pyfile.name.split('.') + if temp.pop() in suffix_to_remove: + self.pyfile.name = ".".join(temp) + + # Get account data + (user, data) = self.account.selectAccount() + + # Get rewritten link using the premiumize.me api v1 (see https://secure.premiumize.me/?show=api) + answer = self.load("https://api.premiumize.me/pm-api/v1.php?method=directdownloadlink¶ms[login]=%s¶ms[pass]=%s¶ms[link]=%s" % (user, data['password'], self.pyfile.url)) + data = json_loads(answer) + + # Check status and decide what to do + status = data['status'] + if status == 200: + self.download(data['result']['location'], disposition=True) + elif status == 400: + self.fail("Invalid link") + elif status == 404: + self.offline() + elif status >= 500: + self.tempOffline() + else: + self.fail(data['statusmessage']) diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 98aca68d9..73baff5b3 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -1,88 +1,88 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time -from urllib import quote, unquote -from random import randrange - -from module.utils import parseFileSize, remove_chars -from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster - -class RealdebridCom(Hoster): - __name__ = "RealdebridCom" - __version__ = "0.51" - __type__ = "hoster" - - __pattern__ = r"https?://.*real-debrid\..*" - __description__ = """Real-Debrid.com hoster plugin""" - __author_name__ = ("Devirex, Hazzard") - __author_mail__ = ("naibaf_11@yahoo.de") - - def getFilename(self, url): - try: - name = unquote(url.rsplit("/", 1)[1]) - except IndexError: - name = "Unknown_Filename..." - if not name or name.endswith(".."): #incomplete filename, append random stuff - name += "%s.tmp" % randrange(100,999) - return name - - def init(self): - self.tries = 0 - self.chunkLimit = 3 - self.resumeDownload = True - - - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid") - self.fail("No Real-debrid account provided") - - self.logDebug("Real-Debrid: Old URL: %s" % pyfile.url) - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - else: - password = self.getPassword().splitlines() - if not password: password = "" - else: password = password[0] - - url = "http://real-debrid.com/ajax/unrestrict.php?lang=en&link=%s&password=%s&time=%s" % (quote(pyfile.url, ""), password, int(time()*1000)) - page = self.load(url) - data = json_loads(page) - - self.logDebug("Returned Data: %s" % data) - - if data["error"] != 0: - if data["message"] == "Your file is unavailable on the hoster.": - self.offline() - else: - self.logWarning(data["message"]) - self.tempOffline() - else: - if self.pyfile.name is not None and self.pyfile.name.endswith('.tmp') and data["file_name"]: - self.pyfile.name = data["file_name"] - self.pyfile.size = parseFileSize(data["file_size"]) - new_url = data['generated_links'][0][-1] - - if self.getConfig("https"): - new_url = new_url.replace("http://", "https://") - else: - new_url = new_url.replace("https://", "http://") - - self.logDebug("Real-Debrid: New URL: %s" % new_url) - - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown") or pyfile.name.endswith('..'): - #only use when name wasnt already set - pyfile.name = self.getFilename(new_url) - - self.download(new_url, disposition=True) - - check = self.checkDownload( - {"error": "An error occured while processing your request"}) - - if check == "error": - #usual this download can safely be retried - self.retry(reason="An error occured while generating link.", wait_time=60) - +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time +from urllib import quote, unquote +from random import randrange + +from module.utils import parseFileSize, remove_chars +from module.common.json_layer import json_loads +from module.plugins.Hoster import Hoster + +class RealdebridCom(Hoster): + __name__ = "RealdebridCom" + __version__ = "0.51" + __type__ = "hoster" + + __pattern__ = r"https?://.*real-debrid\..*" + __description__ = """Real-Debrid.com hoster plugin""" + __author_name__ = ("Devirex, Hazzard") + __author_mail__ = ("naibaf_11@yahoo.de") + + def getFilename(self, url): + try: + name = unquote(url.rsplit("/", 1)[1]) + except IndexError: + name = "Unknown_Filename..." + if not name or name.endswith(".."): #incomplete filename, append random stuff + name += "%s.tmp" % randrange(100,999) + return name + + def init(self): + self.tries = 0 + self.chunkLimit = 3 + self.resumeDownload = True + + + def process(self, pyfile): + if not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid") + self.fail("No Real-debrid account provided") + + self.logDebug("Real-Debrid: Old URL: %s" % pyfile.url) + if re.match(self.__pattern__, pyfile.url): + new_url = pyfile.url + else: + password = self.getPassword().splitlines() + if not password: password = "" + else: password = password[0] + + url = "http://real-debrid.com/ajax/unrestrict.php?lang=en&link=%s&password=%s&time=%s" % (quote(pyfile.url, ""), password, int(time()*1000)) + page = self.load(url) + data = json_loads(page) + + self.logDebug("Returned Data: %s" % data) + + if data["error"] != 0: + if data["message"] == "Your file is unavailable on the hoster.": + self.offline() + else: + self.logWarning(data["message"]) + self.tempOffline() + else: + if self.pyfile.name is not None and self.pyfile.name.endswith('.tmp') and data["file_name"]: + self.pyfile.name = data["file_name"] + self.pyfile.size = parseFileSize(data["file_size"]) + new_url = data['generated_links'][0][-1] + + if self.getConfig("https"): + new_url = new_url.replace("http://", "https://") + else: + new_url = new_url.replace("https://", "http://") + + self.logDebug("Real-Debrid: New URL: %s" % new_url) + + if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown") or pyfile.name.endswith('..'): + #only use when name wasnt already set + pyfile.name = self.getFilename(new_url) + + self.download(new_url, disposition=True) + + check = self.checkDownload( + {"error": "An error occured while processing your request"}) + + if check == "error": + #usual this download can safely be retried + self.retry(reason="An error occured while generating link.", wait_time=60) + diff --git a/module/plugins/hoster/RedtubeCom.py b/module/plugins/hoster/RedtubeCom.py index 9ffafd905..c2083e679 100644 --- a/module/plugins/hoster/RedtubeCom.py +++ b/module/plugins/hoster/RedtubeCom.py @@ -1,56 +1,56 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster -from module.unescape import unescape - -class RedtubeCom(Hoster): - __name__ = "RedtubeCom" - __type__ = "hoster" - __pattern__ = r'http://[\w\.]*?redtube\.com/\d+' - __version__ = "0.2" - __description__ = """Redtube.com Download Hoster""" - __author_name__ = ("jeix") - __author_mail__ = ("jeix@hasnomail.de") - - def process(self, pyfile): - self.download_html() - if not self.file_exists(): - self.offline() - - pyfile.name = self.get_file_name() - self.download(self.get_file_url()) - - def download_html(self): - url = self.pyfile.url - self.html = self.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html is None: - self.download_html() - - file_url = unescape(re.search(r'hashlink=(http.*?)"', self.html).group(1)) - - return file_url - - def get_file_name(self): - if self.html is None: - self.download_html() - - name = re.search('(.*?)- RedTube - Free Porn Videos', self.html).group(1).strip() + ".flv" - return name - - def file_exists(self): - """ returns True or False - """ - if self.html is None: - self.download_html() - - if re.search(r'This video has been removed.', self.html) is not None: - return False - else: - return True - +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.plugins.Hoster import Hoster +from module.unescape import unescape + +class RedtubeCom(Hoster): + __name__ = "RedtubeCom" + __type__ = "hoster" + __pattern__ = r'http://[\w\.]*?redtube\.com/\d+' + __version__ = "0.2" + __description__ = """Redtube.com Download Hoster""" + __author_name__ = ("jeix") + __author_mail__ = ("jeix@hasnomail.de") + + def process(self, pyfile): + self.download_html() + if not self.file_exists(): + self.offline() + + pyfile.name = self.get_file_name() + self.download(self.get_file_url()) + + def download_html(self): + url = self.pyfile.url + self.html = self.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html is None: + self.download_html() + + file_url = unescape(re.search(r'hashlink=(http.*?)"', self.html).group(1)) + + return file_url + + def get_file_name(self): + if self.html is None: + self.download_html() + + name = re.search('(.*?)- RedTube - Free Porn Videos', self.html).group(1).strip() + ".flv" + return name + + def file_exists(self): + """ returns True or False + """ + if self.html is None: + self.download_html() + + if re.search(r'This video has been removed.', self.html) is not None: + return False + else: + return True + diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py index 24536d351..c55f6703a 100644 --- a/module/plugins/hoster/ShareplaceCom.py +++ b/module/plugins/hoster/ShareplaceCom.py @@ -1,84 +1,84 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import urllib -from module.plugins.Hoster import Hoster - -class ShareplaceCom(Hoster): - __name__ = "ShareplaceCom" - __type__ = "hoster" - __pattern__ = r"(http://)?(www\.)?shareplace\.(com|org)/\?[a-zA-Z0-9]+" - __version__ = "0.11" - __description__ = """Shareplace.com Download Hoster""" - __author_name__ = ("ACCakut, based on YourfilesTo by jeix and skydancer") - __author_mail__ = ("none") - - def setup(self): - self.html = None - self.multiDL = True - - def process(self,pyfile): - self.pyfile = pyfile - self.prepare() - self.download(self.get_file_url()) - - def prepare(self): - if not self.file_exists(): - self.offline() - - self.pyfile.name = self.get_file_name() - - wait_time = self.get_waiting_time() - self.setWait(wait_time) - self.logDebug("%s: Waiting %d seconds." % (self.__name__,wait_time)) - self.wait() - - def get_waiting_time(self): - if self.html is None: - self.download_html() - - #var zzipitime = 15; - m = re.search(r'var zzipitime = (\d+);', self.html) - if m: - sec = int(m.group(1)) - else: - sec = 0 - - return sec - - def download_html(self): - url = re.sub("shareplace.com\/\?", "shareplace.com//index1.php/?a=", self.pyfile.url) - self.html = self.load(url, decode=True) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - url = re.search(r"var beer = '(.*?)';", self.html) - if url: - url = url.group(1) - url = urllib.unquote(url.replace("http://http:/", "").replace("vvvvvvvvv", "").replace("lllllllll", "").replace("teletubbies", "")) - self.logDebug("URL: %s" % url) - return url - else: - self.fail("absolute filepath could not be found. offline? ") - - def get_file_name(self): - if self.html is None: - self.download_html() - - return re.search("\s*(.*?)\s*", self.html).group(1) - - def file_exists(self): - """ returns True or False - """ - if self.html is None: - self.download_html() - - if re.search(r"HTTP Status 404", self.html) is not None: - return False - else: - return True - - - +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +from module.plugins.Hoster import Hoster + +class ShareplaceCom(Hoster): + __name__ = "ShareplaceCom" + __type__ = "hoster" + __pattern__ = r"(http://)?(www\.)?shareplace\.(com|org)/\?[a-zA-Z0-9]+" + __version__ = "0.11" + __description__ = """Shareplace.com Download Hoster""" + __author_name__ = ("ACCakut, based on YourfilesTo by jeix and skydancer") + __author_mail__ = ("none") + + def setup(self): + self.html = None + self.multiDL = True + + def process(self,pyfile): + self.pyfile = pyfile + self.prepare() + self.download(self.get_file_url()) + + def prepare(self): + if not self.file_exists(): + self.offline() + + self.pyfile.name = self.get_file_name() + + wait_time = self.get_waiting_time() + self.setWait(wait_time) + self.logDebug("%s: Waiting %d seconds." % (self.__name__,wait_time)) + self.wait() + + def get_waiting_time(self): + if self.html is None: + self.download_html() + + #var zzipitime = 15; + m = re.search(r'var zzipitime = (\d+);', self.html) + if m: + sec = int(m.group(1)) + else: + sec = 0 + + return sec + + def download_html(self): + url = re.sub("shareplace.com\/\?", "shareplace.com//index1.php/?a=", self.pyfile.url) + self.html = self.load(url, decode=True) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + url = re.search(r"var beer = '(.*?)';", self.html) + if url: + url = url.group(1) + url = urllib.unquote(url.replace("http://http:/", "").replace("vvvvvvvvv", "").replace("lllllllll", "").replace("teletubbies", "")) + self.logDebug("URL: %s" % url) + return url + else: + self.fail("absolute filepath could not be found. offline? ") + + def get_file_name(self): + if self.html is None: + self.download_html() + + return re.search("\s*(.*?)\s*", self.html).group(1) + + def file_exists(self): + """ returns True or False + """ + if self.html is None: + self.download_html() + + if re.search(r"HTTP Status 404", self.html) is not None: + return False + else: + return True + + + diff --git a/module/plugins/hoster/UploadStationCom.py b/module/plugins/hoster/UploadStationCom.py index d24682e4d..96dc7b577 100644 --- a/module/plugins/hoster/UploadStationCom.py +++ b/module/plugins/hoster/UploadStationCom.py @@ -1,21 +1,21 @@ -# -*- coding: utf-8 -*- -from module.plugins.hoster.FileserveCom import FileserveCom, checkFile -from module.plugins.Plugin import chunks - -class UploadStationCom(FileserveCom): - __name__ = "UploadStationCom" - __type__ = "hoster" - __pattern__ = r"http://(?:www\.)?uploadstation\.com/file/(?P[A-Za-z0-9]+)" - __version__ = "0.51" - __description__ = """UploadStation.Com File Download Hoster""" - __author_name__ = ("fragonib", "zoidberg") - __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "zoidberg@mujmail.cz") - - URLS = ['http://www.uploadstation.com/file/', 'http://www.uploadstation.com/check-links.php', 'http://www.uploadstation.com/checkReCaptcha.php'] - LINKCHECK_TR = r'
(.*?)\t{9}
' - LINKCHECK_TD = r'
(?:<[^>]*>| )*([^<]*)' - - LONG_WAIT_PATTERN = r'

You have to wait (\d+) (\w+) to download the next file\.

' - -def getInfo(urls): +# -*- coding: utf-8 -*- +from module.plugins.hoster.FileserveCom import FileserveCom, checkFile +from module.plugins.Plugin import chunks + +class UploadStationCom(FileserveCom): + __name__ = "UploadStationCom" + __type__ = "hoster" + __pattern__ = r"http://(?:www\.)?uploadstation\.com/file/(?P[A-Za-z0-9]+)" + __version__ = "0.51" + __description__ = """UploadStation.Com File Download Hoster""" + __author_name__ = ("fragonib", "zoidberg") + __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "zoidberg@mujmail.cz") + + URLS = ['http://www.uploadstation.com/file/', 'http://www.uploadstation.com/check-links.php', 'http://www.uploadstation.com/checkReCaptcha.php'] + LINKCHECK_TR = r'
(.*?)\t{9}
' + LINKCHECK_TD = r'
(?:<[^>]*>| )*([^<]*)' + + LONG_WAIT_PATTERN = r'

You have to wait (\d+) (\w+) to download the next file\.

' + +def getInfo(urls): for chunk in chunks(urls, 100): yield checkFile(UploadStationCom, chunk) \ No newline at end of file diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 3037cfd20..a98c3bf71 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -1,110 +1,110 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - @author: jeix -""" - -import re -from pycurl import HTTPHEADER -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp -from module.common.json_layer import json_loads - -class UploadingCom(SimpleHoster): - __name__ = "UploadingCom" - __type__ = "hoster" - __pattern__ = r"http://(?:www\.)?uploading\.com/files/(?:get/)?(?P[\w\d]+)" - __version__ = "0.33" - __description__ = """Uploading.Com File Download Hoster""" - __author_name__ = ("jeix", "mkaay", "zoidberg") - __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") - - FILE_NAME_PATTERN = r'Download (?P<N>.*?) for free on uploading.com' - FILE_SIZE_PATTERN = r'File size: (?P.*?)' - FILE_OFFLINE_PATTERN = r'The requested file is not found

' - - def process(self, pyfile): - # set lang to english - self.req.cj.setCookie("uploading.com", "lang", "1") - self.req.cj.setCookie("uploading.com", "language", "1") - self.req.cj.setCookie("uploading.com", "setlang", "en") - self.req.cj.setCookie("uploading.com", "_lang", "en") - - if not "/get/" in self.pyfile.url: - self.pyfile.url = self.pyfile.url.replace("/files", "/files/get") - - self.html = self.load(pyfile.url, decode = True) - self.file_info = self.getFileInfo() - - if self.premium: - self.handlePremium() - else: - self.handleFree() - - def handlePremium(self): - postData = {'action': 'get_link', - 'code': self.file_info['ID'], - 'pass': 'undefined'} - - self.html = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData) - url = re.search(r'"link"\s*:\s*"(.*?)"', self.html) - if url: - url = url.group(1).replace("\\/", "/") - self.download(url) - - raise Exception("Plugin defect.") - - def handleFree(self): - found = re.search('

((Daily )?Download Limit)

', self.html) - if found: - self.pyfile.error = found.group(1) - self.logWarning(self.pyfile.error) - self.retry(max_tries=6, wait_time = 21600 if found.group(2) else 900, reason = self.pyfile.error) - - ajax_url = "http://uploading.com/files/get/?ajax" - self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) - self.req.http.lastURL = self.pyfile.url - - response = json_loads(self.load(ajax_url, post = {'action': 'second_page', 'code': self.file_info['ID']})) - if 'answer' in response and 'wait_time' in response['answer']: - wait_time = int(response['answer']['wait_time']) - self.logInfo("%s: Waiting %d seconds." % (self.__name__, wait_time)) - self.setWait(wait_time) - self.wait() - else: - self.pluginParseError("AJAX/WAIT") - - response = json_loads(self.load(ajax_url, post = {'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'})) - if 'answer' in response and 'link' in response['answer']: - url = response['answer']['link'] - else: - self.pluginParseError("AJAX/URL") - - self.html = self.load(url) - found = re.search(r'
. + + @author: jeix +""" + +import re +from pycurl import HTTPHEADER +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp +from module.common.json_layer import json_loads + +class UploadingCom(SimpleHoster): + __name__ = "UploadingCom" + __type__ = "hoster" + __pattern__ = r"http://(?:www\.)?uploading\.com/files/(?:get/)?(?P[\w\d]+)" + __version__ = "0.33" + __description__ = """Uploading.Com File Download Hoster""" + __author_name__ = ("jeix", "mkaay", "zoidberg") + __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") + + FILE_NAME_PATTERN = r'Download (?P<N>.*?) for free on uploading.com' + FILE_SIZE_PATTERN = r'File size: (?P.*?)' + FILE_OFFLINE_PATTERN = r'The requested file is not found' + + def process(self, pyfile): + # set lang to english + self.req.cj.setCookie("uploading.com", "lang", "1") + self.req.cj.setCookie("uploading.com", "language", "1") + self.req.cj.setCookie("uploading.com", "setlang", "en") + self.req.cj.setCookie("uploading.com", "_lang", "en") + + if not "/get/" in self.pyfile.url: + self.pyfile.url = self.pyfile.url.replace("/files", "/files/get") + + self.html = self.load(pyfile.url, decode = True) + self.file_info = self.getFileInfo() + + if self.premium: + self.handlePremium() + else: + self.handleFree() + + def handlePremium(self): + postData = {'action': 'get_link', + 'code': self.file_info['ID'], + 'pass': 'undefined'} + + self.html = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData) + url = re.search(r'"link"\s*:\s*"(.*?)"', self.html) + if url: + url = url.group(1).replace("\\/", "/") + self.download(url) + + raise Exception("Plugin defect.") + + def handleFree(self): + found = re.search('

((Daily )?Download Limit)

', self.html) + if found: + self.pyfile.error = found.group(1) + self.logWarning(self.pyfile.error) + self.retry(max_tries=6, wait_time = 21600 if found.group(2) else 900, reason = self.pyfile.error) + + ajax_url = "http://uploading.com/files/get/?ajax" + self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) + self.req.http.lastURL = self.pyfile.url + + response = json_loads(self.load(ajax_url, post = {'action': 'second_page', 'code': self.file_info['ID']})) + if 'answer' in response and 'wait_time' in response['answer']: + wait_time = int(response['answer']['wait_time']) + self.logInfo("%s: Waiting %d seconds." % (self.__name__, wait_time)) + self.setWait(wait_time) + self.wait() + else: + self.pluginParseError("AJAX/WAIT") + + response = json_loads(self.load(ajax_url, post = {'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'})) + if 'answer' in response and 'link' in response['answer']: + url = response['answer']['link'] + else: + self.pluginParseError("AJAX/URL") + + self.html = self.load(url) + found = re.search(r'', self.html) - if overLimit: - self.logDebug("over limit, falling back to free") - self.handleFree() - else: - realurl = re.search(r'
', self.html) - if realurl: - realurl = realurl.group(1) - self.logDebug("premium url found %s" % realurl) - else: - self.logDebug("premium link not found") - self.download(realurl) - - def handleFree(self): - # find file id - file_id = re.search(r"var dlID = '(.*?)'", self.html) - if not file_id: - self.fail("Free download id not found") - - file_url = "http://x7.to/james/ticket/dl/" + file_id.group(1) - self.logDebug("download id %s" % file_id.group(1)) - - self.html = self.load(file_url, ref=False, decode=True) - - # deal with errors - if "limit-dl" in self.html: - self.logDebug("Limit reached ... waiting") - self.setWait(900,True) - self.wait() - self.retry() - - if "limit-parallel" in self.html: - self.fail("Cannot download in parallel") - - # no waiting required, go to download - waitCheck = re.search(r"wait:(\d*),", self.html) - if waitCheck: - waitCheck = int(waitCheck.group(1)) - self.setWait(waitCheck) - self.wait() - - urlCheck = re.search(r"url:'(.*?)'", self.html) - url = None - if urlCheck: - url = urlCheck.group(1) - self.logDebug("free url found %s" % url) - - if url: - try: - self.download(url) - except: - self.logDebug("downloading url failed: %s" % url) - else: - self.fail("Free download url found") +# -*- coding: utf-8 -*- +import re + +from module.plugins.Hoster import Hoster + +from module.network.RequestFactory import getURL + +def getInfo(urls): + yield [(url, 0, 1, url) for url in urls] + + +class X7To(Hoster): + __name__ = "X7To" + __type__ = "hoster" + __pattern__ = r"http://(?:www.)?x7.to/" + __version__ = "0.3" + __description__ = """X7.To File Download Hoster""" + __author_name__ = ("ernieb") + __author_mail__ = ("ernieb") + + FILE_INFO_PATTERN=r'', self.html) + if overLimit: + self.logDebug("over limit, falling back to free") + self.handleFree() + else: + realurl = re.search(r'', self.html) + if realurl: + realurl = realurl.group(1) + self.logDebug("premium url found %s" % realurl) + else: + self.logDebug("premium link not found") + self.download(realurl) + + def handleFree(self): + # find file id + file_id = re.search(r"var dlID = '(.*?)'", self.html) + if not file_id: + self.fail("Free download id not found") + + file_url = "http://x7.to/james/ticket/dl/" + file_id.group(1) + self.logDebug("download id %s" % file_id.group(1)) + + self.html = self.load(file_url, ref=False, decode=True) + + # deal with errors + if "limit-dl" in self.html: + self.logDebug("Limit reached ... waiting") + self.setWait(900,True) + self.wait() + self.retry() + + if "limit-parallel" in self.html: + self.fail("Cannot download in parallel") + + # no waiting required, go to download + waitCheck = re.search(r"wait:(\d*),", self.html) + if waitCheck: + waitCheck = int(waitCheck.group(1)) + self.setWait(waitCheck) + self.wait() + + urlCheck = re.search(r"url:'(.*?)'", self.html) + url = None + if urlCheck: + url = urlCheck.group(1) + self.logDebug("free url found %s" % url) + + if url: + try: + self.download(url) + except: + self.logDebug("downloading url failed: %s" % url) + else: + self.fail("Free download url found") diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index 92b77f73a..d0630bd29 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -1,229 +1,229 @@ -# -*- coding: utf-8 -*- - -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - @author: jeix -""" - -from os.path import join -from os.path import exists -from os import makedirs -import re -import sys -import time -import socket, struct -from select import select -from module.utils import save_join - -from module.plugins.Hoster import Hoster - - -class Xdcc(Hoster): - __name__ = "Xdcc" - __version__ = "0.32" - __pattern__ = r'xdcc://.*?(/#?.*?)?/.*?/#?\d+/?' # xdcc://irc.Abjects.net/#channel/[XDCC]|Shit/#0004/ - __type__ = "hoster" - __config__ = [ - ("nick", "str", "Nickname", "pyload"), - ("ident", "str", "Ident", "pyloadident"), - ("realname", "str", "Realname", "pyloadreal") - ] - __description__ = """A Plugin that allows you to download from an IRC XDCC bot""" - __author_name__ = ("jeix") - __author_mail__ = ("jeix@hasnomail.com") - - def setup(self): - self.debug = 0 #0,1,2 - self.timeout = 30 - self.multiDL = False - - - - def process(self, pyfile): - # change request type - self.req = pyfile.m.core.requestFactory.getRequest(self.__name__, type="XDCC") - - self.pyfile = pyfile - for i in range(0,3): - try: - nmn = self.doDownload(pyfile.url) - self.logDebug("%s: Download of %s finished." % (self.__name__, nmn)) - return - except socket.error, e: - if hasattr(e, "errno"): - errno = e.errno - else: - errno = e.args[0] - - if errno in (10054,): - self.logDebug("XDCC: Server blocked our ip, retry in 5 min") - self.setWait(300) - self.wait() - continue - - self.fail("Failed due to socket errors. Code: %d" % errno) - - self.fail("Server blocked our ip, retry again later manually") - - - def doDownload(self, url): - self.pyfile.setStatus("waiting") # real link - - download_folder = self.config['general']['download_folder'] - location = join(download_folder, self.pyfile.package().folder.decode(sys.getfilesystemencoding())) - if not exists(location): - makedirs(location) - - m = re.search(r'xdcc://(.*?)/#?(.*?)/(.*?)/#?(\d+)/?', url) - server = m.group(1) - chan = m.group(2) - bot = m.group(3) - pack = m.group(4) - nick = self.getConfig('nick') - ident = self.getConfig('ident') - real = self.getConfig('realname') - - temp = server.split(':') - ln = len(temp) - if ln == 2: - host, port = temp - elif ln == 1: - host, port = temp[0], 6667 - else: - self.fail("Invalid hostname for IRC Server (%s)" % server) - - - ####################### - # CONNECT TO IRC AND IDLE FOR REAL LINK - dl_time = time.time() - - sock = socket.socket() - sock.connect((host, int(port))) - if nick == "pyload": - nick = "pyload-%d" % (time.time() % 1000) # last 3 digits - sock.send("NICK %s\r\n" % nick) - sock.send("USER %s %s bla :%s\r\n" % (ident, host, real)) - time.sleep(3) - sock.send("JOIN #%s\r\n" % chan) - sock.send("PRIVMSG %s :xdcc send #%s\r\n" % (bot, pack)) - - # IRC recv loop - readbuffer = "" - done = False - retry = None - m = None - while True: - - # done is set if we got our real link - if done: - break - - if retry: - if time.time() > retry: - retry = None - dl_time = time.time() - sock.send("PRIVMSG %s :xdcc send #%s\r\n" % (bot, pack)) - - else: - if (dl_time + self.timeout) < time.time(): # todo: add in config - sock.send("QUIT :byebye\r\n") - sock.close() - self.fail("XDCC Bot did not answer") - - - fdset = select([sock], [], [], 0) - if sock not in fdset[0]: - continue - - readbuffer += sock.recv(1024) - temp = readbuffer.split("\n") - readbuffer = temp.pop() - - for line in temp: - if self.debug is 2: print "*> " + unicode(line, errors='ignore') - line = line.rstrip() - first = line.split() - - if first[0] == "PING": - sock.send("PONG %s\r\n" % first[1]) - - if first[0] == "ERROR": - self.fail("IRC-Error: %s" % line) - - msg = line.split(None, 3) - if len(msg) != 4: - continue - - msg = { \ - "origin":msg[0][1:], \ - "action":msg[1], \ - "target":msg[2], \ - "text" :msg[3][1:] \ - } - - - if nick == msg["target"][0:len(nick)] and "PRIVMSG" == msg["action"]: - if msg["text"] == "\x01VERSION\x01": - self.logDebug("XDCC: Sending CTCP VERSION.") - sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface")) - elif msg["text"] == "\x01TIME\x01": - self.logDebug("Sending CTCP TIME.") - sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time())) - elif msg["text"] == "\x01LAG\x01": - pass # don't know how to answer - - if not (bot == msg["origin"][0:len(bot)] - and nick == msg["target"][0:len(nick)] - and msg["action"] in ("PRIVMSG", "NOTICE")): - continue - - if self.debug is 1: - print "%s: %s" % (msg["origin"], msg["text"]) - - if "You already requested that pack" in msg["text"]: - retry = time.time() + 300 - - if "you must be on a known channel to request a pack" in msg["text"]: - self.fail("Wrong channel") - - m = re.match('\x01DCC SEND (.*?) (\d+) (\d+)(?: (\d+))?\x01', msg["text"]) - if m: - done = True - - # get connection data - ip = socket.inet_ntoa(struct.pack('L', socket.ntohl(int(m.group(2))))) - port = int(m.group(3)) - packname = m.group(1) - - if len(m.groups()) > 3: - self.req.filesize = int(m.group(4)) - - self.pyfile.name = packname - filename = save_join(location, packname) - self.logInfo("XDCC: Downloading %s from %s:%d" % (packname, ip, port)) - - self.pyfile.setStatus("downloading") - newname = self.req.download(ip, port, filename, sock, self.pyfile.setProgress) - if newname and newname != filename: - self.logInfo("%(name)s saved as %(newname)s" % {"name": self.pyfile.name, "newname": newname}) - filename = newname - - # kill IRC socket - # sock.send("QUIT :byebye\r\n") - sock.close() - - self.lastDownload = filename - return self.lastDownload - +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + @author: jeix +""" + +from os.path import join +from os.path import exists +from os import makedirs +import re +import sys +import time +import socket, struct +from select import select +from module.utils import save_join + +from module.plugins.Hoster import Hoster + + +class Xdcc(Hoster): + __name__ = "Xdcc" + __version__ = "0.32" + __pattern__ = r'xdcc://.*?(/#?.*?)?/.*?/#?\d+/?' # xdcc://irc.Abjects.net/#channel/[XDCC]|Shit/#0004/ + __type__ = "hoster" + __config__ = [ + ("nick", "str", "Nickname", "pyload"), + ("ident", "str", "Ident", "pyloadident"), + ("realname", "str", "Realname", "pyloadreal") + ] + __description__ = """A Plugin that allows you to download from an IRC XDCC bot""" + __author_name__ = ("jeix") + __author_mail__ = ("jeix@hasnomail.com") + + def setup(self): + self.debug = 0 #0,1,2 + self.timeout = 30 + self.multiDL = False + + + + def process(self, pyfile): + # change request type + self.req = pyfile.m.core.requestFactory.getRequest(self.__name__, type="XDCC") + + self.pyfile = pyfile + for i in range(0,3): + try: + nmn = self.doDownload(pyfile.url) + self.logDebug("%s: Download of %s finished." % (self.__name__, nmn)) + return + except socket.error, e: + if hasattr(e, "errno"): + errno = e.errno + else: + errno = e.args[0] + + if errno in (10054,): + self.logDebug("XDCC: Server blocked our ip, retry in 5 min") + self.setWait(300) + self.wait() + continue + + self.fail("Failed due to socket errors. Code: %d" % errno) + + self.fail("Server blocked our ip, retry again later manually") + + + def doDownload(self, url): + self.pyfile.setStatus("waiting") # real link + + download_folder = self.config['general']['download_folder'] + location = join(download_folder, self.pyfile.package().folder.decode(sys.getfilesystemencoding())) + if not exists(location): + makedirs(location) + + m = re.search(r'xdcc://(.*?)/#?(.*?)/(.*?)/#?(\d+)/?', url) + server = m.group(1) + chan = m.group(2) + bot = m.group(3) + pack = m.group(4) + nick = self.getConfig('nick') + ident = self.getConfig('ident') + real = self.getConfig('realname') + + temp = server.split(':') + ln = len(temp) + if ln == 2: + host, port = temp + elif ln == 1: + host, port = temp[0], 6667 + else: + self.fail("Invalid hostname for IRC Server (%s)" % server) + + + ####################### + # CONNECT TO IRC AND IDLE FOR REAL LINK + dl_time = time.time() + + sock = socket.socket() + sock.connect((host, int(port))) + if nick == "pyload": + nick = "pyload-%d" % (time.time() % 1000) # last 3 digits + sock.send("NICK %s\r\n" % nick) + sock.send("USER %s %s bla :%s\r\n" % (ident, host, real)) + time.sleep(3) + sock.send("JOIN #%s\r\n" % chan) + sock.send("PRIVMSG %s :xdcc send #%s\r\n" % (bot, pack)) + + # IRC recv loop + readbuffer = "" + done = False + retry = None + m = None + while True: + + # done is set if we got our real link + if done: + break + + if retry: + if time.time() > retry: + retry = None + dl_time = time.time() + sock.send("PRIVMSG %s :xdcc send #%s\r\n" % (bot, pack)) + + else: + if (dl_time + self.timeout) < time.time(): # todo: add in config + sock.send("QUIT :byebye\r\n") + sock.close() + self.fail("XDCC Bot did not answer") + + + fdset = select([sock], [], [], 0) + if sock not in fdset[0]: + continue + + readbuffer += sock.recv(1024) + temp = readbuffer.split("\n") + readbuffer = temp.pop() + + for line in temp: + if self.debug is 2: print "*> " + unicode(line, errors='ignore') + line = line.rstrip() + first = line.split() + + if first[0] == "PING": + sock.send("PONG %s\r\n" % first[1]) + + if first[0] == "ERROR": + self.fail("IRC-Error: %s" % line) + + msg = line.split(None, 3) + if len(msg) != 4: + continue + + msg = { \ + "origin":msg[0][1:], \ + "action":msg[1], \ + "target":msg[2], \ + "text" :msg[3][1:] \ + } + + + if nick == msg["target"][0:len(nick)] and "PRIVMSG" == msg["action"]: + if msg["text"] == "\x01VERSION\x01": + self.logDebug("XDCC: Sending CTCP VERSION.") + sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface")) + elif msg["text"] == "\x01TIME\x01": + self.logDebug("Sending CTCP TIME.") + sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time())) + elif msg["text"] == "\x01LAG\x01": + pass # don't know how to answer + + if not (bot == msg["origin"][0:len(bot)] + and nick == msg["target"][0:len(nick)] + and msg["action"] in ("PRIVMSG", "NOTICE")): + continue + + if self.debug is 1: + print "%s: %s" % (msg["origin"], msg["text"]) + + if "You already requested that pack" in msg["text"]: + retry = time.time() + 300 + + if "you must be on a known channel to request a pack" in msg["text"]: + self.fail("Wrong channel") + + m = re.match('\x01DCC SEND (.*?) (\d+) (\d+)(?: (\d+))?\x01', msg["text"]) + if m: + done = True + + # get connection data + ip = socket.inet_ntoa(struct.pack('L', socket.ntohl(int(m.group(2))))) + port = int(m.group(3)) + packname = m.group(1) + + if len(m.groups()) > 3: + self.req.filesize = int(m.group(4)) + + self.pyfile.name = packname + filename = save_join(location, packname) + self.logInfo("XDCC: Downloading %s from %s:%d" % (packname, ip, port)) + + self.pyfile.setStatus("downloading") + newname = self.req.download(ip, port, filename, sock, self.pyfile.setProgress) + if newname and newname != filename: + self.logInfo("%(name)s saved as %(newname)s" % {"name": self.pyfile.name, "newname": newname}) + filename = newname + + # kill IRC socket + # sock.send("QUIT :byebye\r\n") + sock.close() + + self.lastDownload = filename + return self.lastDownload + diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index c2183f8a8..4a192b32a 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -1,83 +1,83 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import urllib -from module.plugins.Hoster import Hoster - -class YourfilesTo(Hoster): - __name__ = "YourfilesTo" - __type__ = "hoster" - __pattern__ = r"(http://)?(www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+" - __version__ = "0.21" - __description__ = """Youfiles.to Download Hoster""" - __author_name__ = ("jeix", "skydancer") - __author_mail__ = ("jeix@hasnomail.de", "skydancer@hasnomail.de") - - def setup(self): - self.html = None - self.multiDL = True - - def process(self,pyfile): - self.pyfile = pyfile - self.prepare() - self.download(self.get_file_url()) - - def prepare(self): - if not self.file_exists(): - self.offline() - - self.pyfile.name = self.get_file_name() - - wait_time = self.get_waiting_time() - self.setWait(wait_time) - self.logDebug("%s: Waiting %d seconds." % (self.__name__,wait_time)) - self.wait() - - def get_waiting_time(self): - if self.html is None: - self.download_html() - - #var zzipitime = 15; - m = re.search(r'var zzipitime = (\d+);', self.html) - if m: - sec = int(m.group(1)) - else: - sec = 0 - - return sec - - def download_html(self): - url = self.pyfile.url - self.html = self.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - url = re.search(r"var bla = '(.*?)';", self.html) - if url: - url = url.group(1) - url = urllib.unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", "")) - return url - else: - self.fail("absolute filepath could not be found. offline? ") - - def get_file_name(self): - if self.html is None: - self.download_html() - - return re.search("(.*)", self.html).group(1) - - def file_exists(self): - """ returns True or False - """ - if self.html is None: - self.download_html() - - if re.search(r"HTTP Status 404", self.html) is not None: - return False - else: - return True - - - +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +from module.plugins.Hoster import Hoster + +class YourfilesTo(Hoster): + __name__ = "YourfilesTo" + __type__ = "hoster" + __pattern__ = r"(http://)?(www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+" + __version__ = "0.21" + __description__ = """Youfiles.to Download Hoster""" + __author_name__ = ("jeix", "skydancer") + __author_mail__ = ("jeix@hasnomail.de", "skydancer@hasnomail.de") + + def setup(self): + self.html = None + self.multiDL = True + + def process(self,pyfile): + self.pyfile = pyfile + self.prepare() + self.download(self.get_file_url()) + + def prepare(self): + if not self.file_exists(): + self.offline() + + self.pyfile.name = self.get_file_name() + + wait_time = self.get_waiting_time() + self.setWait(wait_time) + self.logDebug("%s: Waiting %d seconds." % (self.__name__,wait_time)) + self.wait() + + def get_waiting_time(self): + if self.html is None: + self.download_html() + + #var zzipitime = 15; + m = re.search(r'var zzipitime = (\d+);', self.html) + if m: + sec = int(m.group(1)) + else: + sec = 0 + + return sec + + def download_html(self): + url = self.pyfile.url + self.html = self.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + url = re.search(r"var bla = '(.*?)';", self.html) + if url: + url = url.group(1) + url = urllib.unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", "")) + return url + else: + self.fail("absolute filepath could not be found. offline? ") + + def get_file_name(self): + if self.html is None: + self.download_html() + + return re.search("(.*)", self.html).group(1) + + def file_exists(self): + """ returns True or False + """ + if self.html is None: + self.download_html() + + if re.search(r"HTTP Status 404", self.html) is not None: + return False + else: + return True + + + diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py index 3ad662bb6..92f9e4dcd 100644 --- a/module/plugins/hoster/ZeveraCom.py +++ b/module/plugins/hoster/ZeveraCom.py @@ -1,108 +1,108 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from module.plugins.Hoster import Hoster -from module.utils import html_unescape -from urllib import quote, unquote -from time import sleep - -class ZeveraCom(Hoster): - __name__ = "ZeveraCom" - __version__ = "0.21" - __type__ = "hoster" - __pattern__ = r"http://zevera.com/.*" - __description__ = """zevera.com hoster plugin""" - __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") - - def setup(self): - self.resumeDownload = self.multiDL = True - self.chunkLimit = 1 - - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "zevera.com") - self.fail("No zevera.com account provided") - - self.logDebug("zevera.com: Old URL: %s" % pyfile.url) - - if self.account.getAPIData(self.req, cmd = "checklink", olink = pyfile.url) != "Alive": - self.fail("Offline or not downloadable - contact Zevera support") - - header = self.account.getAPIData(self.req, just_header = True, cmd="generatedownloaddirect", olink = pyfile.url) - if not "location" in header: - self.fail("Unable to initialize download - contact Zevera support") - - self.download(header['location'], disposition = True) - - check = self.checkDownload({"error" : 'action="ErrorDownload.aspx'}) - if check == "error": - self.fail("Error response received - contact Zevera support") - - """ - # BitAPI not used - defunct, probably abandoned by Zevera - - api_url = "http://zevera.com/API.ashx" - - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your zevera.com account or deactivate this plugin")) - self.fail("No zevera.com account provided") - - self.logDebug("zevera.com: Old URL: %s" % pyfile.url) - - last_size = retries = 0 - olink = self.pyfile.url #quote(self.pyfile.url.encode('utf_8')) - - for i in range(100): - self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_request', olink = olink) - self.checkAPIErrors(self.retData) - - if self.retData['FileInfo']['StatusID'] == 100: - break - elif self.retData['FileInfo']['StatusID'] == 99: - self.fail('Failed to initialize download (99)') - else: - if self.retData['FileInfo']['Progress']['BytesReceived'] <= last_size: - if retries >= 6: - self.fail('Failed to initialize download (%d)' % self.retData['FileInfo']['StatusID'] ) - retries += 1 - else: - retries = 0 - - last_size = self.retData['FileInfo']['Progress']['BytesReceived'] - - self.setWait(self.retData['Update_Wait']) - self.wait() - - pyfile.name = self.retData['FileInfo']['RealFileName'] - pyfile.size = self.retData['FileInfo']['FileSizeInBytes'] - - self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_start', FileID = self.retData['FileInfo']['FileID']) - self.checkAPIErrors(self.retData) - - self.download(self.api_url, get = { - 'cmd': "open_stream", - 'login': self.account.loginname, - 'pass': self.account.password, - 'FileID': self.retData['FileInfo']['FileID'], - 'startBytes': 0 - } - ) - - def checkAPIErrors(self, retData): - if not retData: - self.fail('Unknown API response') - - if retData['ErrorCode']: - self.logError(retData['ErrorCode'], retData['ErrorMessage']) - #self.fail('ERROR: ' + retData['ErrorMessage']) - - if self.pyfile.size / 1024000 > retData['AccountInfo']['AvailableTODAYTrafficForUseInMBytes']: - self.logWarning("Not enough data left to download the file") - - def crazyDecode(self, ustring): - # accepts decoded ie. unicode string - API response is double-quoted, double-utf8-encoded - # no idea what the proper order of calling these functions would be :-/ - return html_unescape(unquote(unquote(ustring.replace('@DELIMITER@','#'))).encode('raw_unicode_escape').decode('utf-8')) +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from module.plugins.Hoster import Hoster +from module.utils import html_unescape +from urllib import quote, unquote +from time import sleep + +class ZeveraCom(Hoster): + __name__ = "ZeveraCom" + __version__ = "0.21" + __type__ = "hoster" + __pattern__ = r"http://zevera.com/.*" + __description__ = """zevera.com hoster plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + def setup(self): + self.resumeDownload = self.multiDL = True + self.chunkLimit = 1 + + def process(self, pyfile): + if not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "zevera.com") + self.fail("No zevera.com account provided") + + self.logDebug("zevera.com: Old URL: %s" % pyfile.url) + + if self.account.getAPIData(self.req, cmd = "checklink", olink = pyfile.url) != "Alive": + self.fail("Offline or not downloadable - contact Zevera support") + + header = self.account.getAPIData(self.req, just_header = True, cmd="generatedownloaddirect", olink = pyfile.url) + if not "location" in header: + self.fail("Unable to initialize download - contact Zevera support") + + self.download(header['location'], disposition = True) + + check = self.checkDownload({"error" : 'action="ErrorDownload.aspx'}) + if check == "error": + self.fail("Error response received - contact Zevera support") + + """ + # BitAPI not used - defunct, probably abandoned by Zevera + + api_url = "http://zevera.com/API.ashx" + + def process(self, pyfile): + if not self.account: + self.logError(_("Please enter your zevera.com account or deactivate this plugin")) + self.fail("No zevera.com account provided") + + self.logDebug("zevera.com: Old URL: %s" % pyfile.url) + + last_size = retries = 0 + olink = self.pyfile.url #quote(self.pyfile.url.encode('utf_8')) + + for i in range(100): + self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_request', olink = olink) + self.checkAPIErrors(self.retData) + + if self.retData['FileInfo']['StatusID'] == 100: + break + elif self.retData['FileInfo']['StatusID'] == 99: + self.fail('Failed to initialize download (99)') + else: + if self.retData['FileInfo']['Progress']['BytesReceived'] <= last_size: + if retries >= 6: + self.fail('Failed to initialize download (%d)' % self.retData['FileInfo']['StatusID'] ) + retries += 1 + else: + retries = 0 + + last_size = self.retData['FileInfo']['Progress']['BytesReceived'] + + self.setWait(self.retData['Update_Wait']) + self.wait() + + pyfile.name = self.retData['FileInfo']['RealFileName'] + pyfile.size = self.retData['FileInfo']['FileSizeInBytes'] + + self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_start', FileID = self.retData['FileInfo']['FileID']) + self.checkAPIErrors(self.retData) + + self.download(self.api_url, get = { + 'cmd': "open_stream", + 'login': self.account.loginname, + 'pass': self.account.password, + 'FileID': self.retData['FileInfo']['FileID'], + 'startBytes': 0 + } + ) + + def checkAPIErrors(self, retData): + if not retData: + self.fail('Unknown API response') + + if retData['ErrorCode']: + self.logError(retData['ErrorCode'], retData['ErrorMessage']) + #self.fail('ERROR: ' + retData['ErrorMessage']) + + if self.pyfile.size / 1024000 > retData['AccountInfo']['AvailableTODAYTrafficForUseInMBytes']: + self.logWarning("Not enough data left to download the file") + + def crazyDecode(self, ustring): + # accepts decoded ie. unicode string - API response is double-quoted, double-utf8-encoded + # no idea what the proper order of calling these functions would be :-/ + return html_unescape(unquote(unquote(ustring.replace('@DELIMITER@','#'))).encode('raw_unicode_escape').decode('utf-8')) """ \ No newline at end of file diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css index fc0d148c2..116f9725a 100644 --- a/module/web/media/default/css/default.css +++ b/module/web/media/default/css/default.css @@ -1,908 +1,908 @@ -.hidden { - display:none; -} -.leftalign { - text-align:left; -} -.centeralign { - text-align:center; -} -.rightalign { - text-align:right; -} - - -.dokuwiki div.plugin_translation ul li a.wikilink1:link, .dokuwiki div.plugin_translation ul li a.wikilink1:hover, .dokuwiki div.plugin_translation ul li a.wikilink1:active, .dokuwiki div.plugin_translation ul li a.wikilink1:visited { - background-color:#000080; - color:#fff !important; - text-decoration:none; - padding:0 0.2em; - margin:0.1em 0.2em; - border:none !important; -} -.dokuwiki div.plugin_translation ul li a.wikilink2:link, .dokuwiki div.plugin_translation ul li a.wikilink2:hover, .dokuwiki div.plugin_translation ul li a.wikilink2:active, .dokuwiki div.plugin_translation ul li a.wikilink2:visited { - background-color:#808080; - color:#fff !important; - text-decoration:none; - padding:0 0.2em; - margin:0.1em 0.2em; - border:none !important; -} - -.dokuwiki div.plugin_translation ul li a:hover img { - opacity:1.0; - height:15px; -} - -body { - margin:0; - padding:0; - background-color:white; - color:black; - font-size:12px; - font-family:Verdana, Helvetica, "Lucida Grande", Lucida, Arial, sans-serif; - font-family:sans-serif; - font-size:99, 96%; - font-size-adjust:none; - font-style:normal; - font-variant:normal; - font-weight:normal; - line-height:normal; -} -hr { - border-width:0; - border-bottom:1px #aaa dotted; -} -img { - border:none; -} -form { - margin:0px; - padding:0px; - border:none; - display:inline; - background:transparent; -} -ul li { - margin:5px; -} -textarea { - font-family:monospace; -} -table { - margin:0.5em 0; - border-collapse:collapse; -} -td { - padding:0.25em; - border:1pt solid #ADB9CC; -} -a { - color:#3465a4; - text-decoration:none; -} -a:hover { - text-decoration:underline; -} - -option { - border:0 none #fff; -} -strong.highlight { - background-color:#fc9; - padding:1pt; -} -#pagebottom { - clear:both; -} -hr { - height:1px; - color:#c0c0c0; - background-color:#c0c0c0; - border:none; - margin:.2em 0 .2em 0; -} - -.invisible { - margin:0px; - border:0px; - padding:0px; - height:0px; - visibility:hidden; -} -.left { - float:left !important; -} -.right { - float:right !important; -} -.center { - text-align:center; -} -div#body-wrapper { - padding:40px 40px 10px 40px; - font-size:127%; -} -div#content { - margin-top:-20px; - padding:0; - font-size:14px; - color:black; - line-height:1.5em; -} -h1, h2, h3, h4, h5, h6 { - background:transparent none repeat scroll 0 0; - border-bottom:1px solid #aaa; - color:black; - font-weight:normal; - margin:0; - padding:0; - padding-bottom:0.17em; - padding-top:0.5em; -} -h1 { - font-size:188%; - line-height:1.2em; - margin-bottom:0.1em; - padding-bottom:0; -} -h2 { - font-size:150%; -} -h3, h4, h5, h6 { - border-bottom:none; - font-weight:bold; -} -h3 { - font-size:132%; -} -h4 { - font-size:116%; -} -h5 { - font-size:100%; -} -h6 { - font-size:80%; -} -ul#page-actions, ul#page-actions-more { - float:right; - margin:10px 10px 0 10px; - padding:6px; - color:black; - background-color:#ececec; - list-style-type:none; - white-space: nowrap; - border-radius:5px; - -moz-border-radius:5px; -} -ul#user-actions { - padding:5px; - margin:0; - display:inline; - color:black; - background-color:#ececec; - list-style-type:none; - -moz-border-radius:3px; - border-radius:3px; -} -ul#page-actions li, ul#user-actions li, ul#page-actions-more li { - display:inline; -} -ul#page-actions a, ul#user-actions a, ul#page-actions-more a { - text-decoration:none; - color:black; - display:inline; - margin:0 3px; - padding:2px 0px 2px 18px; -} -ul#page-actions a:hover, ul#page-actions a:focus, ul#user-actions a:hover, ul#user-actions a:focus { - /*text-decoration:underline;*/ -} -/***************************/ -ul#page-actions2 { - float:left; - margin:10px 10px 0 10px; - padding:6px; - color:black; - background-color:#ececec; - list-style-type:none; - border-radius:5px; - -moz-border-radius:5px; -} -ul#user-actions2 { - padding:5px; - margin:0; - display:inline; - color:black; - background-color:#ececec; - list-style-type:none; - border-radius:3px; - -moz-border-radius:3px; -} -ul#page-actions2 li, ul#user-actions2 li { - display:inline; -} -ul#page-actions2 a, ul#user-actions2 a { - text-decoration:none; - color:black; - display:inline; - margin:0 3px; - padding:2px 0px 2px 18px; -} -ul#page-actions2 a:hover, ul#page-actions2 a:focus, ul#user-actions2 a:hover, ul#user-actions2 a:focus, -ul#page-actions-more a:hover, ul#page-actions-more a:focus{ - color: #4e7bb4; -} -/****************************/ -.hidden { - display:none; -} - -a.action.index { - background:transparent url(/media/default/img/wiki-tools-index.png) 0px 1px no-repeat; -} -a.action.recent { - background:transparent url(/media/default/img/wiki-tools-recent.png) 0px 1px no-repeat; -} -a.logout { - background:transparent url(/media/default/img/user-actions-logout.png) 0px 1px no-repeat; -} - -a.info { - background:transparent url(/media/default/img/user-info.png) 0px 1px no-repeat; -} - -a.admin { - background:transparent url(/media/default/img/user-actions-admin.png) 0px 1px no-repeat; -} -a.profile { - background:transparent url(/media/default/img/user-actions-profile.png) 0px 1px no-repeat; -} -a.create, a.edit { - background:transparent url(/media/default/img/page-tools-edit.png) 0px 1px no-repeat; -} -a.source, a.show { - background:transparent url(/media/default/img/page-tools-source.png) 0px 1px no-repeat; -} -a.revisions { - background:transparent url(/media/default/img/page-tools-revisions.png) 0px 1px no-repeat; -} -a.subscribe, a.unsubscribe { - background:transparent url(/media/default/img/page-tools-subscribe.png) 0px 1px no-repeat; -} -a.backlink { - background:transparent url(/media/default/img/page-tools-backlinks.png) 0px 1px no-repeat; -} -a.play { - background:transparent url(/media/default/img/control_play.png) 0px 1px no-repeat; -} -.time { - background:transparent url(/media/default/img/status_None.png) 0px 1px no-repeat; - padding: 2px 0px 2px 18px; - margin: 0px 3px; -} -.reconnect { - background:transparent url(/media/default/img/reconnect.png) 0px 1px no-repeat; - padding: 2px 0px 2px 18px; - margin: 0px 3px; -} -a.play:hover { - background:transparent url(/media/default/img/control_play_blue.png) 0px 1px no-repeat; -} -a.cancel { - background:transparent url(/media/default/img/control_cancel.png) 0px 1px no-repeat; -} -a.cancel:hover { - background:transparent url(/media/default/img/control_cancel_blue.png) 0px 1px no-repeat; -} -a.pause { - background:transparent url(/media/default/img/control_pause.png) 0px 1px no-repeat; -} -a.pause:hover { - background:transparent url(/media/default/img/control_pause_blue.png) 0px 1px no-repeat; - font-weight: bold; -} -a.stop { - background:transparent url(/media/default/img/control_stop.png) 0px 1px no-repeat; -} -a.stop:hover { - background:transparent url(/media/default/img/control_stop_blue.png) 0px 1px no-repeat; -} -a.add { - background:transparent url(/media/default/img/control_add.png) 0px 1px no-repeat; -} -a.add:hover { - background:transparent url(/media/default/img/control_add_blue.png) 0px 1px no-repeat; -} -a.cog { - background:transparent url(/media/default/img/cog.png) 0px 1px no-repeat; -} -#head-panel { - background:#525252 url(/media/default/img/head_bg1.png) bottom left repeat-x; -} -#head-panel h1 { - display:none; - margin:0; - text-decoration:none; - padding-top:0.8em; - padding-left:3.3em; - font-size:2.6em; - color:#eeeeec; -} -#head-panel #head-logo { - float:left; - margin:5px 0 -15px 5px; - padding:0; - overflow:visible; -} -#head-menu { - background:transparent url(/media/default/img/tabs-border-bottom.png) 0 100% repeat-x; - width:100%; - float:left; - margin:0; - padding:0; - padding-top:0.8em; -} -#head-menu ul { - list-style:none; - margin:0 1em 0 2em; -} -#head-menu ul li { - float:left; - margin:0; - margin-left:0.3em; - font-size:14px; - margin-bottom:4px; -} -#head-menu ul li.selected, #head-menu ul li:hover { - margin-bottom:0px; -} -#head-menu ul li a img { - height:22px; - width:22px; - vertical-align:middle; -} -#head-menu ul li a, #head-menu ul li a:link { - float:left; - text-decoration:none; - color:#555; - background:#eaeaea url(/media/default/img/tab-background.png) 0 100% repeat-x; - padding:3px 7px 3px 7px; - border:2px solid #ccc; - border-bottom:0px solid transparent; - padding-bottom:3px; - -moz-border-radius:5px; - border-radius:5px; -} -#head-menu ul li a:hover, #head-menu ul li a:focus { - color:#111; - padding-bottom:7px; - border-bottom:0px none transparent; - outline:none; - border-bottom-left-radius: 0px; - border-bottom-right-radius: 0px; - -moz-border-radius-bottomright:0px; - -moz-border-radius-bottomleft:0px; -} -#head-menu ul li a:focus { - margin-bottom:-4px; -} -#head-menu ul li.selected a { - color:#3566A5; - background:#fff; - padding-bottom:7px; - border-bottom:0px none transparent; - border-bottom-left-radius: 0px; - border-bottom-right-radius: 0px; - -moz-border-radius-bottomright:0px; - -moz-border-radius-bottomleft:0px; -} -#head-menu ul li.selected a:hover, #head-menu ul li.selected a:focus { - color:#111; -} -div#head-search-and-login { - float:right; - margin:0 1em 0 0; - background-color:#222; - padding:7px 7px 5px 5px; - color:white; - white-space: nowrap; - border-bottom-left-radius: 6px; - border-bottom-right-radius: 6px; - -moz-border-radius-bottomright:6px; - -moz-border-radius-bottomleft:6px; -} -div#head-search-and-login form { - display:inline; - padding:0 3px; -} -div#head-search-and-login form input { - border:2px solid #888; - background:#eee; - font-size:14px; - padding:2px; - border-radius:3px; - -moz-border-radius:3px; -} -div#head-search-and-login form input:focus { - background:#fff; -} -#head-search { - font-size:14px; -} -#head-username, #head-password { - width:80px; - font-size:14px; -} -#pageinfo { - clear:both; - color:#888; - padding:0.6em 0; - margin:0; -} -#foot { - font-style:normal; - color:#888; - text-align:center; -} -#foot a { - color:#aaf; -} -#foot img { - vertical-align:middle; -} -div.toc { - border:1px dotted #888; - background:#f0f0f0; - margin:1em 0 1em 1em; - float:right; - font-size:95%; -} -div.toc .tocheader { - font-weight:bold; - margin:0.5em 1em; -} -div.toc ol { - margin:1em 0.5em 1em 1em; - padding:0; -} -div.toc ol li { - margin:0; - padding:0; - margin-left:1em; -} -div.toc ol ol { - margin:0.5em 0.5em 0.5em 1em; - padding:0; -} -div.recentchanges table { - clear:both; -} -div#editor-help { - font-size:90%; - border:1px dotted #888; - padding:0ex 1ex 1ex 1ex; - background:#f7f6f2; -} -div#preview { - margin-top:1em; -} -label.block { - display:block; - text-align:right; - font-weight:bold; -} -label.simple { - display:block; - text-align:left; - font-weight:normal; -} -label.block input.edit { - width:50%; -} -/*fieldset { - width:300px; - text-align:center; - padding:0.5em; - margin:auto; -} -*/ -div.editor { - margin:0 0 0 0; -} -table { - margin:0.5em 0; - border-collapse:collapse; -} -td { - padding:0.25em; - border:1pt solid #ADB9CC; -} -td p { - margin:0; - padding:0; -} -.u { - text-decoration:underline; -} -.footnotes ul { - padding:0 2em; - margin:0 0 1em; -} -.footnotes li { - list-style:none; -} -.userpref table, .userpref td { - border:none; -} -#message { - clear:both; - padding:5px 10px; - background-color:#eee; - border-bottom:2px solid #ccc; -} -#message p { - margin:5px 0; - padding:0; - font-weight:bold; -} -#message div.buttons { - font-weight:normal; -} -.diff { - width:99%; -} -.diff-title { - background-color:#C0C0C0; -} -.searchresult dd span { - font-weight:bold; -} -.boxtext { - font-family:tahoma, arial, sans-serif; - font-size:11px; - color:#000; - float:none; - padding:3px 0 0 10px; -} -.statusbutton { - width:32px; - height:32px; - float:left; - margin-left:-32px; - margin-right:5px; - opacity:0; - cursor:pointer -} -.dlsize { - float:left; - padding-right: 8px; -} -.dlspeed { - float:left; - padding-right: 8px; -} -.package { - margin-bottom: 10px; -} -.packagename { - font-weight: bold; -} - -.child { - margin-left: 20px; -} -.child_status { - margin-right: 10px; -} -.child_secrow { - font-size: 10px; -} - -.header, .header th { - text-align: left; - font-weight: normal; - background-color:#ececec; - -moz-border-radius:5px; - border-radius:5px; -} -.progress_bar { - background: #0C0; - height: 5px; - -} - -.queue { - border: none -} - -.queue tr td { - border: none -} - -.header, .header th{ - text-align: left; - font-weight: normal; -} - - -.clearer -{ - clear: both; - height: 1px; -} - -.left -{ - float: left; -} - -.right -{ - float: right; -} - - -.setfield -{ - display: table-cell; -} - -ul.tabs li a -{ - padding: 5px 16px 4px 15px; - border: none; - font-weight: bold; - - border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -} - - -#tabs span -{ - display: none; -} - -#tabs span.selected -{ - display: inline; -} - -#tabsback -{ - background-color: #525252; - margin: 2px 0 0; - padding: 6px 4px 1px 4px; - - border-top-right-radius: 30px; - border-top-left-radius: 3px; - -moz-border-radius-topright: 30px; - -moz-border-radius-topleft: 3px; -} -ul.tabs -{ - list-style-type: none; - margin:0; - padding: 0 40px 0 0; -} - -ul.tabs li -{ - display: inline; - margin-left: 8px; -} - - -ul.tabs li a -{ - color: #42454a; - background-color: #eaeaea; - border: 1px none #c9c3ba; - margin: 0; - text-decoration: none; - - outline: 0; - - padding: 5px 16px 4px 15px; - font-weight: bold; - - border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -} - -ul.tabs li a.selected, ul.tabs li a:hover -{ - color: #000; - background-color: white; - - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 0; - -moz-border-radius-bottomleft: 0; -} - -ul.tabs li a:hover -{ - background-color: #f1f4ee; -} - -ul.tabs li a.selected -{ - font-weight: bold; - background-color: #525252; - padding-bottom: 5px; - color: white; -} - - -#tabs-body { - position: relative; - overflow: hidden; -} - - -span.tabContent -{ - border: 2px solid #525252; - margin: 0; - padding: 0; - padding-bottom: 10px; -} - -#tabs-body > span { - display: none; -} - -#tabs-body > span.active { - display: block; -} - -.hide -{ - display: none; -} - -.settable -{ - margin: 20px; - border: none; -} -.settable td -{ - border: none; - margin: 0; - padding: 5px; -} - -.settable th{ - padding-bottom: 8px; -} - -.settable.wide td , .settable.wide th { - padding-left: 15px; - padding-right: 15px; -} - - -/*settings navbar*/ -ul.nav { - margin: -30px 0 0; - padding: 0; - list-style: none; - position: absolute; -} - - -ul.nav li { - position: relative; - float: left; - padding: 5px; -} - -ul.nav > li a { - background: white; - -moz-border-radius: 4px 4px 4px 4px; - border: 1px solid #C9C3BA; - border-bottom: medium none; - color: black; -} - -ul.nav ul { - position: absolute; - top: 26px; - left: 10px; - margin: 0; - padding: 0; - list-style: none; - border: 1px solid #AAA; - background: #f1f1f1; - -webkit-box-shadow: 1px 1px 5px #AAA; - -moz-box-shadow: 1px 1px 5px #AAA; - box-shadow: 1px 1px 5px #AAA; - cursor: pointer; -} - -ul.nav .open { - display: block; -} - -ul.nav .close { - display: none; -} - -ul.nav ul li { - float: none; - padding: 0; -} - -ul.nav ul li a { - width: 130px; - background: #f1f1f1; - padding: 3px; - display: block; - font-weight: normal; -} - -ul.nav ul li a:hover { - background: #CDCDCD; -} - -ul.nav ul ul { - left: 137px; - top: 0; -} - -.purr-wrapper{ - margin:10px; -} - -/*Purr alert styles*/ - -.purr-alert{ - margin-bottom:10px; - padding:10px; - background:#000; - font-size:13px; - font-weight:bold; - color:#FFF; - -moz-border-radius:5px; - -webkit-border-radius:5px; - /*-moz-box-shadow: 0 0 10px rgba(255,255,0,.25);*/ - width:300px; -} -.purr-alert.error{ - color:#F55; - padding-left:30px; - background:url(/media/default/img/error.png) no-repeat #000 7px 10px; - width:280px; -} -.purr-alert.success{ - color:#5F5; - padding-left:30px; - background:url(/media/default/img/success.png) no-repeat #000 7px 10px; - width:280px; -} -.purr-alert.notice{ - color:#99F; - padding-left:30px; - background:url(/media/default/img//notice.png) no-repeat #000 7px 10px; - width:280px; -} - -table.system { - border: none; - margin-left: 10px; -} - -table.system td { - border: none -} - -table.system tr > td:first-child { - font-weight: bold; - padding-right: 10px; +.hidden { + display:none; +} +.leftalign { + text-align:left; +} +.centeralign { + text-align:center; +} +.rightalign { + text-align:right; +} + + +.dokuwiki div.plugin_translation ul li a.wikilink1:link, .dokuwiki div.plugin_translation ul li a.wikilink1:hover, .dokuwiki div.plugin_translation ul li a.wikilink1:active, .dokuwiki div.plugin_translation ul li a.wikilink1:visited { + background-color:#000080; + color:#fff !important; + text-decoration:none; + padding:0 0.2em; + margin:0.1em 0.2em; + border:none !important; +} +.dokuwiki div.plugin_translation ul li a.wikilink2:link, .dokuwiki div.plugin_translation ul li a.wikilink2:hover, .dokuwiki div.plugin_translation ul li a.wikilink2:active, .dokuwiki div.plugin_translation ul li a.wikilink2:visited { + background-color:#808080; + color:#fff !important; + text-decoration:none; + padding:0 0.2em; + margin:0.1em 0.2em; + border:none !important; +} + +.dokuwiki div.plugin_translation ul li a:hover img { + opacity:1.0; + height:15px; +} + +body { + margin:0; + padding:0; + background-color:white; + color:black; + font-size:12px; + font-family:Verdana, Helvetica, "Lucida Grande", Lucida, Arial, sans-serif; + font-family:sans-serif; + font-size:99, 96%; + font-size-adjust:none; + font-style:normal; + font-variant:normal; + font-weight:normal; + line-height:normal; +} +hr { + border-width:0; + border-bottom:1px #aaa dotted; +} +img { + border:none; +} +form { + margin:0px; + padding:0px; + border:none; + display:inline; + background:transparent; +} +ul li { + margin:5px; +} +textarea { + font-family:monospace; +} +table { + margin:0.5em 0; + border-collapse:collapse; +} +td { + padding:0.25em; + border:1pt solid #ADB9CC; +} +a { + color:#3465a4; + text-decoration:none; +} +a:hover { + text-decoration:underline; +} + +option { + border:0 none #fff; +} +strong.highlight { + background-color:#fc9; + padding:1pt; +} +#pagebottom { + clear:both; +} +hr { + height:1px; + color:#c0c0c0; + background-color:#c0c0c0; + border:none; + margin:.2em 0 .2em 0; +} + +.invisible { + margin:0px; + border:0px; + padding:0px; + height:0px; + visibility:hidden; +} +.left { + float:left !important; +} +.right { + float:right !important; +} +.center { + text-align:center; +} +div#body-wrapper { + padding:40px 40px 10px 40px; + font-size:127%; +} +div#content { + margin-top:-20px; + padding:0; + font-size:14px; + color:black; + line-height:1.5em; +} +h1, h2, h3, h4, h5, h6 { + background:transparent none repeat scroll 0 0; + border-bottom:1px solid #aaa; + color:black; + font-weight:normal; + margin:0; + padding:0; + padding-bottom:0.17em; + padding-top:0.5em; +} +h1 { + font-size:188%; + line-height:1.2em; + margin-bottom:0.1em; + padding-bottom:0; +} +h2 { + font-size:150%; +} +h3, h4, h5, h6 { + border-bottom:none; + font-weight:bold; +} +h3 { + font-size:132%; +} +h4 { + font-size:116%; +} +h5 { + font-size:100%; +} +h6 { + font-size:80%; +} +ul#page-actions, ul#page-actions-more { + float:right; + margin:10px 10px 0 10px; + padding:6px; + color:black; + background-color:#ececec; + list-style-type:none; + white-space: nowrap; + border-radius:5px; + -moz-border-radius:5px; +} +ul#user-actions { + padding:5px; + margin:0; + display:inline; + color:black; + background-color:#ececec; + list-style-type:none; + -moz-border-radius:3px; + border-radius:3px; +} +ul#page-actions li, ul#user-actions li, ul#page-actions-more li { + display:inline; +} +ul#page-actions a, ul#user-actions a, ul#page-actions-more a { + text-decoration:none; + color:black; + display:inline; + margin:0 3px; + padding:2px 0px 2px 18px; +} +ul#page-actions a:hover, ul#page-actions a:focus, ul#user-actions a:hover, ul#user-actions a:focus { + /*text-decoration:underline;*/ +} +/***************************/ +ul#page-actions2 { + float:left; + margin:10px 10px 0 10px; + padding:6px; + color:black; + background-color:#ececec; + list-style-type:none; + border-radius:5px; + -moz-border-radius:5px; +} +ul#user-actions2 { + padding:5px; + margin:0; + display:inline; + color:black; + background-color:#ececec; + list-style-type:none; + border-radius:3px; + -moz-border-radius:3px; +} +ul#page-actions2 li, ul#user-actions2 li { + display:inline; +} +ul#page-actions2 a, ul#user-actions2 a { + text-decoration:none; + color:black; + display:inline; + margin:0 3px; + padding:2px 0px 2px 18px; +} +ul#page-actions2 a:hover, ul#page-actions2 a:focus, ul#user-actions2 a:hover, ul#user-actions2 a:focus, +ul#page-actions-more a:hover, ul#page-actions-more a:focus{ + color: #4e7bb4; +} +/****************************/ +.hidden { + display:none; +} + +a.action.index { + background:transparent url(/media/default/img/wiki-tools-index.png) 0px 1px no-repeat; +} +a.action.recent { + background:transparent url(/media/default/img/wiki-tools-recent.png) 0px 1px no-repeat; +} +a.logout { + background:transparent url(/media/default/img/user-actions-logout.png) 0px 1px no-repeat; +} + +a.info { + background:transparent url(/media/default/img/user-info.png) 0px 1px no-repeat; +} + +a.admin { + background:transparent url(/media/default/img/user-actions-admin.png) 0px 1px no-repeat; +} +a.profile { + background:transparent url(/media/default/img/user-actions-profile.png) 0px 1px no-repeat; +} +a.create, a.edit { + background:transparent url(/media/default/img/page-tools-edit.png) 0px 1px no-repeat; +} +a.source, a.show { + background:transparent url(/media/default/img/page-tools-source.png) 0px 1px no-repeat; +} +a.revisions { + background:transparent url(/media/default/img/page-tools-revisions.png) 0px 1px no-repeat; +} +a.subscribe, a.unsubscribe { + background:transparent url(/media/default/img/page-tools-subscribe.png) 0px 1px no-repeat; +} +a.backlink { + background:transparent url(/media/default/img/page-tools-backlinks.png) 0px 1px no-repeat; +} +a.play { + background:transparent url(/media/default/img/control_play.png) 0px 1px no-repeat; +} +.time { + background:transparent url(/media/default/img/status_None.png) 0px 1px no-repeat; + padding: 2px 0px 2px 18px; + margin: 0px 3px; +} +.reconnect { + background:transparent url(/media/default/img/reconnect.png) 0px 1px no-repeat; + padding: 2px 0px 2px 18px; + margin: 0px 3px; +} +a.play:hover { + background:transparent url(/media/default/img/control_play_blue.png) 0px 1px no-repeat; +} +a.cancel { + background:transparent url(/media/default/img/control_cancel.png) 0px 1px no-repeat; +} +a.cancel:hover { + background:transparent url(/media/default/img/control_cancel_blue.png) 0px 1px no-repeat; +} +a.pause { + background:transparent url(/media/default/img/control_pause.png) 0px 1px no-repeat; +} +a.pause:hover { + background:transparent url(/media/default/img/control_pause_blue.png) 0px 1px no-repeat; + font-weight: bold; +} +a.stop { + background:transparent url(/media/default/img/control_stop.png) 0px 1px no-repeat; +} +a.stop:hover { + background:transparent url(/media/default/img/control_stop_blue.png) 0px 1px no-repeat; +} +a.add { + background:transparent url(/media/default/img/control_add.png) 0px 1px no-repeat; +} +a.add:hover { + background:transparent url(/media/default/img/control_add_blue.png) 0px 1px no-repeat; +} +a.cog { + background:transparent url(/media/default/img/cog.png) 0px 1px no-repeat; +} +#head-panel { + background:#525252 url(/media/default/img/head_bg1.png) bottom left repeat-x; +} +#head-panel h1 { + display:none; + margin:0; + text-decoration:none; + padding-top:0.8em; + padding-left:3.3em; + font-size:2.6em; + color:#eeeeec; +} +#head-panel #head-logo { + float:left; + margin:5px 0 -15px 5px; + padding:0; + overflow:visible; +} +#head-menu { + background:transparent url(/media/default/img/tabs-border-bottom.png) 0 100% repeat-x; + width:100%; + float:left; + margin:0; + padding:0; + padding-top:0.8em; +} +#head-menu ul { + list-style:none; + margin:0 1em 0 2em; +} +#head-menu ul li { + float:left; + margin:0; + margin-left:0.3em; + font-size:14px; + margin-bottom:4px; +} +#head-menu ul li.selected, #head-menu ul li:hover { + margin-bottom:0px; +} +#head-menu ul li a img { + height:22px; + width:22px; + vertical-align:middle; +} +#head-menu ul li a, #head-menu ul li a:link { + float:left; + text-decoration:none; + color:#555; + background:#eaeaea url(/media/default/img/tab-background.png) 0 100% repeat-x; + padding:3px 7px 3px 7px; + border:2px solid #ccc; + border-bottom:0px solid transparent; + padding-bottom:3px; + -moz-border-radius:5px; + border-radius:5px; +} +#head-menu ul li a:hover, #head-menu ul li a:focus { + color:#111; + padding-bottom:7px; + border-bottom:0px none transparent; + outline:none; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; + -moz-border-radius-bottomright:0px; + -moz-border-radius-bottomleft:0px; +} +#head-menu ul li a:focus { + margin-bottom:-4px; +} +#head-menu ul li.selected a { + color:#3566A5; + background:#fff; + padding-bottom:7px; + border-bottom:0px none transparent; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; + -moz-border-radius-bottomright:0px; + -moz-border-radius-bottomleft:0px; +} +#head-menu ul li.selected a:hover, #head-menu ul li.selected a:focus { + color:#111; +} +div#head-search-and-login { + float:right; + margin:0 1em 0 0; + background-color:#222; + padding:7px 7px 5px 5px; + color:white; + white-space: nowrap; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + -moz-border-radius-bottomright:6px; + -moz-border-radius-bottomleft:6px; +} +div#head-search-and-login form { + display:inline; + padding:0 3px; +} +div#head-search-and-login form input { + border:2px solid #888; + background:#eee; + font-size:14px; + padding:2px; + border-radius:3px; + -moz-border-radius:3px; +} +div#head-search-and-login form input:focus { + background:#fff; +} +#head-search { + font-size:14px; +} +#head-username, #head-password { + width:80px; + font-size:14px; +} +#pageinfo { + clear:both; + color:#888; + padding:0.6em 0; + margin:0; +} +#foot { + font-style:normal; + color:#888; + text-align:center; +} +#foot a { + color:#aaf; +} +#foot img { + vertical-align:middle; +} +div.toc { + border:1px dotted #888; + background:#f0f0f0; + margin:1em 0 1em 1em; + float:right; + font-size:95%; +} +div.toc .tocheader { + font-weight:bold; + margin:0.5em 1em; +} +div.toc ol { + margin:1em 0.5em 1em 1em; + padding:0; +} +div.toc ol li { + margin:0; + padding:0; + margin-left:1em; +} +div.toc ol ol { + margin:0.5em 0.5em 0.5em 1em; + padding:0; +} +div.recentchanges table { + clear:both; +} +div#editor-help { + font-size:90%; + border:1px dotted #888; + padding:0ex 1ex 1ex 1ex; + background:#f7f6f2; +} +div#preview { + margin-top:1em; +} +label.block { + display:block; + text-align:right; + font-weight:bold; +} +label.simple { + display:block; + text-align:left; + font-weight:normal; +} +label.block input.edit { + width:50%; +} +/*fieldset { + width:300px; + text-align:center; + padding:0.5em; + margin:auto; +} +*/ +div.editor { + margin:0 0 0 0; +} +table { + margin:0.5em 0; + border-collapse:collapse; +} +td { + padding:0.25em; + border:1pt solid #ADB9CC; +} +td p { + margin:0; + padding:0; +} +.u { + text-decoration:underline; +} +.footnotes ul { + padding:0 2em; + margin:0 0 1em; +} +.footnotes li { + list-style:none; +} +.userpref table, .userpref td { + border:none; +} +#message { + clear:both; + padding:5px 10px; + background-color:#eee; + border-bottom:2px solid #ccc; +} +#message p { + margin:5px 0; + padding:0; + font-weight:bold; +} +#message div.buttons { + font-weight:normal; +} +.diff { + width:99%; +} +.diff-title { + background-color:#C0C0C0; +} +.searchresult dd span { + font-weight:bold; +} +.boxtext { + font-family:tahoma, arial, sans-serif; + font-size:11px; + color:#000; + float:none; + padding:3px 0 0 10px; +} +.statusbutton { + width:32px; + height:32px; + float:left; + margin-left:-32px; + margin-right:5px; + opacity:0; + cursor:pointer +} +.dlsize { + float:left; + padding-right: 8px; +} +.dlspeed { + float:left; + padding-right: 8px; +} +.package { + margin-bottom: 10px; +} +.packagename { + font-weight: bold; +} + +.child { + margin-left: 20px; +} +.child_status { + margin-right: 10px; +} +.child_secrow { + font-size: 10px; +} + +.header, .header th { + text-align: left; + font-weight: normal; + background-color:#ececec; + -moz-border-radius:5px; + border-radius:5px; +} +.progress_bar { + background: #0C0; + height: 5px; + +} + +.queue { + border: none +} + +.queue tr td { + border: none +} + +.header, .header th{ + text-align: left; + font-weight: normal; +} + + +.clearer +{ + clear: both; + height: 1px; +} + +.left +{ + float: left; +} + +.right +{ + float: right; +} + + +.setfield +{ + display: table-cell; +} + +ul.tabs li a +{ + padding: 5px 16px 4px 15px; + border: none; + font-weight: bold; + + border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + +} + + +#tabs span +{ + display: none; +} + +#tabs span.selected +{ + display: inline; +} + +#tabsback +{ + background-color: #525252; + margin: 2px 0 0; + padding: 6px 4px 1px 4px; + + border-top-right-radius: 30px; + border-top-left-radius: 3px; + -moz-border-radius-topright: 30px; + -moz-border-radius-topleft: 3px; +} +ul.tabs +{ + list-style-type: none; + margin:0; + padding: 0 40px 0 0; +} + +ul.tabs li +{ + display: inline; + margin-left: 8px; +} + + +ul.tabs li a +{ + color: #42454a; + background-color: #eaeaea; + border: 1px none #c9c3ba; + margin: 0; + text-decoration: none; + + outline: 0; + + padding: 5px 16px 4px 15px; + font-weight: bold; + + border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + +} + +ul.tabs li a.selected, ul.tabs li a:hover +{ + color: #000; + background-color: white; + + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; +} + +ul.tabs li a:hover +{ + background-color: #f1f4ee; +} + +ul.tabs li a.selected +{ + font-weight: bold; + background-color: #525252; + padding-bottom: 5px; + color: white; +} + + +#tabs-body { + position: relative; + overflow: hidden; +} + + +span.tabContent +{ + border: 2px solid #525252; + margin: 0; + padding: 0; + padding-bottom: 10px; +} + +#tabs-body > span { + display: none; +} + +#tabs-body > span.active { + display: block; +} + +.hide +{ + display: none; +} + +.settable +{ + margin: 20px; + border: none; +} +.settable td +{ + border: none; + margin: 0; + padding: 5px; +} + +.settable th{ + padding-bottom: 8px; +} + +.settable.wide td , .settable.wide th { + padding-left: 15px; + padding-right: 15px; +} + + +/*settings navbar*/ +ul.nav { + margin: -30px 0 0; + padding: 0; + list-style: none; + position: absolute; +} + + +ul.nav li { + position: relative; + float: left; + padding: 5px; +} + +ul.nav > li a { + background: white; + -moz-border-radius: 4px 4px 4px 4px; + border: 1px solid #C9C3BA; + border-bottom: medium none; + color: black; +} + +ul.nav ul { + position: absolute; + top: 26px; + left: 10px; + margin: 0; + padding: 0; + list-style: none; + border: 1px solid #AAA; + background: #f1f1f1; + -webkit-box-shadow: 1px 1px 5px #AAA; + -moz-box-shadow: 1px 1px 5px #AAA; + box-shadow: 1px 1px 5px #AAA; + cursor: pointer; +} + +ul.nav .open { + display: block; +} + +ul.nav .close { + display: none; +} + +ul.nav ul li { + float: none; + padding: 0; +} + +ul.nav ul li a { + width: 130px; + background: #f1f1f1; + padding: 3px; + display: block; + font-weight: normal; +} + +ul.nav ul li a:hover { + background: #CDCDCD; +} + +ul.nav ul ul { + left: 137px; + top: 0; +} + +.purr-wrapper{ + margin:10px; +} + +/*Purr alert styles*/ + +.purr-alert{ + margin-bottom:10px; + padding:10px; + background:#000; + font-size:13px; + font-weight:bold; + color:#FFF; + -moz-border-radius:5px; + -webkit-border-radius:5px; + /*-moz-box-shadow: 0 0 10px rgba(255,255,0,.25);*/ + width:300px; +} +.purr-alert.error{ + color:#F55; + padding-left:30px; + background:url(/media/default/img/error.png) no-repeat #000 7px 10px; + width:280px; +} +.purr-alert.success{ + color:#5F5; + padding-left:30px; + background:url(/media/default/img/success.png) no-repeat #000 7px 10px; + width:280px; +} +.purr-alert.notice{ + color:#99F; + padding-left:30px; + background:url(/media/default/img//notice.png) no-repeat #000 7px 10px; + width:280px; +} + +table.system { + border: none; + margin-left: 10px; +} + +table.system td { + border: none +} + +table.system tr > td:first-child { + font-weight: bold; + padding-right: 10px; } \ No newline at end of file diff --git a/module/web/media/default/css/window.css b/module/web/media/default/css/window.css index 8b13f55ec..12829868b 100644 --- a/module/web/media/default/css/window.css +++ b/module/web/media/default/css/window.css @@ -1,73 +1,73 @@ -/* ----------- stylized ----------- */ -.window_box h1{ - font-size:14px; - font-weight:bold; - margin-bottom:8px; -} -.window_box p{ - font-size:11px; - color:#666666; - margin-bottom:20px; - border-bottom:solid 1px #b7ddf2; - padding-bottom:10px; -} -.window_box label{ - display:block; - font-weight:bold; - text-align:right; - width:240px; - float:left; -} -.window_box .small{ - color:#666666; - display:block; - font-size:11px; - font-weight:normal; - text-align:right; - width:240px; -} -.window_box select, .window_box input{ - float:left; - font-size:12px; - padding:4px 2px; - border:solid 1px #aacfe4; - width:300px; - margin:2px 0 20px 10px; -} -.window_box .cont{ - float:left; - font-size:12px; - padding: 0px 10px 15px 0px; - width:300px; - margin:0px 0px 0px 10px; -} -.window_box .cont input{ - float: none; - margin: 0px 15px 0px 1px; -} -.window_box textarea{ - float:left; - font-size:12px; - padding:4px 2px; - border:solid 1px #aacfe4; - width:300px; - margin:2px 0 20px 10px; -} -.window_box button, .styled_button{ - clear:both; - margin-left:150px; - width:125px; - height:31px; - background:#666666 url(../img/button.png) no-repeat; - text-align:center; - line-height:31px; - color:#FFFFFF; - font-size:11px; - font-weight:bold; - border: 0px; -} - -.styled_button { - margin-left: 15px; - cursor: pointer; -} +/* ----------- stylized ----------- */ +.window_box h1{ + font-size:14px; + font-weight:bold; + margin-bottom:8px; +} +.window_box p{ + font-size:11px; + color:#666666; + margin-bottom:20px; + border-bottom:solid 1px #b7ddf2; + padding-bottom:10px; +} +.window_box label{ + display:block; + font-weight:bold; + text-align:right; + width:240px; + float:left; +} +.window_box .small{ + color:#666666; + display:block; + font-size:11px; + font-weight:normal; + text-align:right; + width:240px; +} +.window_box select, .window_box input{ + float:left; + font-size:12px; + padding:4px 2px; + border:solid 1px #aacfe4; + width:300px; + margin:2px 0 20px 10px; +} +.window_box .cont{ + float:left; + font-size:12px; + padding: 0px 10px 15px 0px; + width:300px; + margin:0px 0px 0px 10px; +} +.window_box .cont input{ + float: none; + margin: 0px 15px 0px 1px; +} +.window_box textarea{ + float:left; + font-size:12px; + padding:4px 2px; + border:solid 1px #aacfe4; + width:300px; + margin:2px 0 20px 10px; +} +.window_box button, .styled_button{ + clear:both; + margin-left:150px; + width:125px; + height:31px; + background:#666666 url(../img/button.png) no-repeat; + text-align:center; + line-height:31px; + color:#FFFFFF; + font-size:11px; + font-weight:bold; + border: 0px; +} + +.styled_button { + margin-left: 15px; + cursor: pointer; +} diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 0b20ecdb0..147c08a37 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -1,180 +1,180 @@ - - - - - - - - - - - - - - - - - - -{% block title %}pyLoad {{_("Webinterface")}}{% endblock %} - -{% block head %} -{% endblock %} - - - - -
- - -
- {% block headpanel %} - - {% if user.is_authenticated %} - - -{% if update %} - -{{_("pyLoad Update available!")}} - -{% endif %} - - -{% if plugins %} - -{{_("Plugins updated, please restart!")}} - -{% endif %} - - -Captcha: -{{_("Captcha waiting")}} - - - User:{{user.name}} - -{% else %} - {{_("Please Login!")}} -{% endif %} - - {% endblock %} -
- - - -
- -
- -
-
- -{% if perms.STATUS %} - -{% endif %} - -{% if perms.LIST %} - -{% endif %} - -{% block pageactions %} -{% endblock %} -
- -
- -
- -

{% block subtitle %}pyLoad - {{_("Webinterface")}}{% endblock %}

- -{% block statusbar %} -{% endblock %} - - -
- -
-
- - -{% for message in messages %} -

{{message}}

-{% endfor %} - -
- - {{_("loading")}} -
- -{% block content %} -{% endblock content %} - -
- - -
-
- -
- {% include "default/window.html" %} - {% include "default/captcha.html" %} - {% block hidden %} - {% endblock %} -
- - + + + + + + + + + + + + + + + + + + +{% block title %}pyLoad {{_("Webinterface")}}{% endblock %} + +{% block head %} +{% endblock %} + + + + +
+ + +
+ {% block headpanel %} + + {% if user.is_authenticated %} + + +{% if update %} + +{{_("pyLoad Update available!")}} + +{% endif %} + + +{% if plugins %} + +{{_("Plugins updated, please restart!")}} + +{% endif %} + + +Captcha: +{{_("Captcha waiting")}} + + + User:{{user.name}} + +{% else %} + {{_("Please Login!")}} +{% endif %} + + {% endblock %} +
+ + + +
+ +
+ +
+
+ +{% if perms.STATUS %} + +{% endif %} + +{% if perms.LIST %} + +{% endif %} + +{% block pageactions %} +{% endblock %} +
+ +
+ +
+ +

{% block subtitle %}pyLoad - {{_("Webinterface")}}{% endblock %}

+ +{% block statusbar %} +{% endblock %} + + +
+ +
+
+ + +{% for message in messages %} +

{{message}}

+{% endfor %} + +
+ + {{_("loading")}} +
+ +{% block content %} +{% endblock content %} + +
+ + +
+
+ +
+ {% include "default/window.html" %} + {% include "default/captcha.html" %} + {% block hidden %} + {% endblock %} +
+ + diff --git a/module/web/templates/default/captcha.html b/module/web/templates/default/captcha.html index 332a9c102..288375b76 100644 --- a/module/web/templates/default/captcha.html +++ b/module/web/templates/default/captcha.html @@ -1,42 +1,42 @@ - -
- - - -

{{_("Captcha reading")}}

-

{{_("Please read the text on the captcha.")}}

- -
- - - - - - - - - - - -
- -
- -
- -
- - - - -
- -
- - - + +
+ +
+ +

{{_("Captcha reading")}}

+

{{_("Please read the text on the captcha.")}}

+ +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + + +
+ +
+ +
+
\ No newline at end of file diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 0efb1bcf8..7359e326c 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -1,266 +1,266 @@ -{% extends 'default/base.html' %} -{% block head %} - - - -{% endblock %} - -{% block subtitle %} -{{_("Active Downloads")}} -{% endblock %} - -{% block menu %} -
  • - {{_("Home")}} -
  • -
  • - {{_("Queue")}} -
  • -
  • - {{_("Collector")}} -
  • -
  • - {{_("Downloads")}} -
  • -{#
  • #} -{# {{_("FileManager")}}#} -{#
  • #} -
  • - {{_("Logs")}} -
  • -
  • - {{_("Config")}} -
  • -{% endblock %} - -{% block content %} - - - - - - - - - - - - - {% for link in content %} - - - - - - - - - - - {% endfor %} - - -
    {{_("Name")}}{{_("Status")}}{{_("Information")}}{{_("Size")}}{{_("Progress")}}
    +{% extends 'default/base.html' %} +{% block head %} + + + +{% endblock %} + +{% block subtitle %} +{{_("Active Downloads")}} +{% endblock %} + +{% block menu %} +
  • + {{_("Home")}} +
  • +
  • + {{_("Queue")}} +
  • +
  • + {{_("Collector")}} +
  • +
  • + {{_("Downloads")}} +
  • +{#
  • #} +{# {{_("FileManager")}}#} +{#
  • #} +
  • + {{_("Logs")}} +
  • +
  • + {{_("Config")}} +
  • +{% endblock %} + +{% block content %} + + + + + + + + + + + + + {% for link in content %} + + + + + + + + + + + {% endfor %} + + +
    {{_("Name")}}{{_("Status")}}{{_("Information")}}{{_("Size")}}{{_("Progress")}}
    {% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index c88fa3568..046abbe49 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -1,104 +1,104 @@ -{% extends 'default/base.html' %} -{% block head %} - - - - -{% endblock %} - -{% if target %} - {% set name = _("Queue") %} -{% else %} - {% set name = _("Collector") %} -{% endif %} - -{% block title %}{{name}} - {{super()}} {% endblock %} -{% block subtitle %}{{name}}{% endblock %} - -{% block pageactions %} - -{% endblock %} - -{% block content %} -{% autoescape true %} - -
      -{% for package in content %} -
    • -
      - - -
      - - {{package.name}} -    - - -    - -    - -    - - -
      - {% set progress = (package.linksdone * 100) / package.linkstotal %} - -
      -
      - - -
      -
      - - -
      -
    • -{% endfor %} -
    -{% endautoescape %} -{% endblock %} - -{% block hidden %} -
    -
    -

    {{_("Edit Package")}}

    -

    {{_("Edit the package detais below.")}}

    - - - - - - - - - - - - -
    - -
    - -
    +{% extends 'default/base.html' %} +{% block head %} + + + + +{% endblock %} + +{% if target %} + {% set name = _("Queue") %} +{% else %} + {% set name = _("Collector") %} +{% endif %} + +{% block title %}{{name}} - {{super()}} {% endblock %} +{% block subtitle %}{{name}}{% endblock %} + +{% block pageactions %} + +{% endblock %} + +{% block content %} +{% autoescape true %} + +
      +{% for package in content %} +
    • +
      + + +
      + + {{package.name}} +    + + +    + +    + +    + + +
      + {% set progress = (package.linksdone * 100) / package.linkstotal %} + +
      +
      + + +
      +
      + + +
      +
    • +{% endfor %} +
    +{% endautoescape %} +{% endblock %} + +{% block hidden %} +
    +
    +

    {{_("Edit Package")}}

    +

    {{_("Edit the package detais below.")}}

    + + + + + + + + + + + + +
    + +
    + +
    {% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index b61fa7149..a11323fe0 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -1,46 +1,46 @@ - - -
    -
    -

    {{_("Add Package")}}

    -

    {{_("Paste your links or upload a container.")}}

    - - - - - - - - - - - - - - - {{_("Queue")}} - - {{_("Collector")}} - - - - - -
    - -
    - + + +
    +
    +

    {{_("Add Package")}}

    +

    {{_("Paste your links or upload a container.")}}

    + + + + + + + + + + + + + + + {{_("Queue")}} + + {{_("Collector")}} + + + + + +
    + +
    +
    \ No newline at end of file -- cgit v1.2.3 From 4b61d36bf18931df0a9720047b3619ce245f8a1b Mon Sep 17 00:00:00 2001 From: Stefano Date: Sun, 21 Jul 2013 15:03:21 +0200 Subject: Fixed PEP 8 violations in Crypters --- module/plugins/crypter/C1neonCom.py | 47 ++-- module/plugins/crypter/CrockoComFolder.py | 1 + module/plugins/crypter/CryptItCom.py | 4 +- module/plugins/crypter/CzshareComFolder.py | 1 + module/plugins/crypter/DDLMusicOrg.py | 13 +- module/plugins/crypter/DepositfilesComFolder.py | 3 +- module/plugins/crypter/Dereferer.py | 3 +- module/plugins/crypter/DontKnowMe.py | 3 +- module/plugins/crypter/DownloadVimeoCom.py | 43 ++-- module/plugins/crypter/DuckCryptInfo.py | 9 +- module/plugins/crypter/EmbeduploadCom.py | 19 +- module/plugins/crypter/FilebeerInfoFolder.py | 21 +- module/plugins/crypter/FilefactoryComFolder.py | 5 +- module/plugins/crypter/FileserveComFolder.py | 5 +- module/plugins/crypter/FourChanOrg.py | 1 + module/plugins/crypter/FshareVnFolder.py | 3 +- module/plugins/crypter/HoerbuchIn.py | 19 +- module/plugins/crypter/HotfileFolderCom.py | 7 +- module/plugins/crypter/ILoadTo.py | 26 +- module/plugins/crypter/LinkSaveIn.py | 61 ++--- module/plugins/crypter/LinkdecrypterCom.py | 22 +- module/plugins/crypter/LixIn.py | 32 +-- module/plugins/crypter/LofCc.py | 30 ++- module/plugins/crypter/MediafireComFolder.py | 20 +- module/plugins/crypter/Movie2kTo.py | 277 ++++++++++---------- module/plugins/crypter/MultiloadCz.py | 5 +- module/plugins/crypter/MultiuploadCom.py | 50 ++-- module/plugins/crypter/NCryptIn.py | 87 +++---- module/plugins/crypter/OneKhDe.py | 4 +- module/plugins/crypter/OronComFolder.py | 10 +- module/plugins/crypter/QuickshareCzFolder.py | 7 +- module/plugins/crypter/RSLayerCom.py | 1 + module/plugins/crypter/RelinkUs.py | 78 +++--- module/plugins/crypter/SecuredIn.py | 323 ++++++++++++++++-------- module/plugins/crypter/SerienjunkiesOrg.py | 71 +++--- module/plugins/crypter/ShareLinksBiz.py | 82 +++--- module/plugins/crypter/ShareRapidComFolder.py | 5 +- module/plugins/crypter/SpeedLoadOrgFolder.py | 1 + module/plugins/crypter/StealthTo.py | 16 +- module/plugins/crypter/TrailerzoneInfo.py | 13 +- module/plugins/crypter/UlozToFolder.py | 10 +- module/plugins/crypter/WiiReloadedOrg.py | 17 +- module/plugins/crypter/YoutubeBatch.py | 4 +- 43 files changed, 811 insertions(+), 648 deletions(-) diff --git a/module/plugins/crypter/C1neonCom.py b/module/plugins/crypter/C1neonCom.py index 36b84764e..7d20d8a73 100644 --- a/module/plugins/crypter/C1neonCom.py +++ b/module/plugins/crypter/C1neonCom.py @@ -20,6 +20,8 @@ import re import random from module.plugins.Crypter import Crypter from module.common.json_layer import json_loads + + class C1neonCom(Crypter): __name__ = "C1neonCom" __type__ = "container" @@ -31,9 +33,10 @@ class C1neonCom(Crypter): ("useStreams", "bool", "Use Streams too", False), ("hosterListMode", "all;onlypreferred", "Use for hosters (if supported)", "all"), ("randomPreferred", "bool", "Randomize Preferred-List", False), - ("hosterList", "str", "Preferred Hoster list (comma separated, no ending)", "2shared,Bayfiles,Netload,Rapidshare,Share-online"), + ("hosterList", "str", "Preferred Hoster list (comma separated, no ending)", + "2shared,Bayfiles,Netload,Rapidshare,Share-online"), ("ignoreList", "str", "Ignored Hoster list (comma separated, no ending)", "Megaupload") - ] + ] __description__ = """C1neon.Com Container Plugin""" __author_name__ = ("godofdream") __author_mail__ = ("soilfiction@gmail.com") @@ -41,13 +44,13 @@ class C1neonCom(Crypter): VALUES_PATTERN = r"var subcats = (.*?)(;|;var)" SHOW_PATTERN = r"title='(.*?)'" SERIE_PATTERN = r".*Serie.*" - + def decrypt(self, pyfile): src = self.req.load(str(pyfile.url)) pattern = re.compile(self.VALUES_PATTERN, re.DOTALL) data = json_loads(re.search(pattern, src).group(1)) - + # Get package info links = [] Showname = re.search(self.SHOW_PATTERN, src) @@ -55,7 +58,7 @@ class C1neonCom(Crypter): Showname = Showname.group(1).decode("utf-8") else: Showname = self.pyfile.package().name - + if re.search(self.SERIE_PATTERN, src): for Season in data: self.logDebug("Season " + Season) @@ -63,21 +66,22 @@ class C1neonCom(Crypter): self.logDebug("Episode " + Episode) links.extend(self.getpreferred(data[Season][Episode])) if self.getConfig("changeNameS") == "Episode": - self.packages.append((data[Season][Episode]['info']['name'].split("»")[0], links, data[Season][Episode]['info']['name'].split("»")[0])) + self.packages.append((data[Season][Episode]['info']['name'].split("»")[0], links, + data[Season][Episode]['info']['name'].split("»")[0])) links = [] - - if self.getConfig("changeNameS") == "Season": + + if self.getConfig("changeNameS") == "Season": self.packages.append((Showname + " Season " + Season, links, Showname + " Season " + Season)) links = [] if self.getConfig("changeNameS") == "Show": - if links == []: + if links == []: self.fail('Could not extract any links (Out of Date?)') else: self.packages.append((Showname, links, Showname)) - + elif self.getConfig("changeNameS") == "Packagename": - if links == []: + if links == []: self.fail('Could not extract any links (Out of Date?)') else: self.core.files.addLinks(links, self.pyfile.package().id) @@ -85,13 +89,13 @@ class C1neonCom(Crypter): for Movie in data: links.extend(self.getpreferred(data[Movie])) if self.getConfig("changeName") == "Movie": - if links == []: + if links == []: self.fail('Could not extract any links (Out of Date?)') else: self.packages.append((Showname, links, Showname)) - + elif self.getConfig("changeName") == "Packagename": - if links == []: + if links == []: self.fail('Could not extract any links (Out of Date?)') else: self.core.files.addLinks(links, self.pyfile.package().id) @@ -106,28 +110,27 @@ class C1neonCom(Crypter): hosterlist.update(hosterslist['d']) if self.getConfig("useStreams") and 's' in hosterslist: hosterlist.update(hosterslist['s']) - + result = [] - preferredList = self.getConfig("hosterList").strip().lower().replace('|',',').replace('.','').replace(';',',').split(',') + preferredList = self.getConfig("hosterList").strip().lower().replace( + '|',',').replace('.', '').replace(';', ',').split(',') if self.getConfig("randomPreferred") == True: random.shuffle(preferredList) for preferred in preferredList: for Hoster in hosterlist: - if preferred == Hoster.split('<')[0].strip().lower().replace('.',''): + if preferred == Hoster.split('<')[0].strip().lower().replace('.', ''): for Part in hosterlist[Hoster]: self.logDebug("selected " + Part[3]) result.append(str(Part[3])) return result - ignorelist = self.getConfig("ignoreList").strip().lower().replace('|',',').replace('.','').replace(';',',').split(',') + ignorelist = self.getConfig("ignoreList").strip().lower().replace( + '|', ',').replace('.', '').replace(';', ',').split( ',') if self.getConfig('hosterListMode') == "all": for Hoster in hosterlist: - if Hoster.split('<')[0].strip().lower().replace('.','') not in ignorelist: + if Hoster.split('<')[0].strip().lower().replace('.', '') not in ignorelist: for Part in hosterlist[Hoster]: self.logDebug("selected " + Part[3]) result.append(str(Part[3])) return result return result - - - diff --git a/module/plugins/crypter/CrockoComFolder.py b/module/plugins/crypter/CrockoComFolder.py index d727ec7ab..ffa8039a1 100644 --- a/module/plugins/crypter/CrockoComFolder.py +++ b/module/plugins/crypter/CrockoComFolder.py @@ -2,6 +2,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter + class CrockoComFolder(SimpleCrypter): __name__ = "CrockoComFolder" __type__ = "crypter" diff --git a/module/plugins/crypter/CryptItCom.py b/module/plugins/crypter/CryptItCom.py index 4935758c7..08ae1cac5 100644 --- a/module/plugins/crypter/CryptItCom.py +++ b/module/plugins/crypter/CryptItCom.py @@ -16,7 +16,7 @@ class CryptItCom(Crypter): __description__ = """Crypt.It.com Container Plugin""" __author_name__ = ("jeix") __author_mail__ = ("jeix@hasnomail.de") - + def file_exists(self): html = self.load(self.pyfile.url) if r'
    Was ist Crypt-It
    ' in html: @@ -31,7 +31,7 @@ class CryptItCom(Crypter): repl_pattern = r"/(s|e|d|c)/" url = re.sub(repl_pattern, r"/d/", self.pyfile.url) - pyfile.name = "tmp_cryptit_%s.ccf" % randint(0,1000) + pyfile.name = "tmp_cryptit_%s.ccf" % randint(0, 1000) location = self.download(url) self.packages.append(["Crypt-it Package", [location], "Crypt-it Package"]) diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index c240c6a70..9ccda3ed2 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -3,6 +3,7 @@ import re from module.plugins.Crypter import Crypter + class CzshareComFolder(Crypter): __name__ = "CzshareComFolder" __type__ = "crypter" diff --git a/module/plugins/crypter/DDLMusicOrg.py b/module/plugins/crypter/DDLMusicOrg.py index f7cc996d0..822addca1 100644 --- a/module/plugins/crypter/DDLMusicOrg.py +++ b/module/plugins/crypter/DDLMusicOrg.py @@ -6,6 +6,7 @@ from time import sleep from module.plugins.Crypter import Crypter + class DDLMusicOrg(Crypter): __name__ = "DDLMusicOrg" __type__ = "container" @@ -17,24 +18,26 @@ class DDLMusicOrg(Crypter): def setup(self): self.multiDL = False - + def decrypt(self, pyfile): html = self.req.load(self.pyfile.url, cookies=True) - + if re.search(r"Wer dies nicht rechnen kann", html) is not None: self.offline() - + math = re.search(r"(\d+) ([\+-]) (\d+) =\s+", htmlwithlink) if m: self.packages.append((self.pyfile.package().name, [m.group(1)], self.pyfile.package().folder)) diff --git a/module/plugins/crypter/DepositfilesComFolder.py b/module/plugins/crypter/DepositfilesComFolder.py index 9023b238f..15c317acf 100644 --- a/module/plugins/crypter/DepositfilesComFolder.py +++ b/module/plugins/crypter/DepositfilesComFolder.py @@ -2,6 +2,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter + class DepositfilesComFolder(SimpleCrypter): __name__ = "DepositfilesComFolder" __type__ = "crypter" @@ -11,4 +12,4 @@ class DepositfilesComFolder(SimpleCrypter): __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - LINK_PATTERN = r'
    ]*>\s*' \ No newline at end of file + LINK_PATTERN = r'
    ]*>\s*' diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py index 584835e18..7b7c34fee 100644 --- a/module/plugins/crypter/Dereferer.py +++ b/module/plugins/crypter/Dereferer.py @@ -20,6 +20,7 @@ import urllib from module.plugins.Crypter import Crypter + class Dereferer(Crypter): __name__ = "Dereferer" __type__ = "crypter" @@ -31,4 +32,4 @@ class Dereferer(Crypter): def decrypt(self, pyfile): link = re.match(self.__pattern__, self.pyfile.url).group('url') - self.core.files.addLinks([ urllib.unquote(link).rstrip('+') ], self.pyfile.package().id) + self.core.files.addLinks([urllib.unquote(link).rstrip('+')], self.pyfile.package().id) diff --git a/module/plugins/crypter/DontKnowMe.py b/module/plugins/crypter/DontKnowMe.py index dfa72df47..0791e3c22 100644 --- a/module/plugins/crypter/DontKnowMe.py +++ b/module/plugins/crypter/DontKnowMe.py @@ -5,6 +5,7 @@ import urllib from module.plugins.Crypter import Crypter + class DontKnowMe(Crypter): __name__ = "DontKnowMe" __type__ = "crypter" @@ -18,4 +19,4 @@ class DontKnowMe(Crypter): def decrypt(self, pyfile): link = re.findall(self.LINK_PATTERN, self.pyfile.url)[0] - self.core.files.addLinks([ urllib.unquote(link) ], self.pyfile.package().id) + self.core.files.addLinks([urllib.unquote(link)], self.pyfile.package().id) diff --git a/module/plugins/crypter/DownloadVimeoCom.py b/module/plugins/crypter/DownloadVimeoCom.py index 88310915b..562672599 100644 --- a/module/plugins/crypter/DownloadVimeoCom.py +++ b/module/plugins/crypter/DownloadVimeoCom.py @@ -5,26 +5,27 @@ import re import HTMLParser from module.plugins.Crypter import Crypter + class DownloadVimeoCom(Crypter): - __name__ = 'DownloadVimeoCom' - __type__ = 'crypter' - __pattern__ = r'(?:http://vimeo\.com/\d*|http://smotri\.com/video/view/\?id=.*)' - ## The download from dailymotion failed with a 403 - __version__ = '0.1' - __description__ = """Video Download Plugin based on downloadvimeo.com""" - __author_name__ = ('4Christopher') - __author_mail__ = ('4Christopher@gmx.de') - BASE_URL = 'http://downloadvimeo.com' + __name__ = 'DownloadVimeoCom' + __type__ = 'crypter' + __pattern__ = r'(?:http://vimeo\.com/\d*|http://smotri\.com/video/view/\?id=.*)' + ## The download from dailymotion failed with a 403 + __version__ = '0.1' + __description__ = """Video Download Plugin based on downloadvimeo.com""" + __author_name__ = ('4Christopher') + __author_mail__ = ('4Christopher@gmx.de') + BASE_URL = 'http://downloadvimeo.com' - def decrypt(self, pyfile): - self.package = pyfile.package() - html = self.load('%s/generate?url=%s' % (self.BASE_URL, pyfile.url)) - h = HTMLParser.HTMLParser() - try: - f = re.search(r'cmd quality="(?P[^"]+?)">\s*?(?P[^<]*?)', html) - except: - self.logDebug('Failed to find the URL') - else: - url = h.unescape(f.group('URL')) - self.logDebug('Quality: %s, URL: %s' % (f.group('quality'), url)) - self.packages.append((self.package.name, [url], self.package.folder)) + def decrypt(self, pyfile): + self.package = pyfile.package() + html = self.load('%s/generate?url=%s' % (self.BASE_URL, pyfile.url)) + h = HTMLParser.HTMLParser() + try: + f = re.search(r'cmd quality="(?P[^"]+?)">\s*?(?P[^<]*?)', html) + except: + self.logDebug('Failed to find the URL') + else: + url = h.unescape(f.group('URL')) + self.logDebug('Quality: %s, URL: %s' % (f.group('quality'), url)) + self.packages.append((self.package.name, [url], self.package.folder)) diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 4886d24db..64302c800 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -4,6 +4,7 @@ import re from module.lib.BeautifulSoup import BeautifulSoup from module.plugins.Crypter import Crypter + class DuckCryptInfo(Crypter): __name__ = "DuckCryptInfo" __type__ = "container" @@ -14,7 +15,7 @@ class DuckCryptInfo(Crypter): __author_mail__ = ("soilfiction@gmail.com") TIMER_PATTERN = r'(.*)' - + def decrypt(self, pyfile): url = pyfile.url # seems we don't need to wait @@ -31,10 +32,9 @@ class DuckCryptInfo(Crypter): else: self.handleFolder(found) - - + def handleFolder(self, found): - src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2))) + src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2))) found = re.search(self.__pattern__, src) self.logDebug("Redirectet to " + str(found.group(0))) src = self.load(str(found.group(0))) @@ -55,4 +55,3 @@ class DuckCryptInfo(Crypter): self.logDebug('no links found - (Plugin out of date?)') else: self.core.files.addLinks([link], self.pyfile.package().id) - diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py index 8fd70882f..122c0f671 100644 --- a/module/plugins/crypter/EmbeduploadCom.py +++ b/module/plugins/crypter/EmbeduploadCom.py @@ -4,6 +4,7 @@ import re from module.plugins.Crypter import Crypter from module.network.HTTPRequest import BadHeader + class EmbeduploadCom(Crypter): __name__ = "EmbeduploadCom" __type__ = "crypter" @@ -11,7 +12,7 @@ class EmbeduploadCom(Crypter): __version__ = "0.02" __description__ = """EmbedUpload.com crypter""" __config__ = [("preferedHoster", "str", "Prefered hoster list (bar-separated) ", "embedupload"), - ("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")] + ("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")] __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -19,9 +20,9 @@ class EmbeduploadCom(Crypter): def decrypt(self, pyfile): self.html = self.load(self.pyfile.url, decode=True) - tmp_links = [] + tmp_links = [] new_links = [] - + found = re.findall(self.LINK_PATTERN, self.html) if found: prefered_set = set(self.getConfig("preferedHoster").split('|')) @@ -33,22 +34,20 @@ class EmbeduploadCom(Crypter): if not new_links: ignored_set = set(self.getConfig("ignoredHoster").split('|')) ignored_set = map(lambda s: s.lower().split('.')[0], ignored_set) - print "IG", ignored_set - tmp_links.extend([x[1] for x in found if x[0] not in ignored_set]) + print "IG", ignored_set + tmp_links.extend([x[1] for x in found if x[0] not in ignored_set]) self.getLocation(tmp_links, new_links) if new_links: self.core.files.addLinks(new_links, self.pyfile.package().id) else: self.fail('Could not extract any links') - + def getLocation(self, tmp_links, new_links): for link in tmp_links: try: - header = self.load(link, just_header = True) - if "location" in header: + header = self.load(link, just_header=True) + if "location" in header: new_links.append(header['location']) except BadHeader: pass - - \ No newline at end of file diff --git a/module/plugins/crypter/FilebeerInfoFolder.py b/module/plugins/crypter/FilebeerInfoFolder.py index f45144f14..86ce5b697 100644 --- a/module/plugins/crypter/FilebeerInfoFolder.py +++ b/module/plugins/crypter/FilebeerInfoFolder.py @@ -3,6 +3,7 @@ import re from module.plugins.Crypter import Crypter + class FilebeerInfoFolder(Crypter): __name__ = "FilebeerInfoFolder" __type__ = "crypter" @@ -14,22 +15,22 @@ class FilebeerInfoFolder(Crypter): LINK_PATTERN = r'' PAGE_COUNT_PATTERN = r'

    \s*Total Pages (\d+)' - - def decrypt(self, pyfile): - pyfile.url = re.sub(self.__pattern__, r'http://filebeer.info/\1?page=1', pyfile.url) + + def decrypt(self, pyfile): + pyfile.url = re.sub(self.__pattern__, r'http://filebeer.info/\1?page=1', pyfile.url) html = self.load(pyfile.url) - + page_count = int(re.search(self.PAGE_COUNT_PATTERN, html).group(1)) new_links = [] - - for i in range(1, page_count + 1): - self.logInfo("Fetching links from page %i" % i) + + for i in range(1, page_count + 1): + self.logInfo("Fetching links from page %i" % i) new_links.extend(re.findall(self.LINK_PATTERN, html)) - + if i < page_count: - html = self.load("%s?page=%d" % (pyfile.url, i+1)) + html = self.load("%s?page=%d" % (pyfile.url, i + 1)) if new_links: self.core.files.addLinks(new_links, self.pyfile.package().id) else: - self.fail('Could not extract any links') \ No newline at end of file + self.fail('Could not extract any links') diff --git a/module/plugins/crypter/FilefactoryComFolder.py b/module/plugins/crypter/FilefactoryComFolder.py index 32793b491..64b8ac37e 100644 --- a/module/plugins/crypter/FilefactoryComFolder.py +++ b/module/plugins/crypter/FilefactoryComFolder.py @@ -3,6 +3,7 @@ import re from module.plugins.Crypter import Crypter + class FilefactoryComFolder(Crypter): __name__ = "FilefactoryComFolder" __type__ = "crypter" @@ -22,7 +23,7 @@ class FilefactoryComFolder(Crypter): html = self.load(url_base) new_links = [] - for i in range(1,100): + for i in range(1, 100): self.logInfo("Fetching links from page %i" % i) found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) if found is None: self.fail("Parse error (FOLDER)") @@ -41,4 +42,4 @@ class FilefactoryComFolder(Crypter): if new_links: self.core.files.addLinks(new_links, self.pyfile.package().id) else: - self.fail('Could not extract any links') \ No newline at end of file + self.fail('Could not extract any links') diff --git a/module/plugins/crypter/FileserveComFolder.py b/module/plugins/crypter/FileserveComFolder.py index 9fe806971..42481c15e 100644 --- a/module/plugins/crypter/FileserveComFolder.py +++ b/module/plugins/crypter/FileserveComFolder.py @@ -4,6 +4,7 @@ import re from module.plugins.Crypter import Crypter + class FileserveComFolder(Crypter): __name__ = "FileserveComFolder" __type__ = "crypter" @@ -27,6 +28,6 @@ class FileserveComFolder(Crypter): new_links.extend(re.findall(self.LINK_PATTERN, folder.group(1))) if new_links: - self.core.files.addLinks(map(lambda s:"http://fileserve.com%s" % s, new_links), self.pyfile.package().id) + self.core.files.addLinks(map(lambda s: "http://fileserve.com%s" % s, new_links), self.pyfile.package().id) else: - self.fail('Could not extract any links') \ No newline at end of file + self.fail('Could not extract any links') diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py index 5c96e723d..700a09b97 100644 --- a/module/plugins/crypter/FourChanOrg.py +++ b/module/plugins/crypter/FourChanOrg.py @@ -5,6 +5,7 @@ import re from module.plugins.Crypter import Crypter + class FourChanOrg(Crypter): # Based on 4chandl by Roland Beermann # https://gist.github.com/enkore/3492599 diff --git a/module/plugins/crypter/FshareVnFolder.py b/module/plugins/crypter/FshareVnFolder.py index 2515e7edd..2d7a3c490 100644 --- a/module/plugins/crypter/FshareVnFolder.py +++ b/module/plugins/crypter/FshareVnFolder.py @@ -2,6 +2,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter + class FshareVnFolder(SimpleCrypter): __name__ = "FshareVnFolder" __type__ = "crypter" @@ -11,4 +12,4 @@ class FshareVnFolder(SimpleCrypter): __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - LINK_PATTERN = r'

  • ' \ No newline at end of file + LINK_PATTERN = r'
  • ' diff --git a/module/plugins/crypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py index 4c26ba7f7..f8cb18b19 100644 --- a/module/plugins/crypter/HoerbuchIn.py +++ b/module/plugins/crypter/HoerbuchIn.py @@ -6,6 +6,7 @@ import re from module.plugins.Crypter import Crypter from module.lib.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup + class HoerbuchIn(Crypter): __name__ = "HoerbuchIn" __type__ = "container" @@ -14,42 +15,42 @@ class HoerbuchIn(Crypter): __description__ = """Hoerbuch.in Container Plugin""" __author_name__ = ("spoob", "mkaay") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de") - + article = re.compile("http://(www\.)?hoerbuch\.in/wp/horbucher/\d+/.+/") protection = re.compile("http://(www\.)?hoerbuch\.in/protection/folder_\d+.html") def decrypt(self, pyfile): self.pyfile = pyfile - + if self.article.match(self.pyfile.url): src = self.load(self.pyfile.url) soup = BeautifulSoup(src, convertEntities=BeautifulStoneSoup.HTML_ENTITIES) - + abookname = soup.find("a", attrs={"rel": "bookmark"}).text for a in soup.findAll("a", attrs={"href": self.protection}): package = "%s (%s)" % (abookname, a.previousSibling.previousSibling.text[:-1]) links = self.decryptFolder(a["href"]) - + self.packages.append((package, links, self.pyfile.package().folder)) else: links = self.decryptFolder(self.pyfile.url) - + self.packages.append((self.pyfile.package().name, links, self.pyfile.package().folder)) - + def decryptFolder(self, url): m = self.protection.search(url) if not m: self.fail("Bad URL") url = m.group(0) - + self.pyfile.url = url src = self.req.load(url, post={"viewed": "adpg"}) - + links = [] pattern = re.compile("http://www\.hoerbuch\.in/protection/(\w+)/(.*?)\"") for hoster, lid in pattern.findall(src): self.req.lastURL = url self.load("http://www.hoerbuch.in/protection/%s/%s" % (hoster, lid)) links.append(self.req.lastEffectiveURL) - + return links diff --git a/module/plugins/crypter/HotfileFolderCom.py b/module/plugins/crypter/HotfileFolderCom.py index 00771e2a3..79691ad01 100644 --- a/module/plugins/crypter/HotfileFolderCom.py +++ b/module/plugins/crypter/HotfileFolderCom.py @@ -5,6 +5,7 @@ import re from module.plugins.Crypter import Crypter + class HotfileFolderCom(Crypter): __name__ = "HotfileFolderCom" __type__ = "crypter" @@ -17,9 +18,11 @@ class HotfileFolderCom(Crypter): def decrypt(self, pyfile): html = self.load(pyfile.url) - name = re.findall(r'([^<]+)', html, re.MULTILINE)[0].replace("/", "") + name = re.findall( + r'([^<]+)', html, + re.MULTILINE)[0].replace("/", "") new_links = re.findall(r'href="(http://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+[^"]+)', html) new_links = [x[0] for x in new_links] - self.packages.append((name, new_links, name)) \ No newline at end of file + self.packages.append((name, new_links, name)) diff --git a/module/plugins/crypter/ILoadTo.py b/module/plugins/crypter/ILoadTo.py index 100ba2bc6..61869fdc0 100644 --- a/module/plugins/crypter/ILoadTo.py +++ b/module/plugins/crypter/ILoadTo.py @@ -1,10 +1,10 @@ - import re import urllib from module.plugins.Crypter import Crypter from module.lib.BeautifulSoup import BeautifulSoup + class ILoadTo(Crypter): __name__ = "ILoadTo" __type__ = "crypter" @@ -14,8 +14,8 @@ class ILoadTo(Crypter): __description__ = """iload.to Crypter Plugin""" __author_name__ = ("hzpz") __author_mail__ = ("none") - - + + def decrypt(self, pyfile): url = pyfile.url src = self.req.load(str(url)) @@ -34,19 +34,21 @@ class ILoadTo(Crypter): formTag = soup.find("form", attrs={"id": "CaptchaForm"}) formUrl = "http://iload.to" + formTag["action"] self.logDebug("Form URL: %s" % formUrl) - + # submit decrypted captcha self.req.lastURL = url src = self.req.load(str(formUrl), post={'captcha': result}) - + # find decrypted links - links = re.findall(r"", src) - + links = re.findall( + r"", + src) + if not len(links) > 0: self.retry() - + self.correctCaptcha() - + cleanedLinks = [] for link in links: if link.startswith("http://dontknow.me/at/?"): @@ -55,8 +57,8 @@ class ILoadTo(Crypter): cleanedLink = link self.logDebug("Link: %s" % cleanedLink) cleanedLinks.append(cleanedLink) - + self.logDebug("Decrypted %d links" % len(links)) - + self.pyfile.package().password = "iload.to" - self.packages.append((self.pyfile.package().name, cleanedLinks, self.pyfile.package().folder)) \ No newline at end of file + self.packages.append((self.pyfile.package().name, cleanedLinks, self.pyfile.package().folder)) diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index e021316bf..a73b7cc19 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -6,13 +6,15 @@ # * only best available link source is used (priority: cnl2>rsdf>ccf>dlc>web # -from Crypto.Cipher import AES -from module.plugins.Crypter import Crypter -from module.unescape import unescape import base64 import binascii import re +from Crypto.Cipher import AES +from module.plugins.Crypter import Crypter +from module.unescape import unescape + + class LinkSaveIn(Crypter): __name__ = "LinkSaveIn" __type__ = "crypter" @@ -26,31 +28,31 @@ class LinkSaveIn(Crypter): _JK_KEY_ = "jk" _CRYPTED_KEY_ = "crypted" HOSTER_DOMAIN = "linksave.in" - + def setup(self): self.html = None self.fileid = None self.captcha = False self.package = None self.preferred_sources = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web'] - + def decrypt(self, pyfile): # Init self.package = pyfile.package() self.fileid = re.match(self.__pattern__, pyfile.url).group('id') self.req.cj.setCookie(self.HOSTER_DOMAIN, "Linksave_Language", "english") - + # Request package self.html = self.load(self.pyfile.url) if not self.isOnline(): self.offline() - + # Check for protection if self.isPasswordProtected(): self.unlockPasswordProtection() self.handleErrors() - + if self.isCaptchaProtected(): self.captcha = True self.unlockCaptchaProtection() @@ -78,49 +80,49 @@ class LinkSaveIn(Crypter): self.logDebug("File not found") return False return True - + def isPasswordProtected(self): if re.search(r'''Captcha:" in self.html: self.logDebug("Links are captcha protected") return True return False - + def unlockPasswordProtection(self): password = self.getPassword() self.logDebug("Submitting password [%s] for protected links" % password) post = {"id": self.fileid, "besucherpasswort": password, 'login': 'submit'} self.html = self.load(self.pyfile.url, post=post) - + def unlockCaptchaProtection(self): captcha_hash = re.search(r'name="hash" value="([^"]+)', self.html).group(1) captcha_url = re.search(r'src=".(/captcha/cap.php\?hsh=[^"]+)', self.html).group(1) captcha_code = self.decryptCaptcha("http://linksave.in" + captcha_url, forceUser=True) - self.html = self.load(self.pyfile.url, post={"id": self.fileid, "hash": captcha_hash, "code": captcha_code}) + self.html = self.load(self.pyfile.url, post={"id": self.fileid, "hash": captcha_hash, "code": captcha_code}) def getPackageInfo(self): name = self.pyfile.package().name folder = self.pyfile.package().folder self.logDebug("Defaulting to pyfile name [%s] and folder [%s] for package" % (name, folder)) return name, folder - - def handleErrors(self): + + def handleErrors(self): if "The visitorpassword you have entered is wrong" in self.html: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail("Incorrect password, please set right password on 'Edit package' form and retry") + self.fail("Incorrect password, please set right password on 'Edit package' form and retry") - if self.captcha: + if self.captcha: if "Wrong code. Please retry" in self.html: self.logDebug("Invalid captcha, retrying") self.invalidCaptcha() self.retry() else: self.correctCaptcha() - + def handleLinkSource(self, type_): if type_ == 'cnl2': return self.handleCNL2() @@ -136,15 +138,15 @@ class LinkSaveIn(Crypter): self.logDebug("Search for Web links") if not self.js: self.logDebug("no JS -> skip Web links") - else: - #@TODO: Gather paginated web links + else: + #@TODO: Gather paginated web links pattern = r'(.*)', response)[-1] @@ -155,9 +157,9 @@ class LinkSaveIn(Crypter): link = unescape(re.search(r'", self.req.load("http://1kh.de/l/" + id)).group(1)) + new_link = unescape( + re.search("width=\"100%\" src=\"(.*)\">", self.req.load("http://1kh.de/l/" + id)).group(1)) temp_links.append(new_link) self.links = temp_links diff --git a/module/plugins/crypter/OronComFolder.py b/module/plugins/crypter/OronComFolder.py index 57b273163..f6637033b 100755 --- a/module/plugins/crypter/OronComFolder.py +++ b/module/plugins/crypter/OronComFolder.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- -import re +import re from module.plugins.Crypter import Crypter + class OronComFolder(Crypter): __name__ = "OronComFolder" __type__ = "crypter" @@ -22,10 +23,11 @@ class OronComFolder(Crypter): new_links = [] folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if folder is None: self.fail("Parse error (FOLDER)") - + if folder is None: + self.fail("Parse error (FOLDER)") + new_links.extend(re.findall(self.LINK_PATTERN, folder.group(0))) - + if new_links: self.core.files.addLinks(new_links, self.pyfile.package().id) else: diff --git a/module/plugins/crypter/QuickshareCzFolder.py b/module/plugins/crypter/QuickshareCzFolder.py index 6cb049935..18ac68eec 100644 --- a/module/plugins/crypter/QuickshareCzFolder.py +++ b/module/plugins/crypter/QuickshareCzFolder.py @@ -3,6 +3,7 @@ import re from module.plugins.Crypter import Crypter + class QuickshareCzFolder(Crypter): __name__ = "QuickshareCzFolder" __type__ = "crypter" @@ -12,16 +13,16 @@ class QuickshareCzFolder(Crypter): __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - FOLDER_PATTERN = r']*>(.*?)' LINK_PATTERN = r'(http://www.quickshare.cz/\S+)' def decrypt(self, pyfile): html = self.load(self.pyfile.url) - new_links = [] + new_links = [] found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: self.fail("Parse error (FOLDER)") + if found is None: + self.fail("Parse error (FOLDER)") new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) if new_links: diff --git a/module/plugins/crypter/RSLayerCom.py b/module/plugins/crypter/RSLayerCom.py index 6e4266f2e..6a1f86657 100644 --- a/module/plugins/crypter/RSLayerCom.py +++ b/module/plugins/crypter/RSLayerCom.py @@ -7,6 +7,7 @@ from module.plugins.Crypter import Crypter from module.lib.BeautifulSoup import BeautifulSoup from module.unescape import unescape + class RSLayerCom(Crypter): __name__ = "RSLayerCom" __type__ = "container" diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 8f29a9158..104968e06 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- -from Crypto.Cipher import AES -from module.plugins.Crypter import Crypter import base64 import binascii import re import os +from Crypto.Cipher import AES +from module.plugins.Crypter import Crypter + class RelinkUs(Crypter): __name__ = "RelinkUs" @@ -27,45 +28,44 @@ class RelinkUs(Crypter): CAPTCHA_TOKEN = "container_captcha.php" CAPTCHA_ERROR_ROKEN = "You have solved the captcha wrong" CAPTCHA_IMG_URL = "http://www.relink.us/core/captcha/circlecaptcha.php" - CAPTCHA_SUBMIT_URL = "http://www.relink.us/container_captcha.php" + CAPTCHA_SUBMIT_URL = "http://www.relink.us/container_captcha.php" FILE_TITLE_REGEX = r"Title(.*)" FILE_NOTITLE = 'No title' - + CNL2_FORM_REGEX = r'
    ' - DLC_DOWNLOAD_URL = "http://www.relink.us/download.php" - WEB_FORWARD_REGEX = r"getFile\('(?P.+)'\)"; - WEB_FORWARD_URL = "http://www.relink.us/frame.php" + DLC_DOWNLOAD_URL = "http://www.relink.us/download.php" + WEB_FORWARD_REGEX = r"getFile\('(?P.+)'\)" + WEB_FORWARD_URL = "http://www.relink.us/frame.php" WEB_LINK_REGEX = r'' - - + def setup(self): self.fileid = None self.package = None self.password = None self.html = None self.captcha = False - + def decrypt(self, pyfile): # Init self.initPackage(pyfile) - + # Request package self.requestPackage() - + # Check for online if not self.isOnline(): self.offline() - + # Check for protection if self.isPasswordProtected(): self.unlockPasswordProtection() self.handleErrors() - + if self.isCaptchaProtected(): self.captcha = True self.unlockCaptchaProtection() @@ -95,38 +95,38 @@ class RelinkUs(Crypter): self.url = pyfile.url def requestPackage(self): - self.html = self.load(self.url, decode = True) + self.html = self.load(self.url, decode=True) def isOnline(self): if self.OFFLINE_TOKEN in self.html: self.logDebug("File not found") return False return True - + def isPasswordProtected(self): if self.PASSWORD_TOKEN in self.html: self.logDebug("Links are password protected") return True - + def isCaptchaProtected(self): if self.CAPTCHA_TOKEN in self.html: self.logDebug("Links are captcha protected") return True return False - + def unlockPasswordProtection(self): self.logDebug("Submitting password [%s] for protected links" % self.password) passwd_url = self.PASSWORD_SUBMIT_URL + "?id=%s" % self.fileid - passwd_data = { 'id': self.fileid, 'password': self.password, 'pw': 'submit' } + passwd_data = {'id': self.fileid, 'password': self.password, 'pw': 'submit'} self.html = self.load(passwd_url, post=passwd_data, decode=True) - + def unlockCaptchaProtection(self): self.logDebug("Request user positional captcha resolving") captcha_img_url = self.CAPTCHA_IMG_URL + "?id=%s" % self.fileid coords = self.decryptCaptcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') self.logDebug("Captcha resolved, coords [%s]" % str(coords)) captcha_post_url = self.CAPTCHA_SUBMIT_URL + "?id=%s" % self.fileid - captcha_post_data = { 'button.x': coords[0], 'button.y': coords[1], 'captcha': 'submit' } + captcha_post_data = {'button.x': coords[0], 'button.y': coords[1], 'captcha': 'submit'} self.html = self.load(captcha_post_url, post=captcha_post_data, decode=True) def getPackageInfo(self): @@ -139,30 +139,30 @@ class RelinkUs(Crypter): if not self.FILE_NOTITLE in title: name = folder = title self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) - + # Fallback to defaults if not name or not folder: name = self.package.name folder = self.package.folder self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) - + # Return package info - return name, folder - - def handleErrors(self): + return name, folder + + def handleErrors(self): if self.PASSWORD_ERROR_ROKEN in self.html: msg = "Incorrect password, please set right password on 'Edit package' form and retry" self.logDebug(msg) - self.fail(msg) + self.fail(msg) - if self.captcha: + if self.captcha: if self.CAPTCHA_ERROR_ROKEN in self.html: self.logDebug("Invalid captcha, retrying") self.invalidCaptcha() self.retry() else: self.correctCaptcha() - + def handleLinkSource(self, source): if source == 'cnl2': return self.handleCNL2Links() @@ -172,7 +172,7 @@ class RelinkUs(Crypter): return self.handleWEBLinks() else: self.fail('Unknown source [%s] (this is probably a bug)' % source) - + def handleCNL2Links(self): self.logDebug("Search for CNL2 links") package_links = [] @@ -186,13 +186,13 @@ class RelinkUs(Crypter): except: self.logDebug("Unable to decrypt CNL2 links") return package_links - + def handleDLCLinks(self): self.logDebug('Search for DLC links') package_links = [] m = re.search(self.DLC_LINK_REGEX, self.html) if m is not None: - container_url = self.DLC_DOWNLOAD_URL + "?id=%s&dlc=1" % self.fileid + container_url = self.DLC_DOWNLOAD_URL + "?id=%s&dlc=1" % self.fileid self.logDebug("Downloading DLC container link [%s]" % container_url) try: dlc = self.load(container_url) @@ -203,7 +203,7 @@ class RelinkUs(Crypter): f.close() package_links.append(dlc_filepath) except: - self.logDebug("Unable to download DLC container") + self.logDebug("Unable to download DLC container") return package_links def handleWEBLinks(self): @@ -214,7 +214,7 @@ class RelinkUs(Crypter): for index, fw_param in enumerate(fw_params): try: fw_url = self.WEB_FORWARD_URL + "?%s" % fw_param - self.logDebug("Decrypting Web link %d, %s" % (index+1, fw_url)) + self.logDebug("Decrypting Web link %d, %s" % (index + 1, fw_url)) fw_response = self.load(fw_url, decode=True) dl_link = re.search(self.WEB_LINK_REGEX, fw_response).group('link') package_links.append(dl_link) @@ -223,15 +223,15 @@ class RelinkUs(Crypter): self.setWait(4) self.wait() return package_links - + def _getCipherParams(self, cnl2_form): - + # Get jk - jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY + jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY vjk = re.findall(jk_re, cnl2_form, re.IGNORECASE) - + # Get crypted - crypted_re = self.CNL2_FORMINPUT_REGEX % RelinkUs.CNL2_CRYPTED_KEY + crypted_re = self.CNL2_FORMINPUT_REGEX % RelinkUs.CNL2_CRYPTED_KEY vcrypted = re.findall(crypted_re, cnl2_form, re.IGNORECASE) # Log and return diff --git a/module/plugins/crypter/SecuredIn.py b/module/plugins/crypter/SecuredIn.py index e41896c5f..7c0b27c8b 100644 --- a/module/plugins/crypter/SecuredIn.py +++ b/module/plugins/crypter/SecuredIn.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- import re +from math import ceil from module.plugins.Crypter import Crypter from module.lib.BeautifulSoup import BeautifulSoup -from math import ceil class SecuredIn(Crypter): __name__ = "SecuredIn" @@ -15,39 +15,40 @@ class SecuredIn(Crypter): __description__ = """secured.in Container Plugin""" __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - + def __init__(self, parent): Crypter.__init__(self, parent) self.parent = parent self.html = None self.multi_dl = False - + def file_exists(self): return True - + def proceed(self, url, location): links = [] ajaxUrl = "http://secured.in/ajax-handler.php" src = self.req.load(url, cookies=True) soup = BeautifulSoup(src) - img = soup.find("img", attrs={"id":"captcha_img"}) + img = soup.find("img", attrs={"id": "captcha_img"}) for i in range(3): - form = soup.find("form", attrs={"id":"frm_captcha"}) - captchaHash = form.find("input", attrs={"id":"captcha_hash"})["value"] + form = soup.find("form", attrs={"id": "frm_captcha"}) + captchaHash = form.find("input", attrs={"id": "captcha_hash"})["value"] captchaUrl = "http://secured.in/%s" % img["src"] captchaData = self.req.load(str(captchaUrl), cookies=True) result = self.waitForCaptcha(captchaData, "jpg") - src = self.req.load(url, cookies=True, post={"captcha_key":result, "captcha_hash":captchaHash}) + src = self.req.load(url, cookies=True, post={"captcha_key": result, "captcha_hash": captchaHash}) soup = BeautifulSoup(src) - img = soup.find("img", attrs={"id":"captcha_img"}) + img = soup.find("img", attrs={"id": "captcha_img"}) if not img: - files = soup.findAll("tr", attrs={"id":re.compile("file-\d+")}) + files = soup.findAll("tr", attrs={"id": re.compile("file-\d+")}) dlIDPattern = re.compile("accessDownload\(\d, \d+, '(.*?)', \d\)") cypher = self.Cypher() for cfile in files: m = dlIDPattern.search(cfile["onclick"]) if m: - crypted = self.req.load(ajaxUrl, cookies=True, post={"cmd":"download", "download_id":m.group(1)}) + crypted = self.req.load(ajaxUrl, cookies=True, + post={"cmd": "download", "download_id": m.group(1)}) cypher.reset() link = cypher.cypher(crypted) links.append(link) @@ -57,37 +58,61 @@ class SecuredIn(Crypter): class Cypher(): def __init__(self): self.reset() - + def reset(self): self.iatwbfrd = [ - 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, - 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, - 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, - 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, - 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, - 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, - 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, - 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, - 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, - 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, - 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, - 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, - 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, - 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, - 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, - 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, - 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, - 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, - 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, - 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, - 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, - 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, - 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, + 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, + 0x82154aee, 0x7b54a41d, 0xc25a59b5, + 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, + 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, + 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, + 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, + 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, + 0x5dec8032, 0xef845d5d, 0xe98575b1, + 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, + 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, + 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, + 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, + 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, + 0x49f1c09b, 0x075372c9, 0x80991b7b, + 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, + 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, + 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, + 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, + 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, + 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, + 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, + 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, + 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, + 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, + 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, + 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, + 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, + 0x7cc43b81, 0xd2ada8d9, 0x165fa266, + 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, + 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, + 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, + 0x9a532915, 0xd60f573f, 0xbc9bc6e4, + 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, + 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a ] self.olkemfjq = [ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b ] @@ -98,88 +123,157 @@ class SecuredIn(Crypter): self.ldiwkqly = 0 self.plkodnyq = [ - 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, - 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, - 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, - 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, - 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, - 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, - 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, - 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, - 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, - 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, - 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, - 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, - 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, - 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, - 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, - 0xc6913667, 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, - 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, - 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, - 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, - 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, - 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, - 0xcd769c2b, 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, - 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, + 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, + 0x6549c2c8, 0x530ff8ee, 0x468dde7d, + 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, + 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, + 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, + 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, + 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, + 0x5a88f54c, 0xe029ac71, 0xe019a5e6, + 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, + 0xf7960e44, 0xe3d35e8c, 0x15056dd4, + 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, + 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, + 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, + 0x6413e680, 0xa2ae0810, 0xdd6db224, + 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, + 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, + 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, + 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, + 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, + 0x344525bd, 0xa08839e1, 0x51ce794b, + 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, + 0xd0dadecb, 0xd50ada38, 0x0339c32a, + 0xc6913667, 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, + 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, + 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, + 0xc37632d8, 0xdf359f8d, 0x9b992f2e, + 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, + 0x848fd2c5, 0xf6fb2299, 0xf523f357, + 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, + 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, + 0xcd769c2b, 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, + 0x20756060, 0x85cbfe4e, 0x8ae88dd8, + 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, + 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 ] self.pnjzokye = None self.thdlpsmy = [ - 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, - 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, - 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, - 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, - 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, - 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, - 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, - 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, - 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, - 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, - 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, - 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, - 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, - 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, - 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, - 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, - 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, - 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, - 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, - 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, - 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, - 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, - 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, + 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, + 0x66a02f45, 0xbfbc09ec, 0x03bd9785, + 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, + 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, + 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, + 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, + 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, + 0xd096954b, 0x55a867bc, 0xa1159a58, + 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, + 0x80bb155c, 0x05282ce3, 0x95c11548, + 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, + 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, + 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, + 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, + 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, + 0x991be14c, 0xdb6e6b0d, 0xc67b5510, + 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, + 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, + 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, + 0xe2e1c3c9, 0x44421659, 0x0a121386, + 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, + 0x60787bf8, 0x6003604d, 0xd1fd8346, + 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, + 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, + 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, + 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, + 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, + 0xa186f20f, 0x2868f169, 0xdcb7da83, + 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, + 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, + 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, + 0xd39eb8fc, 0xed545578, 0x08fca5b5, + 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, + 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 ] self.ybghjtik = [ - 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, - 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, - 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, - 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, - 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, - 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, - 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, - 0x2e6b7124, 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, - 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, - 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, - 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, - 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, - 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, - 0x5b6e2f84, 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, - 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, - 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, - 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, - 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, - 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, - 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, - 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, - 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, - 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, + 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, + 0x99f73fd6, 0xa1d29c07, 0xefe830f5, + 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, + 0x3c971814, 0x6b6a70a1, 0x687f3584, + 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, + 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, + 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, + 0x183eb331, 0x4e548b38, 0x4f6db908, + 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, + 0xb38bae12, 0xdccf3f2e, 0x5512721f, + 0x2e6b7124, 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, + 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, + 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, + 0x1e153c6e, 0x86e34570, 0xeae96fb1, + 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, + 0x2e4cc978, 0x9c10b36a, 0xc6150eba, + 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, + 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, + 0x5b6e2f84, 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, + 0xaa0363cf, 0xb5735c90, 0x4c70a239, + 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, + 0xa02369b9, 0x655abb50, 0x40685a32, + 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, + 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, + 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, 0x42105d14, + 0x203e13e0, 0x45eee2b6, 0xa3aaabea, + 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, + 0xe44b476a, 0x3d816250, 0xcf62a1f2, + 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, + 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, + 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, + 0x800bcadc, 0x9e447a2e, 0xc3453484, + 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, + 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 ] - + def cypher(self, code): return self.lskdqpyr(code, "") @@ -195,7 +289,7 @@ class SecuredIn(Crypter): tzghbndf = lokimyas[1] awsedrft = [None, None] for kiujzhqa in range(8, alokijuh, 8): - lokimyas = self.ylomiktb(alokfmth[kiujzhqa:kiujzhqa+8]) + lokimyas = self.ylomiktb(alokfmth[kiujzhqa:kiujzhqa + 8]) awsedrft[0] = lokimyas[0] awsedrft[1] = lokimyas[1] lokimyas = self.okaqnhlp(lokimyas[0], lokimyas[1]) @@ -210,7 +304,9 @@ class SecuredIn(Crypter): ujhaqylw = 0 for yalmhopr in range(17, 1, -1): lahgrnvp ^= self.ldiwkqly[yalmhopr] - trenlpys ^= (self.oqlaoymh[lahgrnvp >> 24 & 0xff] + self.oqmykrna[lahgrnvp >> 16 & 0xff] ^ self.pqmyzkid[lahgrnvp >> 8 & 0xff]) + self.pldmjnde[lahgrnvp & 0xff] + trenlpys ^= ( + self.oqlaoymh[lahgrnvp >> 24 & 0xff] + self.oqmykrna[lahgrnvp >> 16 & 0xff] ^ self.pqmyzkid[ + lahgrnvp >> 8 & 0xff]) + self.pldmjnde[lahgrnvp & 0xff] ujhaqylw = lahgrnvp lahgrnvp = trenlpys trenlpys = ujhaqylw @@ -263,7 +359,9 @@ class SecuredIn(Crypter): dolizmvw = 0 for iumswkya in range(0, 16): oqlamykt ^= self.ldiwkqly[iumswkya] - yalkionj ^= (self.oqlaoymh[oqlamykt >> 24 & 0xff] + self.oqmykrna[oqlamykt >> 16 & 0xff] ^ self.pqmyzkid[oqlamykt >> 8 & 0xff]) + self.pldmjnde[oqlamykt & 0xff] + yalkionj ^= ( + self.oqlaoymh[oqlamykt >> 24 & 0xff] + self.oqmykrna[oqlamykt >> 16 & 0xff] ^ self.pqmyzkid[ + oqlamykt >> 8 & 0xff]) + self.pldmjnde[oqlamykt & 0xff] dolizmvw = oqlamykt oqlamykt = yalkionj yalkionj = dolizmvw @@ -278,7 +376,8 @@ class SecuredIn(Crypter): loipamyu = len(yoirlkqw) yoirlkqwchar = [] for ymujtnbq in range(0, loipamyu): - yoir = [yoirlkqw[ymujtnbq] >> 24 & 0xff, yoirlkqw[ymujtnbq] >> 16 & 0xff, yoirlkqw[ymujtnbq] >> 8 & 0xff, yoirlkqw[ymujtnbq] & 0xff] + yoir = [yoirlkqw[ymujtnbq] >> 24 & 0xff, yoirlkqw[ymujtnbq] >> 16 & 0xff, + yoirlkqw[ymujtnbq] >> 8 & 0xff, yoirlkqw[ymujtnbq] & 0xff] for c in yoir: yoirlkqwchar.append(chr(c)) return "".join(yoirlkqwchar) @@ -287,7 +386,8 @@ class SecuredIn(Crypter): plokimqw = int(ceil(len(lofiuzmq) / 4.0)) lopkisdq = [] for ypoqlktz in range(0, plokimqw): - lopkisdq.append(ord(lofiuzmq[(ypoqlktz << 2) + 3]) + (ord(lofiuzmq[(ypoqlktz << 2) + 2]) << 8) + (ord(lofiuzmq[(ypoqlktz << 2) + 1]) << 16) + (ord(lofiuzmq[(ypoqlktz << 2)]) << 24)) + lopkisdq.append(ord(lofiuzmq[(ypoqlktz << 2) + 3]) + (ord(lofiuzmq[(ypoqlktz << 2) + 2]) << 8) + ( + ord(lofiuzmq[(ypoqlktz << 2) + 1]) << 16) + (ord(lofiuzmq[(ypoqlktz << 2)]) << 24)) return lopkisdq def yoliukev(self, kaiumylq): @@ -331,4 +431,3 @@ class SecuredIn(Crypter): yalopiuq = self.qmyjuila(yalopiuq[0], yalopiuq[1]) self.pldmjnde[btzqwsay] = yalopiuq[0] self.pldmjnde[btzqwsay + 1] = yalopiuq[1] - diff --git a/module/plugins/crypter/SerienjunkiesOrg.py b/module/plugins/crypter/SerienjunkiesOrg.py index 3fcc12e36..5b720533c 100644 --- a/module/plugins/crypter/SerienjunkiesOrg.py +++ b/module/plugins/crypter/SerienjunkiesOrg.py @@ -7,6 +7,7 @@ from module.plugins.Crypter import Crypter from module.lib.BeautifulSoup import BeautifulSoup from module.unescape import unescape + class SerienjunkiesOrg(Crypter): __name__ = "SerienjunkiesOrg" __type__ = "container" @@ -16,10 +17,12 @@ class SerienjunkiesOrg(Crypter): ("changeNameSJ", "Packagename;Show;Season;Format;Episode", "Take SJ.org name", "Show"), ("changeNameDJ", "Packagename;Show;Format;Episode", "Take DJ.org name", "Show"), ("randomPreferred", "bool", "Randomize Preferred-List", False), - ("hosterListMode", "OnlyOne;OnlyPreferred(One);OnlyPreferred(All);All", "Use for hosters (if supported)", "All"), - ("hosterList", "str", "Preferred Hoster list (comma separated)", "RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom,FreakshareNet,FilebaseTo,HotfileCom,DepositfilesCom,EasyshareCom,KickloadCom"), + ( + "hosterListMode", "OnlyOne;OnlyPreferred(One);OnlyPreferred(All);All", "Use for hosters (if supported)", "All"), + ("hosterList", "str", "Preferred Hoster list (comma separated)", + "RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom,FreakshareNet,FilebaseTo,HotfileCom,DepositfilesCom,EasyshareCom,KickloadCom"), ("ignoreList", "str", "Ignored Hoster list (comma separated)", "MegauploadCom") - ] + ] __description__ = """serienjunkies.org Container Plugin""" __author_name__ = ("mkaay", "godofdream") __author_mail__ = ("mkaay@mkaay.de", "soilfiction@gmail.com") @@ -44,7 +47,7 @@ class SerienjunkiesOrg(Crypter): if self.getConfig("changeNameSJ") == "Show": found = unescape(soup.find("h2").find("a").string.split(' –')[0]) if found: - packageName = found + packageName = found nav = soup.find("div", attrs={"id": "scb"}) @@ -58,7 +61,7 @@ class SerienjunkiesOrg(Crypter): self.packages.append((packageName, package_links, packageName)) else: self.core.files.addLinks(package_links, self.pyfile.package().id) - + def handleSeason(self, url): src = self.getSJSrc(url) @@ -91,15 +94,16 @@ class SerienjunkiesOrg(Crypter): elif re.search("Download:", str(p)): parts = str(p).split("
    ") if re.search("", parts[0]): - ename = re.search('(.*?)',parts[0]).group(1).strip().decode("utf-8").replace("–", "-") + ename = re.search('(.*?)', parts[0]).group(1).strip().decode("utf-8").replace( + "–", "-") groups[gid]["ep"][ename] = {} parts.remove(parts[0]) for part in parts: - hostername = re.search(" \| ([-a-zA-Z0-9]+\.\w+)",part) + hostername = re.search(" \| ([-a-zA-Z0-9]+\.\w+)", part) if hostername: hostername = hostername.group(1) groups[gid]["ep"][ename][hostername] = [] - links = re.findall('href="(.*?)"',part) + links = re.findall('href="(.*?)"', part) for link in links: groups[gid]["ep"][ename][hostername].append(link + "#hasName") @@ -122,7 +126,7 @@ class SerienjunkiesOrg(Crypter): def handleEpisode(self, url): src = self.getSJSrc(url) if not src.find( - "Du hast das Download-Limit überschritten! Bitte versuche es später nocheinmal.") == -1: + "Du hast das Download-Limit überschritten! Bitte versuche es später nocheinmal.") == -1: self.fail(_("Downloadlimit reached")) else: soup = BeautifulSoup(src) @@ -156,7 +160,8 @@ class SerienjunkiesOrg(Crypter): for link in rawLinks: frameUrl = link["action"].replace("/go-", "/frame/go-") links.append(self.handleFrame(frameUrl)) - if re.search("#hasName", url) or ((self.getConfig("changeNameSJ") == "Packagename") and (self.getConfig("changeNameDJ") == "Packagename")): + if re.search("#hasName", url) or ((self.getConfig("changeNameSJ") == "Packagename") and + (self.getConfig("changeNameDJ") == "Packagename")): self.core.files.addLinks(links, self.pyfile.package().id) else: if h1.text[2] == "_": @@ -164,7 +169,6 @@ class SerienjunkiesOrg(Crypter): else: eName = h1.text self.packages.append((eName, links, eName)) - def handleOldStyleLink(self, url): sj = self.req.load(str(url)) @@ -177,7 +181,7 @@ class SerienjunkiesOrg(Crypter): sinp = form.find(attrs={"name": "s"}) self.req.load(str(url), post={'s': sinp["value"], 'c': result, 'dl.start': "Download"}, cookies=False, - just_header=True) + just_header=True) decrypted = self.req.lastEffectiveURL if decrypted == str(url): self.retry() @@ -220,15 +224,16 @@ class SerienjunkiesOrg(Crypter): elif re.search("Download:", str(p)): parts = str(p).split("
    ") if re.search("", parts[0]): - ename = re.search('(.*?)',parts[0]).group(1).strip().decode("utf-8").replace("–", "-") + ename = re.search('(.*?)', parts[0]).group(1).strip().decode("utf-8").replace( + "–", "-") groups[gid]["ep"][ename] = {} parts.remove(parts[0]) for part in parts: - hostername = re.search(" \| ([-a-zA-Z0-9]+\.\w+)",part) + hostername = re.search(" \| ([-a-zA-Z0-9]+\.\w+)", part) if hostername: hostername = hostername.group(1) groups[gid]["ep"][ename][hostername] = [] - links = re.findall('href="(.*?)"',part) + links = re.findall('href="(.*?)"', part) for link in links: groups[gid]["ep"][ename][hostername].append(link + "#hasName") @@ -248,12 +253,6 @@ class SerienjunkiesOrg(Crypter): elif (self.getConfig("changeNameDJ") == "Show") or not re.search("#hasName", url): self.packages.append((seasonName, links, seasonName)) - - - - - - def handleCategoryDJ(self, url): package_links = [] src = self.getSJSrc(url) @@ -289,33 +288,35 @@ class SerienjunkiesOrg(Crypter): #selects the preferred hoster, after that selects any hoster (ignoring the one to ignore) def getpreferred(self, hosterlist): - + result = [] - preferredList = self.getConfig("hosterList").strip().lower().replace('|',',').replace('.','').replace(';',',').split(',') - if (self.getConfig("randomPreferred") == True) and (self.getConfig("hosterListMode") in ["OnlyOne","OnlyPreferred(One)"]) : + preferredList = self.getConfig("hosterList").strip().lower().replace( + '|', ',').replace('.', '').replace(';', ',').split( ',') + if (self.getConfig("randomPreferred") == True) and ( + self.getConfig("hosterListMode") in ["OnlyOne", "OnlyPreferred(One)"]): random.shuffle(preferredList) - # we don't want hosters be read two times + # we don't want hosters be read two times hosterlist2 = hosterlist.copy() - + for preferred in preferredList: for Hoster in hosterlist: - if preferred == Hoster.lower().replace('.',''): + if preferred == Hoster.lower().replace('.', ''): for Part in hosterlist[Hoster]: self.logDebug("selected " + Part) result.append(str(Part)) - del(hosterlist2[Hoster]) - if (self.getConfig("hosterListMode") in ["OnlyOne","OnlyPreferred(One)"]): + del (hosterlist2[Hoster]) + if self.getConfig("hosterListMode") in ["OnlyOne", "OnlyPreferred(One)"]: return result - - - ignorelist = self.getConfig("ignoreList").strip().lower().replace('|',',').replace('.','').replace(';',',').split(',') - if self.getConfig('hosterListMode') in ["OnlyOne","All"]: + + ignorelist = self.getConfig("ignoreList").strip().lower().replace( + '|', ',').replace('.', '').replace(';', ',').split( ',') + if self.getConfig('hosterListMode') in ["OnlyOne", "All"]: for Hoster in hosterlist2: - if Hoster.strip().lower().replace('.','') not in ignorelist: + if Hoster.strip().lower().replace('.', '') not in ignorelist: for Part in hosterlist2[Hoster]: self.logDebug("selected2 " + Part) result.append(str(Part)) - + if self.getConfig('hosterListMode') == "OnlyOne": return result return result diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index b0e735896..252766811 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from Crypto.Cipher import AES -from module.plugins.Crypter import Crypter -from module.plugins.ReCaptcha import ReCaptcha import base64 import binascii import re +from Crypto.Cipher import AES +from module.plugins.Crypter import Crypter + class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz" @@ -16,8 +16,7 @@ class ShareLinksBiz(Crypter): __description__ = """Share-Links.biz Crypter""" __author_name__ = ("fragonib") __author_mail__ = ("fragonib[AT]yahoo[DOT]es") - - + def setup(self): self.baseUrl = None self.fileId = None @@ -29,31 +28,31 @@ class ShareLinksBiz(Crypter): # Init self.initFile(pyfile) - + # Request package url = self.baseUrl + '/' + self.fileId self.html = self.load(url, decode=True) - + # Unblock server (load all images) self.unblockServer() - + # Check for protection if self.isPasswordProtected(): self.unlockPasswordProtection() self.handleErrors() - + if self.isCaptchaProtected(): self.captcha = True self.unlockCaptchaProtection() self.handleErrors() - + # Extract package links package_links = [] package_links.extend(self.handleWebLinks()) package_links.extend(self.handleContainers()) package_links.extend(self.handleCNL2()) package_links = set(package_links) - + # Get package info package_name, package_folder = self.getPackageInfo() @@ -64,7 +63,7 @@ class ShareLinksBiz(Crypter): url = pyfile.url if 's2l.biz' in url: url = self.load(url, just_header=True)['location'] - self.baseUrl = re.search(self.__pattern__, url).group(1) + self.baseUrl = re.search(self.__pattern__, url).group(1) self.fileId = re.match(self.__pattern__, url).group('id') self.package = pyfile.package() @@ -73,24 +72,24 @@ class ShareLinksBiz(Crypter): self.logDebug("File not found") return False return True - + def isPasswordProtected(self): if re.search(r'''''', self.html): self.logDebug("Links are protected") return True return False - + def isCaptchaProtected(self): if '=x1 and x<=x2) and (y>=y1 and y<=y2): + if (x >= x1 and x <= x2) and (y >= y1 and y <= y2): return href def handleErrors(self): if "The inserted password was wrong" in self.html: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail("Incorrect password, please set right password on 'Edit package' form and retry") + self.fail("Incorrect password, please set right password on 'Edit package' form and retry") if self.captcha: if "Your choice was wrong" in self.html: @@ -149,11 +148,11 @@ class ShareLinksBiz(Crypter): self.wait() self.retry() else: - self.correctCaptcha() + self.correctCaptcha() def getPackageInfo(self): name = folder = None - + # Extract from web package header title_re = r'

    (.*)

    ' m = re.search(title_re, self.html, re.DOTALL) @@ -162,54 +161,55 @@ class ShareLinksBiz(Crypter): if 'unnamed' not in title: name = folder = title self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) - + # Fallback to defaults if not name or not folder: name = self.package.name folder = self.package.folder self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) - + # Return package info - return name, folder - + return name, folder + def handleWebLinks(self): package_links = [] self.logDebug("Handling Web links") - + #@TODO: Gather paginated web links pattern = r"javascript:_get\('(.*?)', \d+, ''\)" ids = re.findall(pattern, self.html) self.logDebug("Decrypting %d Web links" % len(ids)) for i, id in enumerate(ids): try: - self.logDebug("Decrypting Web link %d, [%s]" % (i+1, id)) + self.logDebug("Decrypting Web link %d, [%s]" % (i + 1, id)) dwLink = self.baseUrl + "/get/lnk/" + id response = self.load(dwLink) code = re.search(r'frm/(\d+)', response).group(1) fwLink = self.baseUrl + "/get/frm/" + code response = self.load(fwLink) - jscode = re.search(r'', response, re.DOTALL).group(1) + jscode = re.search(r'', response, + re.DOTALL).group(1) jscode = self.js.eval("f = %s" % jscode) - jslauncher = "window=''; parent={frames:{Main:{location:{href:''}}},location:''}; %s; parent.frames.Main.location.href" + jslauncher = "window=''; parent={frames:{Main:{location:{href:''}}},location:''}; %s; parent.frames.Main.location.href" dlLink = self.js.eval(jslauncher % jscode) - self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink) + self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink) package_links.append(dlLink) except Exception, detail: self.logDebug("Error decrypting Web link [%s], %s" % (id, detail)) return package_links - + def handleContainers(self): package_links = [] self.logDebug("Handling Container links") - + pattern = r"javascript:_get\('(.*?)', 0, '(rsdf|ccf|dlc)'\)" containersLinks = re.findall(pattern, self.html) self.logDebug("Decrypting %d Container links" % len(containersLinks)) for containerLink in containersLinks: - link = "%s/get/%s/%s" % (self.baseUrl, containerLink[1], containerLink[0]) + link = "%s/get/%s/%s" % (self.baseUrl, containerLink[1], containerLink[0]) package_links.append(link) return package_links - + def handleCNL2(self): package_links = [] self.logDebug("Handling CNL2 links") @@ -219,17 +219,17 @@ class ShareLinksBiz(Crypter): (crypted, jk) = self._getCipherParams() package_links.extend(self._getLinks(crypted, jk)) except: - self.fail("Unable to decrypt CNL2 links") + self.fail("Unable to decrypt CNL2 links") return package_links - + def _getCipherParams(self): - + # Request CNL2 code = re.search(r'ClicknLoad.swf\?code=(.*?)"', self.html).group(1) url = "%s/get/cnl2/%s" % (self.baseUrl, code) response = self.load(url) params = response.split(";;") - + # Get jk strlist = list(base64.standard_b64decode(params[1])) strlist.reverse() @@ -244,7 +244,7 @@ class ShareLinksBiz(Crypter): return crypted, jk def _getLinks(self, crypted, jk): - + # Get key jreturn = self.js.eval("%s f()" % jk) self.logDebug("JsEngine returns value [%s]" % jreturn) @@ -266,4 +266,4 @@ class ShareLinksBiz(Crypter): # Log and return self.logDebug("Block has %d links" % len(links)) - return links \ No newline at end of file + return links diff --git a/module/plugins/crypter/ShareRapidComFolder.py b/module/plugins/crypter/ShareRapidComFolder.py index cb7f37525..951c09d45 100644 --- a/module/plugins/crypter/ShareRapidComFolder.py +++ b/module/plugins/crypter/ShareRapidComFolder.py @@ -2,13 +2,14 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter + class ShareRapidComFolder(SimpleCrypter): __name__ = "ShareRapidComFolder" __type__ = "crypter" - __pattern__ = r"http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/(slozka/.+)" + __pattern__ = r"http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/(slozka/.+)" __version__ = "0.01" __description__ = """Share-Rapid.com Folder Plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - LINK_PATTERN = r']*>
    ' \ No newline at end of file + LINK_PATTERN = r']*>' diff --git a/module/plugins/crypter/SpeedLoadOrgFolder.py b/module/plugins/crypter/SpeedLoadOrgFolder.py index f85ede6f3..8223eb7b9 100644 --- a/module/plugins/crypter/SpeedLoadOrgFolder.py +++ b/module/plugins/crypter/SpeedLoadOrgFolder.py @@ -17,6 +17,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter + class SpeedLoadOrgFolder(SimpleCrypter): __name__ = "SpeedLoadOrgFolder" __type__ = "crypter" diff --git a/module/plugins/crypter/StealthTo.py b/module/plugins/crypter/StealthTo.py index cf7a79e9b..45a14f5a2 100644 --- a/module/plugins/crypter/StealthTo.py +++ b/module/plugins/crypter/StealthTo.py @@ -5,6 +5,7 @@ import re from module.plugins.Crypter import Crypter + class StealthTo(Crypter): __name__ = "StealthTo" __type__ = "container" @@ -29,17 +30,20 @@ class StealthTo(Crypter): self.html = self.req.load(url, cookies=True) temp_links = [] ids = [] - ats = [] # authenticity_token + ats = [] # authenticity_token inputs = re.findall(r"(<(input|form)[^>]+)", self.html) for input in inputs: - if re.search(r"name=\"authenticity_token\"",input[0]): + if re.search(r"name=\"authenticity_token\"", input[0]): ats.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) - if re.search(r"name=\"id\"",input[0]): + if re.search(r"name=\"id\"", input[0]): ids.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) - + for i in range(0, len(ids)): - self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))}, cookies=True) - new_html = self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": "1"}, cookies=True) + self.req.load(url + "/web", + post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))}, + cookies=True) + new_html = self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": "1"}, + cookies=True) temp_links.append(re.search(r"iframe src=\"(.*)\" frameborder", new_html).group(1)) self.links = temp_links diff --git a/module/plugins/crypter/TrailerzoneInfo.py b/module/plugins/crypter/TrailerzoneInfo.py index 43a4fcce5..b55c8d219 100644 --- a/module/plugins/crypter/TrailerzoneInfo.py +++ b/module/plugins/crypter/TrailerzoneInfo.py @@ -3,6 +3,7 @@ import re from module.plugins.Crypter import Crypter + class TrailerzoneInfo(Crypter): __name__ = "TrailerzoneInfo" __type__ = "crypter" @@ -24,22 +25,22 @@ class TrailerzoneInfo(Crypter): self.handleGo(url) def handleProtect(self, url): - self.handleGo("http://trailerzone.info/go.html#:::" + url.split("#:::",1)[1]) + self.handleGo("http://trailerzone.info/go.html#:::" + url.split("#:::", 1)[1]) def handleGo(self, url): - + src = self.req.load(str(url)) pattern = re.compile(self.JS_KEY_PATTERN, re.DOTALL) found = re.search(pattern, src) - + # Get package info - package_links = [] + package_links = [] try: - result = self.js.eval(found.group(1) + " decodeLink('" + url.split("#:::",1)[1] + "');") + result = self.js.eval(found.group(1) + " decodeLink('" + url.split("#:::", 1)[1] + "');") result = str(result) self.logDebug("RESULT: %s" % result) package_links.append(result) self.core.files.addLinks(package_links, self.pyfile.package().id) except Exception, e: - self.logDebug(e) + self.logDebug(e) self.fail('Could not extract any links by javascript') diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index 814d5240d..a5ccfc753 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -3,6 +3,7 @@ import re from module.plugins.Crypter import Crypter + class UlozToFolder(Crypter): __name__ = "UlozToFolder" __type__ = "crypter" @@ -20,10 +21,11 @@ class UlozToFolder(Crypter): html = self.load(self.pyfile.url) new_links = [] - for i in range(1,100): + for i in range(1, 100): self.logInfo("Fetching links from page %i" % i) found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: self.fail("Parse error (FOLDER)") + if found is None: + self.fail("Parse error (FOLDER)") new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) found = re.search(self.NEXT_PAGE_PATTERN, html) @@ -35,6 +37,6 @@ class UlozToFolder(Crypter): self.logInfo("Limit of 99 pages reached, aborting") if new_links: - self.core.files.addLinks(map(lambda s:"http://ulozto.net/%s" % s, new_links), self.pyfile.package().id) + self.core.files.addLinks(map(lambda s: "http://ulozto.net/%s" % s, new_links), self.pyfile.package().id) else: - self.fail('Could not extract any links') \ No newline at end of file + self.fail('Could not extract any links') diff --git a/module/plugins/crypter/WiiReloadedOrg.py b/module/plugins/crypter/WiiReloadedOrg.py index ba101892d..31c041bf0 100644 --- a/module/plugins/crypter/WiiReloadedOrg.py +++ b/module/plugins/crypter/WiiReloadedOrg.py @@ -1,8 +1,8 @@ - import re from module.plugins.Crypter import Crypter + class WiiReloadedOrg(Crypter): __name__ = "WiiReloadedOrg" __type__ = "crypter" @@ -12,16 +12,15 @@ class WiiReloadedOrg(Crypter): __description__ = """Wii-Reloaded.org Crypter Plugin""" __author_name__ = ("hzpz") __author_mail__ = ("none") - - + def decrypt(self, pyfile): url = pyfile.url src = self.req.load(str(url)) - + ids = re.findall(r"onClick=\"popup_dl\((.+)\)\"", src) if len(ids) == 0: self.fail("Unable to decrypt links, this plugin probably needs to be updated") - + packageName = self.pyfile.package().name if self.getConfig("changeName"): packageNameMatch = re.search(r"
    (.+)
    ", src) @@ -29,9 +28,9 @@ class WiiReloadedOrg(Crypter): self.logWarning("Unable to get folder name, this plugin probably needs to be updated") else: packageName = packageNameMatch.group(1) - + self.pyfile.package().password = "wii-reloaded.info" - + self.logDebug("Processing %d links" % len(ids)) links = [] for id in ids: @@ -47,6 +46,6 @@ class WiiReloadedOrg(Crypter): self.offline() self.logDebug("Decrypted link: %s" % redirectLocation) links.append(redirectLocation) - + self.logDebug("Decrypted %d links" % len(links)) - self.packages.append((packageName, links, packageName)) \ No newline at end of file + self.packages.append((packageName, links, packageName)) diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py index 72b72aab7..b6178448d 100644 --- a/module/plugins/crypter/YoutubeBatch.py +++ b/module/plugins/crypter/YoutubeBatch.py @@ -8,6 +8,7 @@ from module.plugins.Crypter import Crypter API_KEY = "AIzaSyCKnWLNlkX-L4oD1aEzqqhRw1zczeD6_k0" + class YoutubeBatch(Crypter): __name__ = "YoutubeBatch" __type__ = "container" @@ -18,7 +19,8 @@ class YoutubeBatch(Crypter): __author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org", "zoidberg@mujmail.cz", "roland@enkore.de") def get_videos(self, playlist_id, token=None): - url = "https://www.googleapis.com/youtube/v3/playlistItems?playlistId=%s&part=snippet&key=%s&maxResults=50" % (playlist_id, API_KEY) + url = "https://www.googleapis.com/youtube/v3/playlistItems?playlistId=%s&part=snippet&key=%s&maxResults=50" % ( + playlist_id, API_KEY) if token: url += "&pageToken=" + token -- cgit v1.2.3 From 2edeee0532ec6d6b4b26fd045a5971f67ca455da Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 22 Jul 2013 20:50:34 +0200 Subject: Fixed PEP 8 violations in Hosters --- module/plugins/hoster/ARD.py | 9 +- module/plugins/hoster/BasePlugin.py | 40 +++--- module/plugins/hoster/BayfilesCom.py | 48 ++++--- module/plugins/hoster/BezvadataCz.py | 16 ++- module/plugins/hoster/BillionuploadsCom.py | 2 + module/plugins/hoster/BitshareCom.py | 38 +++--- module/plugins/hoster/BoltsharingCom.py | 2 + module/plugins/hoster/CatShareNet.py | 1 + module/plugins/hoster/ChipDe.py | 31 ++--- module/plugins/hoster/CloudzerNet.py | 3 +- module/plugins/hoster/CramitIn.py | 12 +- module/plugins/hoster/CrockoCom.py | 41 +++--- module/plugins/hoster/CyberlockerCh.py | 2 + module/plugins/hoster/CzshareCom.py | 35 ++--- module/plugins/hoster/DailymotionCom.py | 10 +- module/plugins/hoster/DataportCz.py | 28 ++-- module/plugins/hoster/DateiTo.py | 53 ++++---- module/plugins/hoster/DepositfilesCom.py | 49 ++++--- module/plugins/hoster/DlFreeFr.py | 114 +++++++++------- module/plugins/hoster/EdiskCz.py | 7 +- module/plugins/hoster/EuroshareEu.py | 7 +- module/plugins/hoster/FastshareCz.py | 20 +-- module/plugins/hoster/FileApeCom.py | 29 +++-- module/plugins/hoster/FilecloudIo.py | 45 +++---- module/plugins/hoster/FilejungleCom.py | 14 +- module/plugins/hoster/FilepostCom.py | 91 +++++++------ module/plugins/hoster/FilerioCom.py | 14 +- module/plugins/hoster/FilesMailRu.py | 34 ++--- module/plugins/hoster/FileserveCom.py | 125 +++++++++--------- module/plugins/hoster/FileshareInUa.py | 35 ++--- module/plugins/hoster/FilezyNet.py | 4 +- module/plugins/hoster/FlyFilesNet.py | 8 +- module/plugins/hoster/FourSharedCom.py | 22 ++-- module/plugins/hoster/FreakshareCom.py | 61 ++++----- module/plugins/hoster/FreevideoCz.py | 2 + module/plugins/hoster/FshareVn.py | 32 +++-- module/plugins/hoster/Ftp.py | 55 ++++---- module/plugins/hoster/GamefrontCom.py | 39 +++--- module/plugins/hoster/GigapetaCom.py | 41 +++--- module/plugins/hoster/HellshareCz.py | 10 +- module/plugins/hoster/HellspyCz.py | 17 ++- module/plugins/hoster/HotfileCom.py | 65 +++++----- module/plugins/hoster/IcyFilesCom.py | 18 +-- module/plugins/hoster/IfileIt.py | 21 +-- module/plugins/hoster/IfolderRu.py | 18 ++- module/plugins/hoster/JumbofilesCom.py | 11 +- module/plugins/hoster/LetitbitNet.py | 36 ++--- module/plugins/hoster/MegaNz.py | 8 +- module/plugins/hoster/MegacrypterCom.py | 12 +- module/plugins/hoster/MegasharesCom.py | 36 ++--- module/plugins/hoster/MovReelCom.py | 202 +++++++++++++++-------------- module/plugins/hoster/MultishareCz.py | 52 ++++---- module/plugins/hoster/MyvideoDe.py | 5 +- module/plugins/hoster/NarodRu.py | 22 ++-- module/plugins/hoster/NetloadIn.py | 58 ++++----- module/plugins/hoster/NovafileCom.py | 14 +- module/plugins/hoster/NowDownloadEu.py | 16 ++- module/plugins/hoster/OneFichierCom.py | 41 +++--- module/plugins/hoster/PornhostCom.py | 27 ++-- module/plugins/hoster/PornhubCom.py | 23 ++-- module/plugins/hoster/PremiumizeMe.py | 31 +++-- module/plugins/hoster/QuickshareCz.py | 42 +++--- module/plugins/hoster/RapidshareCom.py | 100 +++++++------- module/plugins/hoster/RarefileNet.py | 3 +- module/plugins/hoster/RealdebridCom.py | 20 +-- module/plugins/hoster/RedtubeCom.py | 16 +-- module/plugins/hoster/RehostTo.py | 3 +- module/plugins/hoster/ReloadCc.py | 28 ++-- module/plugins/hoster/RyushareCom.py | 10 +- module/plugins/hoster/SecureUploadEu.py | 1 + module/plugins/hoster/SendmywayCom.py | 1 + module/plugins/hoster/SendspaceCom.py | 19 +-- module/plugins/hoster/Share4webCom.py | 6 +- module/plugins/hoster/Share76Com.py | 2 + module/plugins/hoster/ShareFilesCo.py | 8 +- module/plugins/hoster/ShareRapidCom.py | 44 ++++--- module/plugins/hoster/SharebeesCom.py | 1 + module/plugins/hoster/ShareonlineBiz.py | 122 ++++++++--------- module/plugins/hoster/ShareplaceCom.py | 26 ++-- module/plugins/hoster/ShragleCom.py | 55 ++++---- module/plugins/hoster/SpeedLoadOrg.py | 4 +- module/plugins/hoster/SpeedfileCz.py | 6 +- module/plugins/hoster/StreamCz.py | 36 ++--- module/plugins/hoster/StreamcloudEu.py | 27 ++-- module/plugins/hoster/TurbobitNet.py | 60 +++++---- module/plugins/hoster/TurbouploadCom.py | 15 ++- module/plugins/hoster/TusfilesNet.py | 2 + module/plugins/hoster/TwoSharedCom.py | 15 ++- module/plugins/hoster/UlozTo.py | 56 ++++---- module/plugins/hoster/UloziskoSk.py | 13 +- module/plugins/hoster/UnibytesCom.py | 38 +++--- module/plugins/hoster/UploadStationCom.py | 14 +- module/plugins/hoster/UploadedTo.py | 9 +- module/plugins/hoster/UploadheroCom.py | 37 +++--- module/plugins/hoster/UploadingCom.py | 47 +++---- module/plugins/hoster/UptoboxCom.py | 10 +- module/plugins/hoster/VeehdCom.py | 32 ++--- module/plugins/hoster/WarserverCz.py | 41 +++--- module/plugins/hoster/WebshareCz.py | 15 ++- module/plugins/hoster/WrzucTo.py | 38 +++--- module/plugins/hoster/X7To.py | 7 +- module/plugins/hoster/XFileSharingPro.py | 56 ++++---- module/plugins/hoster/XHamsterCom.py | 39 +++--- module/plugins/hoster/XVideosCom.py | 4 +- module/plugins/hoster/Xdcc.py | 121 +++++++++-------- module/plugins/hoster/YibaishiwuCom.py | 22 ++-- module/plugins/hoster/YoupornCom.py | 11 +- module/plugins/hoster/YourfilesTo.py | 22 ++-- module/plugins/hoster/YoutubeCom.py | 55 ++++---- module/plugins/hoster/ZDF.py | 9 +- module/plugins/hoster/ZeveraCom.py | 160 +++++++++++------------ module/plugins/hoster/ZippyshareCom.py | 111 ++++++++-------- 112 files changed, 1946 insertions(+), 1655 deletions(-) diff --git a/module/plugins/hoster/ARD.py b/module/plugins/hoster/ARD.py index cda783091..4404994b3 100644 --- a/module/plugins/hoster/ARD.py +++ b/module/plugins/hoster/ARD.py @@ -1,4 +1,3 @@ - import subprocess import re import os.path @@ -10,6 +9,7 @@ from module.plugins.Hoster import Hoster # Requires rtmpdump # by Roland Beermann + class RTMP: # TODO: Port to some RTMP-library like rtmpy or similar # TODO?: Integrate properly into the API of pyLoad @@ -37,6 +37,7 @@ class RTMP: return subprocess.check_call(args) + class ARD(Hoster): __name__ = "ARD Mediathek" __version__ = "0.11" @@ -46,8 +47,10 @@ class ARD(Hoster): def process(self, pyfile): site = self.load(pyfile.url) - avail_videos = re.findall(r"""mediaCollection.addMediaStream\(0, ([0-9]*), "([^\"]*)", "([^\"]*)", "[^\"]*"\);""", site) - avail_videos.sort(key=lambda videodesc: int(videodesc[0]), reverse=True) # The higher the number, the better the quality + avail_videos = re.findall( + r'mediaCollection.addMediaStream\(0, ([0-9]*), "([^\"]*)", "([^\"]*)", "[^\"]*"\);', site) + avail_videos.sort(key=lambda videodesc: int(videodesc[0]), + reverse=True) # The higher the number, the better the quality quality, url, playpath = avail_videos[0] diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index f8d494e39..332921dc4 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -8,11 +8,12 @@ from module.network.HTTPRequest import BadHeader from module.plugins.Hoster import Hoster from module.utils import html_unescape, remove_chars + class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" __pattern__ = r"^unmatchable$" - __version__ = "0.17" + __version__ = "0.18" __description__ = """Base Plugin when any other didnt fit""" __author_name__ = ("RaNaN") __author_mail__ = ("RaNaN@pyload.org") @@ -29,17 +30,17 @@ class BasePlugin(Hoster): self.multiDL = False return -# self.__name__ = "NetloadIn" -# pyfile.name = "test" -# self.html = self.load("http://localhost:9000/short") -# self.download("http://localhost:9000/short") -# self.api = self.load("http://localhost:9000/short") -# self.decryptCaptcha("http://localhost:9000/captcha") -# -# if pyfile.url == "79": -# self.core.api.addPackage("test", [str(i) for i in range(80)], 1) -# -# return + # self.__name__ = "NetloadIn" + # pyfile.name = "test" + # self.html = self.load("http://localhost:9000/short") + # self.download("http://localhost:9000/short") + # self.api = self.load("http://localhost:9000/short") + # self.decryptCaptcha("http://localhost:9000/captcha") + # + # if pyfile.url == "79": + # self.core.api.addPackage("test", [str(i) for i in range(80)], 1) + # + # return if pyfile.url.startswith("http"): try: @@ -49,7 +50,7 @@ class BasePlugin(Hoster): self.logDebug("Auth required") account = self.core.accountManager.getAccountPlugin('Http') - servers = [ x['login'] for x in account.getAllAccounts() ] + servers = [x['login'] for x in account.getAllAccounts()] server = urlparse(pyfile.url).netloc if server in servers: @@ -70,15 +71,14 @@ class BasePlugin(Hoster): else: self.fail("No Plugin matched and not a downloadable url.") - def downloadFile(self, pyfile): url = pyfile.url for i in range(5): - header = self.load(url, just_header = True) + header = self.load(url, just_header=True) # self.load does not raise a BadHeader on 404 responses, do it here - if header.has_key('code') and header['code'] == 404: + if 'code' in header and header['code'] == 404: raise BadHeader(404) if 'location' in header: @@ -95,11 +95,13 @@ class BasePlugin(Hoster): if m: disp = m.groupdict() self.logDebug(disp) - if not disp['enc']: disp['enc'] = 'utf-8' + if not disp['enc']: + disp['enc'] = 'utf-8' name = remove_chars(disp['name'], "\"';").strip() name = unicode(unquote(name), disp['enc']) - if not name: name = url + if not name: + name = url pyfile.name = name self.logDebug("Filename: %s" % pyfile.name) - self.download(url, disposition=True) \ No newline at end of file + self.download(url, disposition=True) diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py index 8473468ba..bb1e78bb3 100644 --- a/module/plugins/hoster/BayfilesCom.py +++ b/module/plugins/hoster/BayfilesCom.py @@ -17,9 +17,11 @@ """ import re +from time import time + from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.common.json_layer import json_loads -from time import time + class BayfilesCom(SimpleHoster): __name__ = "BayfilesCom" @@ -32,50 +34,53 @@ class BayfilesCom(SimpleHoster): FILE_INFO_PATTERN = r'

    [^<]*(?P[0-9., ]+)(?P[kKMG])i?B

    ' FILE_OFFLINE_PATTERN = r'(

    The requested file could not be found.

    |404 Not Found)' - + WAIT_PATTERN = r'>Your IP [0-9.]* has recently downloaded a file\. Upgrade to premium or wait (\d+) minutes\.<' VARS_PATTERN = r'var vfid = (\d+);\s*var delay = (\d+);' LINK_PATTERN = r"javascript:window.location.href = '([^']+)';" PREMIUM_LINK_PATTERN = r'(?:
    BayFiles"), "notfound": re.compile(r"404 Not Found") - }) + }) if check == "waitforfreeslots": self.retry(60, 300, "Wait for free slot") elif check == "notfound": self.retry(60, 300, "404 Not found") - + + getInfo = create_getInfo(BayfilesCom) diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index cb9bae07c..d923a0633 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -19,6 +19,7 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + class BezvadataCz(SimpleHoster): __name__ = "BezvadataCz" __type__ = "hoster" @@ -38,7 +39,8 @@ class BezvadataCz(SimpleHoster): def handleFree(self): #download button found = re.search(r'', self.html) - if not found: self.parseError("page2 URL") + if not found: + self.parseError("page2 URL") url = "http://bezvadata.cz%s" % found.group(1) self.logDebug("DL URL %s" % url) @@ -84,11 +89,12 @@ class BezvadataCz(SimpleHoster): def checkErrors(self): if 'images/button-download-disable.png' in self.html: - self.longWait(300, 24) #parallel dl limit + self.longWait(300, 24) # parallel dl limit elif '
    Size:(?P.*?)
    ' HOSTER_NAME = "billionuploads.com" + getInfo = create_getInfo(BillionuploadsCom) diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 5e117ff45..82c2fe9cb 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -15,9 +15,9 @@ class BitshareCom(SimpleHoster): __description__ = """Bitshare.Com File Download Hoster""" __author_name__ = ("paulking", "fragonib") __author_mail__ = (None, "fragonib[AT]yahoo[DOT]es") - + HOSTER_DOMAIN = "bitshare.com" - FILE_OFFLINE_PATTERN = r'''(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)''' + FILE_OFFLINE_PATTERN = r'(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)' FILE_NAME_PATTERN = r'Download:\s*[\d.]+) (?P\w+)' FILE_AJAXID_PATTERN = r'var ajaxdl = "(.*?)";' @@ -31,12 +31,12 @@ class BitshareCom(SimpleHoster): def process(self, pyfile): if self.premium: self.account.relogin(self.user) - + self.pyfile = pyfile - + # File id m = re.match(self.__pattern__, self.pyfile.url) - self.file_id = max(m.group('id1'), m.group('id2')) + self.file_id = max(m.group('id1'), m.group('id2')) self.logDebug("File id is [%s]" % self.file_id) # Load main page @@ -66,24 +66,23 @@ class BitshareCom(SimpleHoster): # Ajax file id self.ajaxid = re.search(BitshareCom.FILE_AJAXID_PATTERN, self.html).group(1) self.logDebug("File ajax id is [%s]" % self.ajaxid) - + # This may either download our file or forward us to an error page - url = self.getDownloadUrl() + url = self.getDownloadUrl() self.logDebug("Downloading file with url [%s]" % url) self.download(url) - def getDownloadUrl(self): # Return location if direct download is active if self.premium: - header = self.load(self.pyfile.url, cookies = True, just_header = True) + header = self.load(self.pyfile.url, cookies=True, just_header=True) if 'location' in header: - return header['location'] - + return header['location'] + # Get download info self.logDebug("Getting download info") response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", - post={"request" : "generateID", "ajaxid" : self.ajaxid}) + post={"request": "generateID", "ajaxid": self.ajaxid}) self.handleErrors(response, ':') parts = response.split(":") filetype = parts[0] @@ -108,24 +107,24 @@ class BitshareCom(SimpleHoster): id = re.search(BitshareCom.CAPTCHA_KEY_PATTERN, self.html).group(1) # Try up to 3 times for i in range(3): - self.logDebug("Resolving ReCaptcha with key [%s], round %d" % (id, i+1)) + self.logDebug("Resolving ReCaptcha with key [%s], round %d" % (id, i + 1)) recaptcha = ReCaptcha(self) challenge, code = recaptcha.challenge(id) response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", - post={"request" : "validateCaptcha", "ajaxid" : self.ajaxid, "recaptcha_challenge_field" : challenge, "recaptcha_response_field" : code}) + post={"request": "validateCaptcha", "ajaxid": self.ajaxid, + "recaptcha_challenge_field": challenge, "recaptcha_response_field": code}) if self.handleCaptchaErrors(response): break - # Get download URL self.logDebug("Getting download url") response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", - post={"request" : "getDownloadURL", "ajaxid" : self.ajaxid}) + post={"request": "getDownloadURL", "ajaxid": self.ajaxid}) self.handleErrors(response, '#') - url = response.split("#")[-1] - + url = response.split("#")[-1] + return url - + def handleErrors(self, response, separator): self.logDebug("Checking response [%s]" % response) if "ERROR:Session timed out" in response: @@ -144,4 +143,5 @@ class BitshareCom(SimpleHoster): self.logDebug("Wrong captcha") self.invalidCaptcha() + getInfo = create_getInfo(BitshareCom) diff --git a/module/plugins/hoster/BoltsharingCom.py b/module/plugins/hoster/BoltsharingCom.py index 2f42c8b23..f9cc91ca5 100644 --- a/module/plugins/hoster/BoltsharingCom.py +++ b/module/plugins/hoster/BoltsharingCom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + class BoltsharingCom(XFileSharingPro): __name__ = "BoltsharingCom" __type__ = "hoster" @@ -12,4 +13,5 @@ class BoltsharingCom(XFileSharingPro): HOSTER_NAME = "boltsharing.com" + getInfo = create_getInfo(BoltsharingCom) diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 3289ef72c..66d46c2e8 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -35,4 +35,5 @@ class CatShareNet(SimpleHoster): self.invalidCaptcha() self.retry() + getInfo = create_getInfo(CatShareNet) diff --git a/module/plugins/hoster/ChipDe.py b/module/plugins/hoster/ChipDe.py index fcb84a300..8e13b914d 100644 --- a/module/plugins/hoster/ChipDe.py +++ b/module/plugins/hoster/ChipDe.py @@ -4,21 +4,22 @@ import re from module.plugins.Crypter import Crypter + class ChipDe(Crypter): - __name__ = "ChipDe" - __type__ = "container" - __pattern__ = r"http://(?:www\.)?chip.de/video/.*\.html" - __version__ = "0.1" - __description__ = """Chip.de Container Plugin""" - __author_name__ = ('4Christopher') - __author_mail__ = ('4Christopher@gmx.de') + __name__ = "ChipDe" + __type__ = "container" + __pattern__ = r"http://(?:www\.)?chip.de/video/.*\.html" + __version__ = "0.1" + __description__ = """Chip.de Container Plugin""" + __author_name__ = ('4Christopher') + __author_mail__ = ('4Christopher@gmx.de') - def decrypt(self, pyfile): - self.html = self.load(pyfile.url) - try: - url = re.search(r'"(http://video.chip.de/\d+?/.*)"', self.html).group(1) - self.logDebug('The file URL is %s' % url) - except: - self.fail('Failed to find the URL') + def decrypt(self, pyfile): + self.html = self.load(pyfile.url) + try: + url = re.search(r'"(http://video.chip.de/\d+?/.*)"', self.html).group(1) + self.logDebug('The file URL is %s' % url) + except: + self.fail('Failed to find the URL') - self.packages.append((self.pyfile.package().name, [ url ], self.pyfile.package().folder)) + self.packages.append((self.pyfile.package().name, [url], self.pyfile.package().folder)) diff --git a/module/plugins/hoster/CloudzerNet.py b/module/plugins/hoster/CloudzerNet.py index 6c02203ca..e95f90792 100644 --- a/module/plugins/hoster/CloudzerNet.py +++ b/module/plugins/hoster/CloudzerNet.py @@ -52,7 +52,8 @@ class CloudzerNet(SimpleHoster): recaptcha = ReCaptcha(self) challenge, response = recaptcha.challenge(self.CAPTCHA_KEY) post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response} - response = json_loads(self.load('http://cloudzer.net/io/ticket/captcha/%s' % self.file_info['ID'], post=post_data, cookies=True)) + response = json_loads(self.load('http://cloudzer.net/io/ticket/captcha/%s' % self.file_info['ID'], + post=post_data, cookies=True)) self.logDebug("Captcha check response", response) self.logDebug("First check") diff --git a/module/plugins/hoster/CramitIn.py b/module/plugins/hoster/CramitIn.py index 171fba0ff..68df322f5 100644 --- a/module/plugins/hoster/CramitIn.py +++ b/module/plugins/hoster/CramitIn.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + class CramitIn(XFileSharingPro): __name__ = "CramitIn" __type__ = "hoster" @@ -9,12 +10,13 @@ class CramitIn(XFileSharingPro): __description__ = """Cramit.in hoster plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - + FILE_INFO_PATTERN = r'\s*(?P.*?).*?\s*\((?P.*?)\)' - DIRECT_LINK_PATTERN = r'href="(http://cramit.in/file_download/.*?)"' + DIRECT_LINK_PATTERN = r'href="(http://cramit.in/file_download/.*?)"' HOSTER_NAME = "cramit.in" - + def setup(self): - self.resumeDownload = self.multiDL = self.premium + self.resumeDownload = self.multiDL = self.premium + -getInfo = create_getInfo(CramitIn) \ No newline at end of file +getInfo = create_getInfo(CramitIn) diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index f075d073b..7d5336cd9 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -1,15 +1,17 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import re + from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.internal.CaptchaService import ReCaptcha -import re + class CrockoCom(SimpleHoster): __name__ = "CrockoCom" __type__ = "hoster" __pattern__ = r"http://(www\.)?(crocko|easy-share).com/.*" - __version__ = "0.13" + __version__ = "0.14" __description__ = """Crocko Download Hoster""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -20,45 +22,46 @@ class CrockoCom(SimpleHoster): DOWNLOAD_URL_PATTERN = r"window.location ='([^']+)';" CAPTCHA_URL_PATTERN = re.compile(r"u='(/file_contents/captcha/\w+)';\s*w='(\d+)';") CAPTCHA_KEY_PATTERN = re.compile(r'Recaptcha.create\("([^"]+)"') - + FORM_PATTERN = r'(.*?)' FORM_INPUT_PATTERN = r']* name="?([^" ]+)"? value="?([^" ]+)"?[^>]*>' - + FILE_NAME_REPLACEMENTS = [(r'<[^>]*>', '')] def handleFree(self): if "You need Premium membership to download this file." in self.html: self.fail("You need Premium membership to download this file.") - - url = False + for i in range(5): found = re.search(self.CAPTCHA_URL_PATTERN, self.html) - if found: + if found: url, wait_time = 'http://crocko.com' + found.group(1), found.group(2) self.setWait(wait_time) self.wait() self.html = self.load(url) - else: - break - + else: + break + found = re.search(self.CAPTCHA_KEY_PATTERN, self.html) - if not found: self.parseError('Captcha KEY') + if not found: + self.parseError('Captcha KEY') captcha_key = found.group(1) - + found = re.search(self.FORM_PATTERN, self.html, re.DOTALL) - if not found: self.parseError('ACTION') + if not found: + self.parseError('ACTION') action, form = found.groups() inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - + recaptcha = ReCaptcha(self) - + for i in range(5): inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) - self.download(action, post = inputs) - + self.download(action, post=inputs) + check = self.checkDownload({ "captcha_err": self.CAPTCHA_KEY_PATTERN - }) + }) if check == "captcha_err": self.invalidCaptcha() @@ -67,5 +70,5 @@ class CrockoCom(SimpleHoster): else: self.fail('No valid captcha solution received') + getInfo = create_getInfo(CrockoCom) - \ No newline at end of file diff --git a/module/plugins/hoster/CyberlockerCh.py b/module/plugins/hoster/CyberlockerCh.py index 57dd26787..19a4473b3 100644 --- a/module/plugins/hoster/CyberlockerCh.py +++ b/module/plugins/hoster/CyberlockerCh.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + class CyberlockerCh(XFileSharingPro): __name__ = "CyberlockerCh" __type__ = "hoster" @@ -12,4 +13,5 @@ class CyberlockerCh(XFileSharingPro): HOSTER_NAME = "cyberlocker.ch" + getInfo = create_getInfo(CyberlockerCh) diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 347427586..8f6f76d84 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -23,6 +23,7 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError from module.utils import parseFileSize + class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" @@ -34,7 +35,7 @@ class CzshareCom(SimpleHoster): FILE_NAME_PATTERN = r'
    \s*

    \s*Cel. n.zev: ]*>(?P[^<]+)' FILE_SIZE_PATTERN = r'

    (?:\s*

    [^\n]*

    )*\s*Velikost:\s*(?P[0-9., ]+)(?P[kKMG])i?B\s*
    ' FILE_OFFLINE_PATTERN = r'
    \s*

    ' - + FILE_SIZE_REPLACEMENTS = [(' ', '')] FILE_URL_REPLACEMENTS = [(r'http://[^/]*/download.php\?.*?id=(\w+).*', r'http://czshare.com/\1/x/')] SH_CHECK_TRAFFIC = True @@ -57,11 +58,12 @@ class CzshareCom(SimpleHoster): self.account.relogin(self.user) self.html = self.load(self.pyfile.url, cookies=True, decode=True) found = re.search(self.USER_CREDIT_PATTERN, self.html) - if not found: return False + if not found: + return False # check user credit try: - credit = parseFileSize(found.group(1).replace(' ',''), found.group(2)) + credit = parseFileSize(found.group(1).replace(' ', ''), found.group(2)) self.logInfo("Premium download for %i KiB of Credit" % (self.pyfile.size / 1024)) self.logInfo("User %s has %i KiB left" % (self.user, credit / 1024)) if credit < self.pyfile.size: @@ -70,11 +72,11 @@ class CzshareCom(SimpleHoster): except Exception, e: # let's continue and see what happens... self.logError('Parse error (CREDIT): %s' % e) - - return True - - def handlePremium(self): - # parse download link + + return True + + def handlePremium(self): + # parse download link try: form = re.search(self.PREMIUM_FORM_PATTERN, self.html, re.DOTALL).group(1) inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) @@ -121,20 +123,20 @@ class CzshareCom(SimpleHoster): break else: self.fail("No valid captcha code entered") - + found = re.search("countdown_number = (\d+);", self.html) self.setWait(int(found.group(1)) if found else 50) # download the file, destination is determined by pyLoad - self.logDebug("WAIT URL", self.req.lastEffectiveURL) - found = re.search("free_wait.php\?server=(.*?)&(.*)", self.req.lastEffectiveURL) + self.logDebug("WAIT URL", self.req.lastEffectiveURL) + found = re.search("free_wait.php\?server=(.*?)&(.*)", self.req.lastEffectiveURL) if not found: raise PluginParseError('Download URL') url = "http://%s/download.php?%s" % (found.group(1), found.group(2)) - - self.wait() - self.multiDL = True + + self.wait() + self.multiDL = True self.download(url) self.checkDownloadedFile() @@ -145,7 +147,7 @@ class CzshareCom(SimpleHoster): "credit": re.compile(r"^Nem.*te dostate.*n.* kredit.$"), "multi_dl": re.compile(self.MULTIDL_PATTERN), "captcha_err": "
  • Zadaný ověřovací kód nesouhlasí!
  • " - }) + }) if check == "tempoffline": self.fail("File not available - try later") @@ -156,5 +158,6 @@ class CzshareCom(SimpleHoster): elif check == "captcha_err": self.invalidCaptcha() self.retry() - + + getInfo = create_getInfo(CzshareCom) diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py index 1b411393d..ab8ff7910 100644 --- a/module/plugins/hoster/DailymotionCom.py +++ b/module/plugins/hoster/DailymotionCom.py @@ -5,6 +5,7 @@ import re from urllib import unquote from module.plugins.Hoster import Hoster + class DailymotionCom(Hoster): __name__ = 'DailymotionCom' __type__ = 'hoster' @@ -22,12 +23,13 @@ class DailymotionCom(Hoster): r'', r'"(?:vs_videotitle|videoTitle|dm_title|ss_mediaTitle)": "(.*?)"'): filename = re.search(pattern, html) - if filename is not None: break + if filename is not None: + break else: self.fail("Unable to find file name") - pyfile.name = filename.group(1)+'.mp4' - self.logDebug('Filename='+pyfile.name) + pyfile.name = filename.group(1) + '.mp4' + self.logDebug('Filename=' + pyfile.name) allLinksInfo = re.search(r'"sequence":"(.*?)"', html) self.logDebug(allLinksInfo.groups()) allLinksInfo = unquote(allLinksInfo.group(1)) @@ -44,4 +46,4 @@ class DailymotionCom(Hoster): def getQuality(self, quality, data): link = re.search('"' + quality + '":"(http:[^<>"\']+)"', data) if link is not None: - return link.group(1).replace('\\','') \ No newline at end of file + return link.group(1).replace('\\', '') diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index 3dc581bf1..1e24388d7 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -16,10 +16,9 @@ @author: zoidberg """ -import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError -from pycurl import FOLLOWLOCATION - + + class DataportCz(SimpleHoster): __name__ = "DataportCz" __type__ = "hoster" @@ -32,26 +31,26 @@ class DataportCz(SimpleHoster): FILE_SIZE_PATTERN = r'Velikost\s*(?P[^<]+)' FILE_OFFLINE_PATTERN = r'

    Soubor nebyl nalezen

    ' FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.dataport.cz/file/\1')] - - CAPTCHA_URL_PATTERN = r'
    \s*\s*(\d+)
    ' - def handleFree(self): + def handleFree(self): captchas = {"1": "jkeG", "2": "hMJQ", "3": "vmEK", "4": "ePQM", "5": "blBd"} - + for i in range(60): action, inputs = self.parseHtmlForm('free_download_form') self.logDebug(action, inputs) if not action or not inputs: raise PluginParseError('free_download_form') - + if "captchaId" in inputs and inputs["captchaId"] in captchas: - inputs['captchaCode'] = captchas[inputs["captchaId"]] + inputs['captchaCode'] = captchas[inputs["captchaId"]] else: raise PluginParseError('captcha') - - self.html = self.download("http://www.dataport.cz%s" % action, post = inputs) - + + self.html = self.download("http://www.dataport.cz%s" % action, post=inputs) + check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', "slot": 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) if check == "captcha": @@ -60,9 +59,10 @@ class DataportCz(SimpleHoster): self.logDebug("No free slots - wait 60s and retry") self.setWait(60, False) self.wait() - self.html = self.load(self.pyfile.url, decode = True) + self.html = self.load(self.pyfile.url, decode=True) continue else: break - + + create_getInfo(DataportCz) \ No newline at end of file diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 061881e4b..d7760d940 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -20,6 +20,7 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.internal.CaptchaService import ReCaptcha + class DateiTo(SimpleHoster): __name__ = "DateiTo" __type__ = "hoster" @@ -33,47 +34,48 @@ class DateiTo(SimpleHoster): FILE_SIZE_PATTERN = r'Dateigröße:\s*(?P.*?)Datei wurde nicht gefunden<|>Bitte wähle deine Datei aus... <' PARALELL_PATTERN = r'>Du lädst bereits eine Datei herunter<' - + WAIT_PATTERN = r'countdown\({seconds: (\d+)' DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",' RECAPTCHA_KEY_PATTERN = r'Recaptcha.create\("(.*?)"' - + def handleFree(self): url = 'http://datei.to/ajax/download.php' data = {'P': 'I', 'ID': self.file_info['ID']} - - recaptcha = ReCaptcha(self) - + + recaptcha = ReCaptcha(self) + for i in range(10): - self.logDebug("URL", url, "POST", data) - self.html = self.load(url, post = data) + self.logDebug("URL", url, "POST", data) + self.html = self.load(url, post=data) self.checkErrors() - + if url.endswith('download.php') and 'P' in data: if data['P'] == 'I': self.doWait() - + elif data['P'] == 'IV': - break - + break + found = re.search(self.DATA_PATTERN, self.html) - if not found: self.parseError('data') + if not found: + self.parseError('data') url = 'http://datei.to/' + found.group(1) data = dict(x.split('=') for x in found.group(2).split('&')) - + if url.endswith('recaptcha.php'): found = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) recaptcha_key = found.group(1) if found else "6LdBbL8SAAAAAI0vKUo58XRwDd5Tu_Ze1DA7qTao" - - data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key) - + + data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key) + else: - self.fail('Too bad...') - + self.fail('Too bad...') + download_url = self.html self.logDebug('Download URL', download_url) self.download(download_url) - + def checkErrors(self): found = re.search(self.PARALELL_PATTERN, self.html) if found: @@ -82,13 +84,14 @@ class DateiTo(SimpleHoster): self.setWait(wait_time + 1, False) self.wait(300) self.retry() - - def doWait(self): + + def doWait(self): found = re.search(self.WAIT_PATTERN, self.html) wait_time = int(found.group(1)) if found else 30 self.setWait(wait_time + 1, False) - - self.load('http://datei.to/ajax/download.php', post = {'P': 'Ads'}) - self.wait() - + + self.load('http://datei.to/ajax/download.php', post={'P': 'Ads'}) + self.wait() + + getInfo = create_getInfo(DateiTo) diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index ee5fdf6af..1ede3b715 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -4,9 +4,9 @@ import re from urllib import unquote from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.network.RequestFactory import getURL from module.plugins.internal.CaptchaService import ReCaptcha + class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" @@ -21,7 +21,8 @@ class DepositfilesCom(SimpleHoster): FILE_INFO_PATTERN = r'' def process(self, pyfile): - self.html = self.load(pyfile.url, decode = True) + self.html = self.load(pyfile.url, decode=True) self.getFileInfo() - + # parse js variables - self.jsvars = dict((x, y.strip("'")) for x,y in re.findall(r"var (\w+) = ([0-9.]+|'[^']*')", self.html)) - self.logDebug(self.jsvars) + self.jsvars = dict((x, y.strip("'")) for x, y in re.findall(r"var (\w+) = ([0-9.]+|'[^']*')", self.html)) + self.logDebug(self.jsvars) pyfile.name = self.jsvars['ID3'] - + # determine download type - free or premium if self.premium: if 'UU_prihlasen' in self.jsvars: @@ -51,32 +53,33 @@ class QuickshareCz(SimpleHoster): elif float(self.jsvars['UU_kredit']) < float(self.jsvars['kredit_odecet']): self.logWarning('Not enough credit left') self.premium = False - + if self.premium: self.handlePremium() else: self.handleFree() - + check = self.checkDownload({"err": re.compile(r"\AChyba!")}, max_size=100) if check == "err": self.fail("File not found or plugin defect") - - def handleFree(self): + + def handleFree(self): # get download url download_url = '%s/download.php' % self.jsvars['server'] data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ('ID1', 'ID2', 'ID3', 'ID4')) self.logDebug("FREE URL1:" + download_url, data) - - self.req.http.c.setopt(FOLLOWLOCATION, 0) + + self.req.http.c.setopt(FOLLOWLOCATION, 0) self.load(download_url, post=data) - self.header = self.req.http.header + self.header = self.req.http.header self.req.http.c.setopt(FOLLOWLOCATION, 1) - + found = re.search("Location\s*:\s*(.*)", self.header, re.I) - if not found: self.fail('File not found') - download_url = found.group(1) + if not found: + self.fail('File not found') + download_url = found.group(1) self.logDebug("FREE URL2:" + download_url) - + # check errors found = re.search(r'/chyba/(\d+)', download_url) if found: @@ -88,12 +91,13 @@ class QuickshareCz(SimpleHoster): self.fail('Error %d' % found.group(1)) # download file - self.download(download_url) - + self.download(download_url) + def handlePremium(self): download_url = '%s/download_premium.php' % self.jsvars['server'] data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ('ID1', 'ID2', 'ID4', 'ID5')) self.logDebug("PREMIUM URL:" + download_url, data) self.download(download_url, get=data) + getInfo = create_getInfo(QuickshareCz) diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index cbbf5115a..9d40b867f 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -1,4 +1,3 @@ - #!/usr/bin/env python # -*- coding: utf-8 -*- @@ -14,6 +13,7 @@ import re from module.network.RequestFactory import getURL from module.plugins.Hoster import Hoster + def getInfo(urls): ids = "" names = "" @@ -23,26 +23,29 @@ def getInfo(urls): for url in urls: r = p.search(url) if r.group("name"): - ids+= ","+r.group("id") - names+= ","+r.group("name") + ids += "," + r.group("id") + names += "," + r.group("name") elif r.group("name_new"): - ids+= ","+r.group("id_new") - names+= ","+r.group("name_new") - + ids += "," + r.group("id_new") + names += "," + r.group("name_new") + url = "http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=checkfiles&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]) ) + 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 @@ -52,7 +55,9 @@ class RapidshareCom(Hoster): __pattern__ = r"https?://[\w\.]*?rapidshare.com/(?:files/(?P\d*?)/(?P[^?]+)|#!download\|(?:\w+)\|(?P\d+)\|(?P[^|]+))" __version__ = "1.39" __description__ = """Rapidshare.com Download Hoster""" - __config__ = [["server", "Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera", "Preferred Server", "None"]] + __config__ = [["server", + "Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera", + "Preferred Server", "None"]] __author_name__ = ("spoob", "RaNaN", "mkaay") __author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de") @@ -65,14 +70,14 @@ class RapidshareCom(Hoster): self.id = None self.name = None - - self.chunkLimit = -1 if self.premium else 1 + + self.chunkLimit = -1 if self.premium else 1 self.multiDL = self.resumeDownload = self.premium def process(self, pyfile): - self.url = self.pyfile.url + self.url = self.pyfile.url self.prepare() - + def prepare(self): m = re.search(self.__pattern__, self.url) @@ -96,9 +101,9 @@ class RapidshareCom(Hoster): self.logInfo(_("Rapidshare: Traffic Share (direct download)")) self.pyfile.name = self.get_file_name() - self.download(self.pyfile.url, get={"directstart":1}) - - elif self.api_data["status"] in ("0","4","5"): + self.download(self.pyfile.url, get={"directstart": 1}) + + elif self.api_data["status"] in ("0", "4", "5"): self.offline() elif self.api_data["status"] == "3": self.tempOffline() @@ -116,8 +121,8 @@ class RapidshareCom(Hoster): self.logDebug("RS API Request: %s" % download) self.download(download, ref=False) - check = self.checkDownload({"ip" : "You need RapidPro to download more files from your IP address", - "auth" : "Download auth invalid"}) + check = self.checkDownload({"ip": "You need RapidPro to download more files from your IP address", + "auth": "Download auth invalid"}) if check == "ip": self.setWait(60) self.logInfo(_("Already downloading from this ip address, waiting 60 seconds")) @@ -132,8 +137,7 @@ class RapidshareCom(Hoster): info = self.account.getAccountInfo(self.user, True) self.logDebug("%s: Use Premium Account" % self.__name__) url = self.api_data["mirror"] - self.download(url, get={"directstart":1}) - + self.download(url, get={"directstart": 1}) def download_api_data(self, force=False): """ @@ -148,16 +152,17 @@ class RapidshareCom(Hoster): if src.startswith("ERROR"): return fields = src.split(",") - """ - status codes: - 0=File not found - 1=File OK (Anonymous downloading) - 3=Server down - 4=File marked as illegal - 5=Anonymous file locked, because it has more than 10 downloads already - 50+n=File OK (TrafficShare direct download type "n" without any logging.) - 100+n=File OK (TrafficShare direct download type "n" with logging. Read our privacy policy to see what is logged.) - """ + + # status codes: + # 0=File not found + # 1=File OK (Anonymous downloading) + # 3=Server down + # 4=File marked as illegal + # 5=Anonymous file locked, because it has more than 10 downloads already + # 50+n=File OK (TrafficShare direct download type "n" without any logging.) + # 100+n=File OK (TrafficShare direct download type "n" with logging. + # Read our privacy policy to see what is logged.) + self.api_data = {"fileid": fields[0], "filename": fields[1], "size": int(fields[2]), "serverid": fields[3], "status": fields[4], "shorthost": fields[5], "checksum": fields[6].strip().lower()} @@ -166,7 +171,8 @@ class RapidshareCom(Hoster): elif int(self.api_data["status"]) > 50: self.api_data["status"] = str(int(self.api_data["status"]) - 50) - self.api_data["mirror"] = "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data + self.api_data["mirror"] = \ + "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data def freeWait(self): """downloads html with the important information @@ -176,7 +182,8 @@ class RapidshareCom(Hoster): id = self.id name = self.name - prepare = "https://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=download&fileid=%(id)s&filename=%(name)s&try=1&cbf=RSAPIDispatcher&cbid=1" % {"name": name, "id" : id} + prepare = "https://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=download&fileid=%(id)s&filename=%(name)s&try=1&cbf=RSAPIDispatcher&cbid=1" % { + "name": name, "id": id} self.logDebug("RS API Request: %s" % prepare) result = self.load(prepare, ref=False) @@ -188,7 +195,8 @@ class RapidshareCom(Hoster): self.setWait(60) self.logInfo(_("Already downloading from this ip address, waiting 60 seconds")) self.wait() - elif "Too many users downloading from this server right now" in result or "All free download slots are full" in result: + elif "Too many users downloading from this server right now" in result or \ + "All free download slots are full" in result: self.setWait(120) self.logInfo(_("RapidShareCom: No free slots")) self.wait() @@ -207,19 +215,17 @@ class RapidshareCom(Hoster): data = info.split(",") dl_dict = {"id": id, - "name": name, - "host": data[0], - "auth": data[1], - "server": self.api_data["serverid"], - "size": self.api_data["size"] - } - self.setWait(int(data[2])+2+self.offset) + "name": name, + "host": data[0], + "auth": data[1], + "server": self.api_data["serverid"], + "size": self.api_data["size"]} + self.setWait(int(data[2]) + 2 + self.offset) self.wait() return dl_dict - def get_file_name(self): if self.api_data["filename"]: return self.api_data["filename"] - return self.url.split("/")[-1] \ No newline at end of file + return self.url.split("/")[-1] diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py index a0f5930b5..1ede51953 100644 --- a/module/plugins/hoster/RarefileNet.py +++ b/module/plugins/hoster/RarefileNet.py @@ -27,8 +27,9 @@ class RarefileNet(XFileSharingPro): captcha_div = re.search(r'Enter code.*?(.*?)

    ', self.html, re.S).group(1) self.logDebug(captcha_div) numerals = re.findall('(\d)', html_unescape(captcha_div)) - inputs['code'] = "".join([a[1] for a in sorted(numerals, key = lambda num: int(num[0]))]) + inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))]) self.logDebug("CAPTCHA", inputs['code'], numerals) return 3 + getInfo = create_getInfo(RarefileNet) diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 73baff5b3..fd91b89b7 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -6,10 +6,11 @@ from time import time from urllib import quote, unquote from random import randrange -from module.utils import parseFileSize, remove_chars +from module.utils import parseFileSize from module.common.json_layer import json_loads from module.plugins.Hoster import Hoster + class RealdebridCom(Hoster): __name__ = "RealdebridCom" __version__ = "0.51" @@ -25,8 +26,8 @@ class RealdebridCom(Hoster): name = unquote(url.rsplit("/", 1)[1]) except IndexError: name = "Unknown_Filename..." - if not name or name.endswith(".."): #incomplete filename, append random stuff - name += "%s.tmp" % randrange(100,999) + if not name or name.endswith(".."): # incomplete filename, append random stuff + name += "%s.tmp" % randrange(100, 999) return name def init(self): @@ -34,7 +35,6 @@ class RealdebridCom(Hoster): self.chunkLimit = 3 self.resumeDownload = True - def process(self, pyfile): if not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid") @@ -45,10 +45,13 @@ class RealdebridCom(Hoster): new_url = pyfile.url else: password = self.getPassword().splitlines() - if not password: password = "" - else: password = password[0] + if not password: + password = "" + else: + password = password[0] - url = "http://real-debrid.com/ajax/unrestrict.php?lang=en&link=%s&password=%s&time=%s" % (quote(pyfile.url, ""), password, int(time()*1000)) + url = "http://real-debrid.com/ajax/unrestrict.php?lang=en&link=%s&password=%s&time=%s" % ( + quote(pyfile.url, ""), password, int(time() * 1000)) page = self.load(url) data = json_loads(page) @@ -80,9 +83,8 @@ class RealdebridCom(Hoster): self.download(new_url, disposition=True) check = self.checkDownload( - {"error": "An error occured while processing your request"}) + {"error": "An error occured while processing your request"}) if check == "error": #usual this download can safely be retried self.retry(reason="An error occured while generating link.", wait_time=60) - diff --git a/module/plugins/hoster/RedtubeCom.py b/module/plugins/hoster/RedtubeCom.py index c2083e679..caf33eeac 100644 --- a/module/plugins/hoster/RedtubeCom.py +++ b/module/plugins/hoster/RedtubeCom.py @@ -5,6 +5,7 @@ import re from module.plugins.Hoster import Hoster from module.unescape import unescape + class RedtubeCom(Hoster): __name__ = "RedtubeCom" __type__ = "hoster" @@ -13,15 +14,15 @@ class RedtubeCom(Hoster): __description__ = """Redtube.com Download Hoster""" __author_name__ = ("jeix") __author_mail__ = ("jeix@hasnomail.de") - + def process(self, pyfile): self.download_html() if not self.file_exists(): self.offline() - + pyfile.name = self.get_file_name() self.download(self.get_file_url()) - + def download_html(self): url = self.pyfile.url self.html = self.load(url) @@ -35,12 +36,12 @@ class RedtubeCom(Hoster): file_url = unescape(re.search(r'hashlink=(http.*?)"', self.html).group(1)) return file_url - + def get_file_name(self): if self.html is None: self.download_html() - - name = re.search('(.*?)- RedTube - Free Porn Videos', self.html).group(1).strip() + ".flv" + + name = re.search('(.*?)- RedTube - Free Porn Videos', self.html).group(1).strip() + ".flv" return name def file_exists(self): @@ -48,9 +49,8 @@ class RedtubeCom(Hoster): """ if self.html is None: self.download_html() - + if re.search(r'This video has been removed.', self.html) is not None: return False else: return True - diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py index 7d1b1c3ea..bb6110415 100644 --- a/module/plugins/hoster/RehostTo.py +++ b/module/plugins/hoster/RehostTo.py @@ -4,6 +4,7 @@ from urllib import quote, unquote from module.plugins.Hoster import Hoster + class RehostTo(Hoster): __name__ = "RehostTo" __version__ = "0.13" @@ -34,4 +35,4 @@ class RehostTo(Hoster): #raise timeout to 2min self.req.setOption("timeout", 120) - self.download(new_url, disposition=True) \ No newline at end of file + self.download(new_url, disposition=True) diff --git a/module/plugins/hoster/ReloadCc.py b/module/plugins/hoster/ReloadCc.py index b39c2812c..2295c792a 100644 --- a/module/plugins/hoster/ReloadCc.py +++ b/module/plugins/hoster/ReloadCc.py @@ -1,16 +1,18 @@ -from module.plugins.Hoster import Hoster +from module.plugins.Hoster import Hoster from module.common.json_layer import json_loads from module.network.HTTPRequest import BadHeader + class ReloadCc(Hoster): __name__ = "ReloadCc" __version__ = "0.5" __type__ = "hoster" __description__ = """Reload.Cc hoster plugin""" - # Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady create the regex patterns for us using getHosters in our ReloadCc hook. + # Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady + # create the regex patterns for us using getHosters in our ReloadCc hook. __pattern__ = None __author_name__ = ("Reload Team") @@ -22,8 +24,9 @@ class ReloadCc(Hoster): self.logError(_("Please enter your %s account or deactivate this plugin") % "reload.cc") self.fail("No valid reload.cc account provided") - # In some cases hostsers do not supply us with a filename at download, so we are going to set a fall back filename (e.g. for freakshare or xfileshare) - self.pyfile.name = self.pyfile.name.split('/').pop() # Remove everthing before last slash + # In some cases hostsers do not supply us with a filename at download, so we + # are going to set a fall back filename (e.g. for freakshare or xfileshare) + self.pyfile.name = self.pyfile.name.split('/').pop() # Remove everthing before last slash # Correction for automatic assigned filename: Removing html at end if needed suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"] @@ -62,11 +65,15 @@ class ReloadCc(Hoster): # Wait for 6 hours and retry up to 4 times => one day self.retry(max_retries=4, wait_time=(3600 * 6), reason="Limited hoster traffic limit exceeded") elif e.code == 429: - self.retry(max_retries=5, wait_time=120, reason="Too many concurrent connections") # Too many connections, wait 2 minutes and try again + # Too many connections, wait 2 minutes and try again + self.retry(max_retries=5, wait_time=120, reason="Too many concurrent connections") elif e.code == 503: - self.retry(wait_time=600, reason="Reload.cc is currently in maintenance mode! Please check again later.") # Retry in 10 minutes + # Retry in 10 minutes + self.retry(wait_time=600, + reason="Reload.cc is currently in maintenance mode! Please check again later.") else: - self.fail("Internal error within Reload.cc. Please contact the Reload.cc support for further information.") + self.fail( + "Internal error within Reload.cc. Please contact the Reload.cc support for further information.") return data = json_loads(answer) @@ -95,9 +102,12 @@ class ReloadCc(Hoster): elif e.code == 417: self.fail("Password required for file access") elif e.code == 429: - self.retry(max_retries=5, wait_time=120, reason="Too many concurrent connections") # Too many connections, wait 2 minutes and try again + # Too many connections, wait 2 minutes and try again + self.retry(max_retries=5, wait_time=120, reason="Too many concurrent connections") else: - self.fail("Internal error within Reload.cc. Please contact the Reload.cc support for further information.") + self.fail( + "Internal error within Reload.cc. Please contact the Reload.cc support for further information." + ) return else: self.fail("Internal error within Reload.cc. Please contact the Reload.cc support for further information.") diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 7bfe4e8fe..eff9a6140 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo import re +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + class RyushareCom(XFileSharingPro): __name__ = "RyushareCom" @@ -27,10 +28,10 @@ class RyushareCom(XFileSharingPro): def getDownloadLink(self): self.html = self.load(self.pyfile.url) action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) - if inputs.has_key('method_premium'): + if 'method_premium' in inputs: del inputs['method_premium'] - self.html = self.load(self.pyfile.url, post = inputs) + self.html = self.load(self.pyfile.url, post=inputs) action, inputs = self.parseHtmlForm('F1') for i in xrange(10): @@ -45,11 +46,12 @@ class RyushareCom(XFileSharingPro): self.setWait(waittime) self.wait() - self.html = self.load(self.pyfile.url, post = inputs) + self.html = self.load(self.pyfile.url, post=inputs) if 'Click here to download' in self.html: m = re.search(self.DIRECT_LINK_PATTERN, self.html) return m.group(1) self.parseError('No direct link within 10 retries') + getInfo = create_getInfo(RyushareCom) diff --git a/module/plugins/hoster/SecureUploadEu.py b/module/plugins/hoster/SecureUploadEu.py index b9a900d96..dc220c508 100644 --- a/module/plugins/hoster/SecureUploadEu.py +++ b/module/plugins/hoster/SecureUploadEu.py @@ -15,4 +15,5 @@ class SecureUploadEu(XFileSharingPro): FILE_INFO_PATTERN = '

    Downloading (?P[^<]+) \((?P[^<]+)\)

    ' FILE_OFFLINE_PATTERN = 'The file was removed|File Not Found' + getInfo = create_getInfo(SecureUploadEu) diff --git a/module/plugins/hoster/SendmywayCom.py b/module/plugins/hoster/SendmywayCom.py index fcbac850a..9b4fc14bc 100644 --- a/module/plugins/hoster/SendmywayCom.py +++ b/module/plugins/hoster/SendmywayCom.py @@ -15,4 +15,5 @@ class SendmywayCom(XFileSharingPro): FILE_SIZE_PATTERN = r'\((?P\d+) bytes\)' HOSTER_NAME = "sendmyway.com" + getInfo = create_getInfo(SendmywayCom) diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index 22abaff56..729ee17bc 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/plugins/hoster/SendspaceCom.py @@ -19,6 +19,7 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + class SendspaceCom(SimpleHoster): __name__ = "SendspaceCom" __type__ = "hoster" @@ -33,35 +34,37 @@ class SendspaceCom(SimpleHoster): FILE_OFFLINE_PATTERN = r'
    Sorry, the file you requested is not available.
    ' CAPTCHA_PATTERN = r'' USER_CAPTCHA_PATTERN = r'' - + def handleFree(self): params = {} for i in range(3): found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) if found: - if params.has_key('captcha_hash'): self.correctCaptcha() + if 'captcha_hash' in params: + self.correctCaptcha() download_url = found.group(1) break found = re.search(self.CAPTCHA_PATTERN, self.html) if found: - if params.has_key('captcha_hash'): self.invalidCaptcha() + if 'captcha_hash' in params: + self.invalidCaptcha() captcha_url1 = "http://www.sendspace.com/" + found.group(1) found = re.search(self.USER_CAPTCHA_PATTERN, self.html) captcha_url2 = "http://www.sendspace.com/" + found.group(1) - params = {'captcha_hash' : found.group(2), + params = {'captcha_hash': found.group(2), 'captcha_submit': 'Verify', - 'captcha_answer': self.decryptCaptcha(captcha_url1) + " " + self.decryptCaptcha(captcha_url2) - } + 'captcha_answer': self.decryptCaptcha(captcha_url1) + " " + self.decryptCaptcha(captcha_url2)} else: params = {'download': "Regular Download"} self.logDebug(params) - self.html = self.load(self.pyfile.url, post = params) + self.html = self.load(self.pyfile.url, post=params) else: self.fail("Download link not found") self.logDebug("Download URL: %s" % download_url) self.download(download_url) -create_getInfo(SendspaceCom) \ No newline at end of file + +create_getInfo(SendspaceCom) diff --git a/module/plugins/hoster/Share4webCom.py b/module/plugins/hoster/Share4webCom.py index ef9c2acf8..ead808024 100644 --- a/module/plugins/hoster/Share4webCom.py +++ b/module/plugins/hoster/Share4webCom.py @@ -3,6 +3,7 @@ from module.plugins.hoster.UnibytesCom import UnibytesCom from module.plugins.internal.SimpleHoster import create_getInfo + class Share4webCom(UnibytesCom): __name__ = "Share4webCom" __type__ = "hoster" @@ -10,7 +11,8 @@ class Share4webCom(UnibytesCom): __version__ = "0.1" __description__ = """Share4web.com""" __author_name__ = ("zoidberg") - + DOMAIN = 'http://www.share4web.com' -getInfo = create_getInfo(UnibytesCom) \ No newline at end of file + +getInfo = create_getInfo(UnibytesCom) diff --git a/module/plugins/hoster/Share76Com.py b/module/plugins/hoster/Share76Com.py index db850cb73..aaa8cd950 100644 --- a/module/plugins/hoster/Share76Com.py +++ b/module/plugins/hoster/Share76Com.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + class Share76Com(XFileSharingPro): __name__ = "Share76Com" __type__ = "hoster" @@ -16,4 +17,5 @@ class Share76Com(XFileSharingPro): self.resumeDownload = self.multiDL = self.premium self.chunkLimit = 1 + getInfo = create_getInfo(Share76Com) diff --git a/module/plugins/hoster/ShareFilesCo.py b/module/plugins/hoster/ShareFilesCo.py index ee44b0a1f..245e20ea6 100644 --- a/module/plugins/hoster/ShareFilesCo.py +++ b/module/plugins/hoster/ShareFilesCo.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo import re +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + + class ShareFilesCo(XFileSharingPro): __name__ = "ShareFilesCo" __type__ = "hoster" @@ -17,8 +19,10 @@ class ShareFilesCo(XFileSharingPro): link = link.strip() if link.startswith('http://adf.ly'): link = re.sub('http://adf.ly/\d+/', '', link) - if self.captcha: self.correctCaptcha() + if self.captcha: + self.correctCaptcha() self.logDebug('DIRECT LINK: %s' % link) self.download(link) + getInfo = create_getInfo(ShareFilesCo) diff --git a/module/plugins/hoster/ShareRapidCom.py b/module/plugins/hoster/ShareRapidCom.py index 5a08fed1f..42bdaa4e3 100644 --- a/module/plugins/hoster/ShareRapidCom.py +++ b/module/plugins/hoster/ShareRapidCom.py @@ -8,8 +8,9 @@ from module.network.HTTPRequest import BadHeader from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo from module.common.json_layer import json_loads -def checkFile(url): - response = getURL("http://share-rapid.com/checkfiles.php", post = {"files": url}, decode = True) + +def checkFile(url): + response = getURL("http://share-rapid.com/checkfiles.php", post={"files": url}, decode=True) info = json_loads(response) if "error" in info: @@ -17,28 +18,30 @@ def checkFile(url): info['name'] = info['filename'] info['status'] = 2 elif info['msg'] == "Not found": - info['status'] = 1 #offline + info['status'] = 1 # offline elif info['msg'] == "Service Unavailable": - info['status'] = 6 #temp.offline + info['status'] = 6 # temp.offline return info - + + def getInfo(urls): for url in urls: info = checkFile(url) if "filename" in info: yield info['name'], info['size'], info['status'], url - else: + else: file_info = (url, 0, 3, url) h = getRequest() try: h.c.setopt(HTTPHEADER, ["Accept: text/html"]) - html = h.load(url, cookies = True, decode = True) - file_info = parseFileInfo(ShareRapidCom, url, html) + html = h.load(url, cookies=True, decode=True) + file_info = parseFileInfo(ShareRapidCom, url, html) finally: h.close() yield file_info + class ShareRapidCom(SimpleHoster): __name__ = "ShareRapidCom" __type__ = "hoster" @@ -51,11 +54,11 @@ class ShareRapidCom(SimpleHoster): FILE_NAME_PATTERN = r']*>]*>(?:]*>)?(?P[^<]+)' FILE_SIZE_PATTERN = r'Velikost:\s*\s*(?P[0-9.]+) (?P[kKMG])i?B' FILE_OFFLINE_PATTERN = ur'Nastala chyba 404|Soubor byl smazán' - + DOWNLOAD_URL_PATTERN = r'([^<]+)' ERR_LOGIN_PATTERN = ur'
    Stahování je přístupné pouze přihlášeným uživatelům' ERR_CREDIT_PATTERN = ur'
    Stahování zdarma je možné jen přes náš' - + FILE_URL_REPLACEMENTS = [(__pattern__, r'http://share-rapid.com/stahuj/\1')] def setup(self): @@ -63,23 +66,24 @@ class ShareRapidCom(SimpleHoster): self.resumeDownload = True def process(self, pyfile): - if not self.account: self.fail("User not logged in") - + if not self.account: + self.fail("User not logged in") + self.info = checkFile(pyfile.url) self.logDebug(self.info) - - pyfile.status = self.info['status'] - + + pyfile.status = self.info['status'] + if pyfile.status == 2: pyfile.name = self.info['name'] pyfile.size = self.info['size'] - elif pyfile.status == 1: + elif pyfile.status == 1: self.offline() elif pyfile.status == 6: self.tempOffline() else: self.fail("Unexpected file status") - + url = "http://share-rapid.com/stahuj/%s" % self.info['filepath'] try: self.html = self.load(url, decode=True) @@ -89,15 +93,15 @@ class ShareRapidCom(SimpleHoster): found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) if found is not None: - link = found.group(1) + link = found.group(1) self.logDebug("Premium link: %s" % link) - + self.check_data = {"size": pyfile.size} self.download(link) else: if re.search(self.ERR_LOGIN_PATTERN, self.html): self.relogin(self.user) - self.retry(3,0,"User login failed") + self.retry(3, 0, "User login failed") elif re.search(self.ERR_CREDIT_PATTERN, self.html): self.fail("Not enough credit left") else: diff --git a/module/plugins/hoster/SharebeesCom.py b/module/plugins/hoster/SharebeesCom.py index f5bacc5b0..cc1173fea 100644 --- a/module/plugins/hoster/SharebeesCom.py +++ b/module/plugins/hoster/SharebeesCom.py @@ -16,4 +16,5 @@ class SharebeesCom(XFileSharingPro): FORM_PATTERN = 'F1' HOSTER_NAME = "sharebees.com" + getInfo = create_getInfo(SharebeesCom) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 8a4bcfba8..7c0f9c069 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -11,33 +11,38 @@ from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL from module.plugins.Plugin import chunks from module.plugins.internal.CaptchaService import ReCaptcha as _ReCaptcha - + + def getInfo(urls): api_url_base = "http://api.share-online.biz/linkcheck.php" - + for chunk in chunks(urls, 90): - api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","").rstrip("/") for x in chunk)} #api only supports old style links + api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/", "").rstrip("/") for x in + chunk)} # api only supports old style links src = getURL(api_url_base, post=api_param_file, decode=True) result = [] for i, res in enumerate(src.split("\n")): if not res: continue fields = res.split(";") - + if fields[1] == "OK": status = 2 elif fields[1] in ("DELETED", "NOT FOUND"): status = 1 else: status = 3 - + result.append((fields[2], int(fields[3]), status, chunk[i])) yield result + #suppress ocr plugin class ReCaptcha(_ReCaptcha): def result(self, server, challenge): - return self.plugin.decryptCaptcha("%simage"%server, get={"c":challenge}, cookies=True, forceUser=True, imgtype="jpg") + return self.plugin.decryptCaptcha("%simage" % server, get={"c": challenge}, + cookies=True, forceUser=True, imgtype="jpg") + class ShareonlineBiz(Hoster): __name__ = "ShareonlineBiz" @@ -47,7 +52,7 @@ class ShareonlineBiz(Hoster): __description__ = """Shareonline.biz Download Hoster""" __author_name__ = ("spoob", "mkaay", "zoidberg") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz") - + ERROR_INFO_PATTERN = r'

    Information:

    \s*
    \s*(.*?)' def setup(self): @@ -60,133 +65,134 @@ class ShareonlineBiz(Hoster): self.resumeDownload = self.premium self.multiDL = False #self.chunkLimit = 1 - + self.check_data = None - def process(self, pyfile): + def process(self, pyfile): if self.premium: self.handleAPIPremium() #web-download fallback removed - didn't work anyway else: self.handleFree() - - """ - check = self.checkDownload({"failure": re.compile(self.ERROR_INFO_PATTERN)}) - if check == "failure": - try: - self.retry(reason = self.lastCheck.group(1).decode("utf8")) - except: - self.retry(reason = "Unknown error") - """ - - if self.api_data: + + # check = self.checkDownload({"failure": re.compile(self.ERROR_INFO_PATTERN)}) + # if check == "failure": + # try: + # self.retry(reason = self.lastCheck.group(1).decode("utf8")) + # except: + # self.retry(reason = "Unknown error") + + if self.api_data: self.check_data = {"size": int(self.api_data['size']), "md5": self.api_data['md5']} def downloadAPIData(self): api_url_base = "http://api.share-online.biz/linkcheck.php?md5=1" - api_param_file = {"links": self.pyfile.url.replace("http://www.share-online.biz/dl/","")} #api only supports old style links + api_param_file = {"links": self.pyfile.url.replace( + "http://www.share-online.biz/dl/", "")} # api only supports old style links src = self.load(api_url_base, cookies=False, post=api_param_file, decode=True) - + fields = src.split(";") self.api_data = {"fileid": fields[0], "status": fields[1]} if not self.api_data["status"] == "OK": self.offline() self.api_data["filename"] = fields[2] - self.api_data["size"] = fields[3] # in bytes - self.api_data["md5"] = fields[4].strip().lower().replace("\n\n", "") # md5 + self.api_data["size"] = fields[3] # in bytes + self.api_data["md5"] = fields[4].strip().lower().replace("\n\n", "") # md5 - def handleFree(self): + def handleFree(self): self.downloadAPIData() self.pyfile.name = self.api_data["filename"] self.pyfile.size = int(self.api_data["size"]) - - self.html = self.load(self.pyfile.url, cookies = True) #refer, stuff + + self.html = self.load(self.pyfile.url, cookies=True) # refer, stuff self.setWait(3) self.wait() - - self.html = self.load("%s/free/" % self.pyfile.url, post={"dl_free":"1", "choice": "free"}, decode = True) + + self.html = self.load("%s/free/" % self.pyfile.url, post={"dl_free": "1", "choice": "free"}, decode=True) self.checkErrors() - - found = re.search(r'var wait=(\d+);', self.html) - + + found = re.search(r'var wait=(\d+);', self.html) + recaptcha = ReCaptcha(self) - for i in range(5): - challenge, response = recaptcha.challenge("6LdatrsSAAAAAHZrB70txiV5p-8Iv8BtVxlTtjKX") - self.setWait(int(found.group(1)) if found else 30) - response = self.load("%s/free/captcha/%d" % (self.pyfile.url, int(time() * 1000)), post = { + for i in range(5): + challenge, response = recaptcha.challenge("6LdatrsSAAAAAHZrB70txiV5p-8Iv8BtVxlTtjKX") + self.setWait(int(found.group(1)) if found else 30) + response = self.load("%s/free/captcha/%d" % (self.pyfile.url, int(time() * 1000)), post={ 'dl_free': '1', 'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response}) - + if not response == '0': break - else: self.fail("No valid captcha solution received") - + else: + self.fail("No valid captcha solution received") + download_url = response.decode("base64") self.logDebug(download_url) if not download_url.startswith("http://"): self.parseError("download url") - - self.wait() + + self.wait() self.download(download_url) # check download check = self.checkDownload({ "cookie": re.compile(r'
    Share-Online") - }) + }) if check == "cookie": self.retry(5, 60, "Cookie failure") elif check == "fail": self.retry(5, 300, "Download failed") - + def checkErrors(self): found = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL) if found: err = found.group(1) found = re.search(self.ERROR_INFO_PATTERN, self.html) msg = found.group(1) if found else "" - self.logError(err, msg or "Unknown error occurred") - + self.logError(err, msg or "Unknown error occurred") + if err in ('freelimit', 'size', 'proxy'): self.fail(msg or "Premium account needed") - if err in ('invalid'): + if err in 'invalid': self.fail(msg or "File not available") - elif err in ('server'): + elif err in 'server': self.setWait(600, False) - elif err in ('expired'): + elif err in 'expired': self.setWait(30, False) - else: + else: self.setWait(300, True) - + self.wait() - self.retry(max_tries=25, reason = msg) - - def handleAPIPremium(self): #should be working better + self.retry(max_tries=25, reason=msg) + + def handleAPIPremium(self): # should be working better self.account.getAccountInfo(self.user, True) src = self.load("http://api.share-online.biz/account.php", - {"username": self.user, "password": self.account.accounts[self.user]["password"], "act": "download", "lid": self.file_id}) + {"username": self.user, "password": self.account.accounts[self.user]["password"], + "act": "download", "lid": self.file_id}) self.api_data = dlinfo = {} for line in src.splitlines(): key, value = line.split(": ") dlinfo[key.lower()] = value - + self.logDebug(dlinfo) if not dlinfo["status"] == "online": self.offline() - + self.pyfile.name = dlinfo["name"] self.pyfile.size = int(dlinfo["size"]) - + dlLink = dlinfo["url"] if dlLink == "server_under_maintenance": self.tempoffline() else: self.multiDL = True self.download(dlLink) - + def checksum(self, local_file): if self.api_data and "md5" in self.api_data and self.api_data["md5"]: h = hashlib.md5() diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py index c55f6703a..5f23f9708 100644 --- a/module/plugins/hoster/ShareplaceCom.py +++ b/module/plugins/hoster/ShareplaceCom.py @@ -5,6 +5,7 @@ import re import urllib from module.plugins.Hoster import Hoster + class ShareplaceCom(Hoster): __name__ = "ShareplaceCom" __type__ = "hoster" @@ -18,35 +19,35 @@ class ShareplaceCom(Hoster): self.html = None self.multiDL = True - def process(self,pyfile): + def process(self, pyfile): self.pyfile = pyfile self.prepare() self.download(self.get_file_url()) - + def prepare(self): if not self.file_exists(): self.offline() self.pyfile.name = self.get_file_name() - + wait_time = self.get_waiting_time() self.setWait(wait_time) - self.logDebug("%s: Waiting %d seconds." % (self.__name__,wait_time)) + self.logDebug("%s: Waiting %d seconds." % (self.__name__, wait_time)) self.wait() def get_waiting_time(self): if self.html is None: self.download_html() - + #var zzipitime = 15; m = re.search(r'var zzipitime = (\d+);', self.html) if m: sec = int(m.group(1)) else: sec = 0 - + return sec - + def download_html(self): url = re.sub("shareplace.com\/\?", "shareplace.com//index1.php/?a=", self.pyfile.url) self.html = self.load(url, decode=True) @@ -57,12 +58,14 @@ class ShareplaceCom(Hoster): url = re.search(r"var beer = '(.*?)';", self.html) if url: url = url.group(1) - url = urllib.unquote(url.replace("http://http:/", "").replace("vvvvvvvvv", "").replace("lllllllll", "").replace("teletubbies", "")) + url = urllib.unquote( + url.replace("http://http:/", "").replace("vvvvvvvvv", "").replace("lllllllll", "").replace( + "teletubbies", "")) self.logDebug("URL: %s" % url) return url else: self.fail("absolute filepath could not be found. offline? ") - + def get_file_name(self): if self.html is None: self.download_html() @@ -74,11 +77,8 @@ class ShareplaceCom(Hoster): """ if self.html is None: self.download_html() - + if re.search(r"HTTP Status 404", self.html) is not None: return False else: return True - - - diff --git a/module/plugins/hoster/ShragleCom.py b/module/plugins/hoster/ShragleCom.py index f21ad213d..2a2738974 100644 --- a/module/plugins/hoster/ShragleCom.py +++ b/module/plugins/hoster/ShragleCom.py @@ -11,29 +11,30 @@ from module.network.RequestFactory import getURL API_KEY = "078e5ca290d728fd874121030efb4a0d" + def parseFileInfo(self, url): file_id = re.match(self.__pattern__, url).group('ID') - - data = getURL( - "http://www.cloudnator.com/api.php?key=%s&action=getStatus&fileID=%s" % (API_KEY, file_id), - decode = True - ).split() - + + data = getURL("http://www.cloudnator.com/api.php?key=%s&action=getStatus&fileID=%s" % (API_KEY, file_id), + decode=True).split() + if len(data) == 4: name, size, md5, status = data size = int(size) - + if hasattr(self, "check_data"): - self.checkdata = {"size": size, "md5": md5} - + self.checkdata = {"size": size, "md5": md5} + return name, size, 2 if status == "0" else 1, url else: return url, 0, 1, url + def getInfo(urls): for url in urls: file_info = parseFileInfo(ShragleCom, url) - yield file_info + yield file_info + class ShragleCom(Hoster): __name__ = "ShragleCom" @@ -48,38 +49,38 @@ class ShragleCom(Hoster): self.html = None self.multiDL = False self.check_data = None - + def process(self, pyfile): #get file status and info self.pyfile.name, self.pyfile.size, status = parseFileInfo(self, pyfile.url)[:3] - if status != 2: + if status != 2: self.offline() - + self.handleFree() - + def handleFree(self): self.html = self.load(self.pyfile.url) - + #get wait time found = re.search('\s*var\sdownloadWait\s=\s(\d+);', self.html) self.setWait(int(found.group(1)) if found else 30) - + #parse download form action, inputs = parseHtmlForm('id="download', self.html) - + #solve captcha found = re.search('recaptcha/api/(?:challenge|noscript)?k=(.+?)', self.html) captcha_key = found.group(1) if found else "6LdEFb0SAAAAAAwM70vnYo2AkiVkCx-xmfniatHz" - + recaptcha = ReCaptcha(self) - + inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) self.wait() - + #validate self.req.http.c.setopt(FOLLOWLOCATION, 0) - self.html = self.load(action, post = inputs) - + self.html = self.load(action, post=inputs) + found = re.search(r"Location\s*:\s*(\S*)", self.req.http.header, re.I) if found: self.correctCaptcha() @@ -87,20 +88,18 @@ class ShragleCom(Hoster): else: if "Sicherheitscode falsch" in self.html: self.invalidCaptcha() - self.retry(max_tries = 5, reason = "Invalid captcha") + self.retry(max_tries=5, reason="Invalid captcha") else: self.fail("Invalid session") - + #download self.req.http.c.setopt(FOLLOWLOCATION, 1) self.download(download_url) - + check = self.checkDownload({ "ip_blocked": re.compile(r'
    Str.nku nebylo mo.n. nal.zt \(404\)' FILE_NAME_PATTERN = r'' CDN_PATTERN = r'\d+)(?:&cdnLQ=(?P\d*))?(?:&cdnHQ=(?P\d*))?(?:&cdnHD=(?P\d*))?&' @@ -49,28 +51,30 @@ class StreamCz(Hoster): self.multiDL = True self.resumeDownload = True - def process(self, pyfile): - + def process(self, pyfile): + self.html = self.load(pyfile.url, decode=True) - - if re.search(self.FILE_OFFLINE_PATTERN, self.html): + + if re.search(self.FILE_OFFLINE_PATTERN, self.html): self.offline() - + found = re.search(self.CDN_PATTERN, self.html) - if found is None: self.fail("Parse error (CDN)") + if found is None: + self.fail("Parse error (CDN)") cdn = found.groupdict() self.logDebug(cdn) for cdnkey in ("cdnHD", "cdnHQ", "cdnLQ"): - if cdn.has_key(cdnkey) and cdn[cdnkey] > '': + if cdnkey in cdn and cdn[cdnkey] > '': cdnid = cdn[cdnkey] break - else: + else: self.fail("Stream URL not found") - + found = re.search(self.FILE_NAME_PATTERN, self.html) - if found is None: self.fail("Parse error (NAME)") + if found is None: + self.fail("Parse error (NAME)") pyfile.name = "%s-%s.%s.mp4" % (found.group(2), found.group(1), cdnkey[-2:]) - + download_url = "http://cdn-dispatcher.stream.cz/?id=" + cdnid self.logInfo("STREAM (%s): %s" % (cdnkey[-2:], download_url)) self.download(download_url) diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 73c0465f8..dd9bf9429 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo -from module.network.HTTPRequest import HTTPRequest from time import sleep import re +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo +from module.network.HTTPRequest import HTTPRequest + + class StreamcloudEu(XFileSharingPro): __name__ = "StreamcloudEu" __type__ = "hoster" @@ -31,7 +33,7 @@ class StreamcloudEu(XFileSharingPro): httpRequest = HTTPRequest(options=self.req.options) httpRequest.cj = self.req.cj sleep(10) - self.html = httpRequest.load(self.pyfile.url, post = data, referer=False, cookies=True, decode = True) + self.html = httpRequest.load(self.pyfile.url, post=data, referer=False, cookies=True, decode=True) self.header = httpRequest.header found = re.search("Location\s*:\s*(.*)", self.header, re.I) @@ -52,9 +54,10 @@ class StreamcloudEu(XFileSharingPro): def getPostParameters(self): for i in range(3): - if not self.errmsg: self.checkErrors() + if not self.errmsg: + self.checkErrors() - if hasattr(self,"FORM_PATTERN"): + if hasattr(self, "FORM_PATTERN"): action, inputs = self.parseHtmlForm(self.FORM_PATTERN) else: action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) @@ -86,7 +89,8 @@ class StreamcloudEu(XFileSharingPro): self.captcha = self.handleCaptcha(inputs) - if wait_time: self.wait() + if wait_time: + self.wait() self.errmsg = None self.logDebug("getPostParameters {0}".format(i)) @@ -97,15 +101,18 @@ class StreamcloudEu(XFileSharingPro): if self.premium: inputs['method_premium'] = "Premium Download" - if 'method_free' in inputs: del inputs['method_free'] + if 'method_free' in inputs: + del inputs['method_free'] else: inputs['method_free'] = "Free Download" - if 'method_premium' in inputs: del inputs['method_premium'] + if 'method_premium' in inputs: + del inputs['method_premium'] - self.html = self.load(self.pyfile.url, post = inputs, ref = False) + self.html = self.load(self.pyfile.url, post=inputs, ref=False) self.errmsg = None - else: self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) + else: + self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) getInfo = create_getInfo(StreamcloudEu) diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 4e7eb81c2..5fe42bba7 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -23,14 +23,14 @@ import re import random from urllib import quote from binascii import hexlify, unhexlify -from Crypto.Cipher import ARC4 import time +from pycurl import HTTPHEADER +from Crypto.Cipher import ARC4 from module.network.RequestFactory import getURL from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp from module.plugins.internal.CaptchaService import ReCaptcha -from pycurl import HTTPHEADER class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" @@ -41,10 +41,12 @@ class TurbobitNet(SimpleHoster): __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - FILE_INFO_PATTERN = r"\w+).*", "http://turbobit.net/\g.html")] + FILE_URL_REPLACEMENTS = [(r"http://(?:\w*\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P\w+).*", + "http://turbobit.net/\g.html")] SH_COOKIES = [("turbobit.net", "user_lang", "en")] CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' @@ -59,7 +61,7 @@ class TurbobitNet(SimpleHoster): rtUpdate = self.getRtUpdate() self.solveCaptcha() - self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) + self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) self.url = self.getDownloadUrl(rtUpdate) self.wait() @@ -67,7 +69,7 @@ class TurbobitNet(SimpleHoster): self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With:"]) self.downloadFile() - def solveCaptcha(self): + def solveCaptcha(self): for i in range(5): found = re.search(self.LIMIT_WAIT_PATTERN, self.html) if found: @@ -77,41 +79,47 @@ class TurbobitNet(SimpleHoster): self.retry() action, inputs = self.parseHtmlForm("action='#'") - if not inputs: self.parseError("captcha form") + if not inputs: + self.parseError("captcha form") self.logDebug(inputs) if inputs['captcha_type'] == 'recaptcha': recaptcha = ReCaptcha(self) found = re.search(self.CAPTCHA_KEY_PATTERN, self.html) captcha_key = found.group(1) if found else '6LcTGLoSAAAAAHCWY9TTIrQfjUlxu6kZlTYP50_c' - inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) + inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge( + captcha_key) else: found = re.search(self.CAPTCHA_SRC_PATTERN, self.html) - if not found: self.parseError('captcha') + if not found: + self.parseError('captcha') captcha_url = found.group(1) inputs['captcha_response'] = self.decryptCaptcha(captcha_url) self.logDebug(inputs) - self.html = self.load(self.url, post = inputs) + self.html = self.load(self.url, post=inputs) if not "
    " in self.html: self.invalidCaptcha() else: self.correctCaptcha() break - else: self.fail("Invalid captcha") + else: + self.fail("Invalid captcha") def getRtUpdate(self): rtUpdate = self.getStorage("rtUpdate") if not rtUpdate: - if self.getStorage("version") != self.__version__ or int(self.getStorage("timestamp", 0)) + 86400000 < timestamp(): + if self.getStorage("version") != self.__version__ or int( + self.getStorage("timestamp", 0)) + 86400000 < timestamp(): # that's right, we are even using jdownloader updates rtUpdate = getURL("http://update0.jdownloader.org/pluginstuff/tbupdate.js") rtUpdate = self.decrypt(rtUpdate.splitlines()[1]) # but we still need to fix the syntax to work with other engines than rhino - rtUpdate = re.sub(r'for each\(var (\w+) in(\[[^\]]+\])\)\{',r'zza=\2;for(var zzi=0;zzi]+)", self.html) - url = "http://turbobit.net%s%s" % (found.groups() if found else ('/files/timeout.js?ver=', ''.join(random.choice('0123456789ABCDEF') for x in range(32)))) + url = "http://turbobit.net%s%s" % (found.groups() if found else ( + '/files/timeout.js?ver=', ''.join(random.choice('0123456789ABCDEF') for x in range(32)))) fun = self.load(url) self.setWait(65, False) - for b in [1,3]: - self.jscode = "var id = \'%s\';var b = %d;var inn = \'%s\';%sout" % (self.file_info['ID'], b, quote(fun), rtUpdate) - + for b in [1, 3]: + self.jscode = "var id = \'%s\';var b = %d;var inn = \'%s\';%sout" % ( + self.file_info['ID'], b, quote(fun), rtUpdate) + try: out = self.js.eval(self.jscode) self.logDebug("URL", self.js.engine, out) @@ -150,11 +160,11 @@ class TurbobitNet(SimpleHoster): def decrypt(self, data): cipher = ARC4.new(hexlify('E\x15\xa1\x9e\xa3M\xa0\xc6\xa0\x84\xb6H\x83\xa8o\xa0')) return unhexlify(cipher.encrypt(unhexlify(data))) - + def getLocalTimeString(self): lt = time.localtime() - tz = time.altzone if lt.tm_isdst else time.timezone - return "%s GMT%+03d%02d" % (time.strftime("%a %b %d %Y %H:%M:%S", lt), -tz // 3600, tz % 3600) + tz = time.altzone if lt.tm_isdst else time.timezone + return "%s GMT%+03d%02d" % (time.strftime("%a %b %d %Y %H:%M:%S", lt), -tz // 3600, tz % 3600) def handlePremium(self): self.logDebug("Premium download as user %s" % self.user) @@ -162,9 +172,11 @@ class TurbobitNet(SimpleHoster): def downloadFile(self): found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) - if not found: self.parseError("download link") + if not found: + self.parseError("download link") self.url = "http://turbobit.net" + found.group('url') self.logDebug(self.url) self.download(self.url) + getInfo = create_getInfo(TurbobitNet) diff --git a/module/plugins/hoster/TurbouploadCom.py b/module/plugins/hoster/TurbouploadCom.py index 6e81c6319..12dad7906 100644 --- a/module/plugins/hoster/TurbouploadCom.py +++ b/module/plugins/hoster/TurbouploadCom.py @@ -18,8 +18,7 @@ import re from module.plugins.internal.DeadHoster import DeadHoster as EasybytezCom, create_getInfo -#from module.plugins.internal.SimpleHoster import create_getInfo -#from module.plugins.hoster.EasybytezCom import EasybytezCom + class TurbouploadCom(EasybytezCom): __name__ = "TurbouploadCom" @@ -29,17 +28,19 @@ class TurbouploadCom(EasybytezCom): __description__ = """turboupload.com""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - + # shares code with EasybytezCom - + DIRECT_LINK_PATTERN = r'\1' def handleFree(self): - self.html = self.load(self.pyfile.url, post = self.getPostParameters(), ref = True, cookies = True) + self.html = self.load(self.pyfile.url, post=self.getPostParameters(), ref=True, cookies=True) found = re.search(self.DIRECT_LINK_PATTERN, self.html) - if not found: self.parseError('Download Link') + if not found: + self.parseError('Download Link') url = found.group(1) self.logDebug('URL: ' + url) self.download(url) -getInfo = create_getInfo(TurbouploadCom) \ No newline at end of file + +getInfo = create_getInfo(TurbouploadCom) diff --git a/module/plugins/hoster/TusfilesNet.py b/module/plugins/hoster/TusfilesNet.py index 517df8561..a155439b2 100644 --- a/module/plugins/hoster/TusfilesNet.py +++ b/module/plugins/hoster/TusfilesNet.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + class TusfilesNet(XFileSharingPro): __name__ = "TusfilesNet" __type__ = "hoster" @@ -15,4 +16,5 @@ class TusfilesNet(XFileSharingPro): HOSTER_NAME = "tusfiles.net" + getInfo = create_getInfo(TusfilesNet) diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 8401e0cb0..5d1cd835b 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -1,9 +1,11 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo import re +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + class TwoSharedCom(SimpleHoster): __name__ = "TwoSharedCom" __type__ = "hoster" @@ -17,17 +19,18 @@ class TwoSharedCom(SimpleHoster): FILE_SIZE_PATTERN = r'File size:\s*(?P[0-9,.]+) (?P[kKMG])i?B' FILE_OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' DOWNLOAD_URL_PATTERN = r"window.location ='([^']+)';" - + def setup(self): self.resumeDownload = self.multiDL = True - def handleFree(self): + def handleFree(self): found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) - if not found: self.parseError('Download link') + if not found: + self.parseError('Download link') link = found.group(1) self.logDebug("Download URL %s" % link) - + self.download(link) + getInfo = create_getInfo(TwoSharedCom) - \ No newline at end of file diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index 1c3891eb1..fe0bc671e 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -19,9 +19,11 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + def convertDecimalPrefix(m): # decimal prefixes used in filesize and traffic - return ("%%.%df" % {'k':3,'M':6,'G':9}[m.group(2)] % float(m.group(1))).replace('.','') + return ("%%.%df" % {'k': 3, 'M': 6, 'G': 9}[m.group(2)] % float(m.group(1))).replace('.', '') + class UlozTo(SimpleHoster): __name__ = "UlozTo" @@ -44,20 +46,20 @@ class UlozTo(SimpleHoster): PREMIUM_URL_PATTERN = r'
    \s*
  • Error rewriting the text.
  • '), "offline": re.compile(self.FILE_OFFLINE_PATTERN), "passwd": self.PASSWD_PATTERN, - "server_error": 'src="http://img.ulozto.cz/error403/vykricnik.jpg"', #paralell dl, server overload etc. + "server_error": 'src="http://img.ulozto.cz/error403/vykricnik.jpg"', # paralell dl, server overload etc. "not_found": "Ulož.to" }) @@ -153,4 +154,5 @@ class UlozTo(SimpleHoster): elif check == "not_found": self.fail("Server error - file not downloadable") + getInfo = create_getInfo(UlozTo) diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py index c607e7a5b..7060dff65 100644 --- a/module/plugins/hoster/UloziskoSk.py +++ b/module/plugins/hoster/UloziskoSk.py @@ -19,6 +19,7 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError + class UloziskoSk(SimpleHoster): __name__ = "UloziskoSk" __type__ = "hoster" @@ -38,7 +39,7 @@ class UloziskoSk(SimpleHoster): def process(self, pyfile): self.html = self.load(pyfile.url, decode=True) self.getFileInfo() - + found = re.search(self.IMG_PATTERN, self.html) if found: url = "http://ulozisko.sk" + found.group(1) @@ -48,17 +49,20 @@ class UloziskoSk(SimpleHoster): def handleFree(self): found = re.search(self.URL_PATTERN, self.html) - if found is None: raise PluginParseError('URL') + if found is None: + raise PluginParseError('URL') parsed_url = 'http://www.ulozisko.sk' + found.group(1) found = re.search(self.ID_PATTERN, self.html) - if found is None: raise PluginParseError('ID') + if found is None: + raise PluginParseError('ID') id = found.group(1) self.logDebug('URL:' + parsed_url + ' ID:' + id) found = re.search(self.CAPTCHA_PATTERN, self.html) - if found is None: raise PluginParseError('CAPTCHA') + if found is None: + raise PluginParseError('CAPTCHA') captcha_url = 'http://www.ulozisko.sk' + found.group(1) captcha = self.decryptCaptcha(captcha_url, cookies=True) @@ -72,4 +76,5 @@ class UloziskoSk(SimpleHoster): "but": "++++STIAHNI+S%DABOR++++" }) + getInfo = create_getInfo(UloziskoSk) diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index 3c8552271..d13f01ef3 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -20,6 +20,7 @@ import re from pycurl import FOLLOWLOCATION from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + class UnibytesCom(SimpleHoster): __name__ = "UnibytesCom" __type__ = "hoster" @@ -30,28 +31,28 @@ class UnibytesCom(SimpleHoster): FILE_INFO_PATTERN = r']*?id="fileName"[^>]*>(?P[^>]+)\s*\((?P\d.*?)\)' DOMAIN = 'http://www.unibytes.com' - + WAIT_PATTERN = r'Wait for (\d+) sec' DOWNLOAD_LINK_PATTERN = r'Download' def handleFree(self): - action, post_data = self.parseHtmlForm('id="startForm"') + action, post_data = self.parseHtmlForm('id="startForm"') self.req.http.c.setopt(FOLLOWLOCATION, 0) - + for i in range(8): self.logDebug(action, post_data) - self.html = self.load(self.DOMAIN + action, post = post_data) - + self.html = self.load(self.DOMAIN + action, post=post_data) + found = re.search(r'location:\s*(\S+)', self.req.http.header, re.I) if found: url = found.group(1) break - - if '>Somebody else is already downloading using your IP-address<' in self.html: + + if '>Somebody else is already downloading using your IP-address<' in self.html: self.setWait(600, True) self.wait() self.retry() - + if post_data['step'] == 'last': found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) if found: @@ -60,21 +61,22 @@ class UnibytesCom(SimpleHoster): break else: self.invalidCaptcha() - - last_step = post_data['step'] + + last_step = post_data['step'] action, post_data = self.parseHtmlForm('id="stepForm"') - - if last_step == 'timer': + + if last_step == 'timer': found = re.search(self.WAIT_PATTERN, self.html) self.setWait(int(found.group(1)) if found else 60, False) - self.wait() + self.wait() elif last_step in ('captcha', 'last'): post_data['captcha'] = self.decryptCaptcha(self.DOMAIN + '/captcha.jpg') else: - self.fail("No valid captcha code entered") - + self.fail("No valid captcha code entered") + self.logDebug('Download link: ' + url) - self.req.http.c.setopt(FOLLOWLOCATION, 1) - self.download(url) + self.req.http.c.setopt(FOLLOWLOCATION, 1) + self.download(url) + -getInfo = create_getInfo(UnibytesCom) \ No newline at end of file +getInfo = create_getInfo(UnibytesCom) diff --git a/module/plugins/hoster/UploadStationCom.py b/module/plugins/hoster/UploadStationCom.py index 96dc7b577..2831facac 100644 --- a/module/plugins/hoster/UploadStationCom.py +++ b/module/plugins/hoster/UploadStationCom.py @@ -2,6 +2,7 @@ from module.plugins.hoster.FileserveCom import FileserveCom, checkFile from module.plugins.Plugin import chunks + class UploadStationCom(FileserveCom): __name__ = "UploadStationCom" __type__ = "hoster" @@ -10,12 +11,15 @@ class UploadStationCom(FileserveCom): __description__ = """UploadStation.Com File Download Hoster""" __author_name__ = ("fragonib", "zoidberg") __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "zoidberg@mujmail.cz") - - URLS = ['http://www.uploadstation.com/file/', 'http://www.uploadstation.com/check-links.php', 'http://www.uploadstation.com/checkReCaptcha.php'] + + URLS = ['http://www.uploadstation.com/file/', 'http://www.uploadstation.com/check-links.php', + 'http://www.uploadstation.com/checkReCaptcha.php'] LINKCHECK_TR = r'
    (.*?)\t{9}
    ' LINKCHECK_TD = r'
    (?:<[^>]*>| )*([^<]*)' - + LONG_WAIT_PATTERN = r'

    You have to wait (\d+) (\w+) to download the next file\.

    ' - + + def getInfo(urls): - for chunk in chunks(urls, 100): yield checkFile(UploadStationCom, chunk) \ No newline at end of file + for chunk in chunks(urls, 100): + yield checkFile(UploadStationCom, chunk) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index f38336773..6ac3320c0 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -52,7 +52,8 @@ def getAPIData(urls): def parseFileInfo(self, url='', html=''): - if not html and hasattr(self, "html"): html = self.html + if not html and hasattr(self, "html"): + html = self.html name, size, status, found, fileid = url, 0, 3, None, None if re.search(self.FILE_OFFLINE_PATTERN, html): @@ -91,7 +92,8 @@ class UploadedTo(Hoster): __version__ = "0.71" __description__ = """Uploaded.net Download Hoster""" __author_name__ = ("spoob", "mkaay", "zoidberg", "netpok", "stickell") - __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz", "netpok@gmail.com", "l.stickell@yahoo.it") + __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz", + "netpok@gmail.com", "l.stickell@yahoo.it") FILE_INFO_PATTERN = r'(?P[^<]+)  \s*]*>(?P[^<]+)' FILE_OFFLINE_PATTERN = r'Error: 404' @@ -151,11 +153,10 @@ class UploadedTo(Hoster): else: self.handleFree() - def handlePremium(self): info = self.account.getAccountInfo(self.user, True) self.logDebug("%(name)s: Use Premium Account (%(left)sGB left)" % {"name": self.__name__, - "left": info["trafficleft"] / 1024 / 1024}) + "left": info["trafficleft"] / 1024 / 1024}) if int(self.data[1]) / 1024 > info["trafficleft"]: self.logInfo(_("%s: Not enough traffic left" % self.__name__)) self.account.empty(self.user) diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 65d6cc4e9..79bca748e 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -22,6 +22,7 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + class UploadheroCom(SimpleHoster): __name__ = "UploadheroCom" __type__ = "hoster" @@ -35,26 +36,27 @@ class UploadheroCom(SimpleHoster): FILE_NAME_PATTERN = r'
    (?P.*?)
    ' FILE_SIZE_PATTERN = r'Taille du fichier : (?P.*?)' FILE_OFFLINE_PATTERN = r'

    |

    Le lien du fichier ci-dessus n\'existe plus.' - + DOWNLOAD_URL_PATTERN = r'(\d+).*\s*(\d+)' CAPTCHA_PATTERN = r'"(/captchadl\.php\?[a-z0-9]+)"' FREE_URL_PATTERN = r'var magicomfg = \'"/]+)"' - + def handleFree(self): - self.checkErrors() - + self.checkErrors() + found = re.search(self.CAPTCHA_PATTERN, self.html) - if not found: self.parseError("Captcha URL") + if not found: + self.parseError("Captcha URL") captcha_url = "http://uploadhero.com" + found.group(1) - + for i in range(5): - captcha = self.decryptCaptcha(captcha_url) - self.html = self.load(self.pyfile.url, get = {"code": captcha}) - found = re.search(self.FREE_URL_PATTERN, self.html) + captcha = self.decryptCaptcha(captcha_url) + self.html = self.load(self.pyfile.url, get={"code": captcha}) + found = re.search(self.FREE_URL_PATTERN, self.html) if found: self.correctCaptcha() download_url = found.group(1) or found.group(2) @@ -62,26 +64,27 @@ class UploadheroCom(SimpleHoster): else: self.invalidCaptcha() else: - self.fail("No valid captcha code entered") - + self.fail("No valid captcha code entered") + self.download(download_url) - + def handlePremium(self): self.logDebug("%s: Use Premium Account" % self.__name__) self.html = self.load(self.pyfile.url) link = re.search(self.DOWNLOAD_URL_PATTERN, self.html).group(1) self.logDebug("Downloading link : '%s'" % link) - self.download(link) - + self.download(link) + def checkErrors(self): found = re.search(self.IP_BLOCKED_PATTERN, self.html) if found: self.html = self.load("http://uploadhero.com%s" % found.group(1)) - + found = re.search(self.IP_WAIT_PATTERN, self.html) wait_time = (int(found.group(1)) * 60 + int(found.group(2))) if found else 300 self.setWait(wait_time, True) self.wait() self.retry() - + + getInfo = create_getInfo(UploadheroCom) diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index a98c3bf71..1da571460 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -22,6 +22,7 @@ from pycurl import HTTPHEADER from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp from module.common.json_layer import json_loads + class UploadingCom(SimpleHoster): __name__ = "UploadingCom" __type__ = "hoster" @@ -30,29 +31,29 @@ class UploadingCom(SimpleHoster): __description__ = """Uploading.Com File Download Hoster""" __author_name__ = ("jeix", "mkaay", "zoidberg") __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") - + FILE_NAME_PATTERN = r'Download (?P<N>.*?) for free on uploading.com' FILE_SIZE_PATTERN = r'File size: (?P.*?)' FILE_OFFLINE_PATTERN = r'The requested file is not found' - + def process(self, pyfile): # set lang to english self.req.cj.setCookie("uploading.com", "lang", "1") self.req.cj.setCookie("uploading.com", "language", "1") self.req.cj.setCookie("uploading.com", "setlang", "en") self.req.cj.setCookie("uploading.com", "_lang", "en") - + if not "/get/" in self.pyfile.url: self.pyfile.url = self.pyfile.url.replace("/files", "/files/get") - - self.html = self.load(pyfile.url, decode = True) + + self.html = self.load(pyfile.url, decode=True) self.file_info = self.getFileInfo() - + if self.premium: self.handlePremium() else: - self.handleFree() - + self.handleFree() + def handlePremium(self): postData = {'action': 'get_link', 'code': self.file_info['ID'], @@ -63,21 +64,21 @@ class UploadingCom(SimpleHoster): if url: url = url.group(1).replace("\\/", "/") self.download(url) - + raise Exception("Plugin defect.") - + def handleFree(self): found = re.search('

    ((Daily )?Download Limit)

    ', self.html) if found: self.pyfile.error = found.group(1) self.logWarning(self.pyfile.error) - self.retry(max_tries=6, wait_time = 21600 if found.group(2) else 900, reason = self.pyfile.error) - + self.retry(max_tries=6, wait_time=21600 if found.group(2) else 900, reason=self.pyfile.error) + ajax_url = "http://uploading.com/files/get/?ajax" self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) self.req.http.lastURL = self.pyfile.url - - response = json_loads(self.load(ajax_url, post = {'action': 'second_page', 'code': self.file_info['ID']})) + + response = json_loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.file_info['ID']})) if 'answer' in response and 'wait_time' in response['answer']: wait_time = int(response['answer']['wait_time']) self.logInfo("%s: Waiting %d seconds." % (self.__name__, wait_time)) @@ -85,26 +86,28 @@ class UploadingCom(SimpleHoster): self.wait() else: self.pluginParseError("AJAX/WAIT") - - response = json_loads(self.load(ajax_url, post = {'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'})) + + response = json_loads( + self.load(ajax_url, post={'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'})) if 'answer' in response and 'link' in response['answer']: url = response['answer']['link'] else: self.pluginParseError("AJAX/URL") - + self.html = self.load(url) found = re.search(r'\s*Download File\s*]*>(?P[^>]+)\s*[^\(]*\((?P[^\)]+)\)' FILE_OFFLINE_PATTERN = r'
    File Not Found
    ' HOSTER_NAME = "uptobox.com" - + def setup(self): - self.resumeDownload = self.multiDL = self.premium + self.resumeDownload = self.multiDL = self.premium self.chunkLimit = 1 -getInfo = create_getInfo(UptoboxCom) \ No newline at end of file + +getInfo = create_getInfo(UptoboxCom) diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 4486eb84a..88bcb20ad 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -3,6 +3,7 @@ import re from module.plugins.Hoster import Hoster + class VeehdCom(Hoster): __name__ = 'VeehdCom' __type__ = 'hoster' @@ -11,14 +12,14 @@ class VeehdCom(Hoster): ('filename_spaces', 'bool', "Allow spaces in filename", 'False'), ('replacement_char', 'str', "Filename replacement character", '_'), ] - __version__ = '0.22' + __version__ = '0.23' __description__ = """Veehd.com Download Hoster""" __author_name__ = ('cat') __author_mail__ = ('cat@pyload') - + def _debug(self, msg): self.logDebug('[%s] %s' % (self.__name__, msg)) - + def setup(self): self.html = None self.multiDL = True @@ -28,51 +29,50 @@ class VeehdCom(Hoster): self.download_html() if not self.file_exists(): self.offline() - + pyfile.name = self.get_file_name() self.download(self.get_file_url()) - + def download_html(self): url = self.pyfile.url self._debug("Requesting page: %s" % (repr(url),)) self.html = self.load(url) - + def file_exists(self): if self.html is None: self.download_html() - + if 'Veehd' in self.html: return False return True - + def get_file_name(self): if self.html is None: self.download_html() - + match = re.search(r']*>([^<]+) on Veehd', self.html) if not match: self.fail("video title not found") name = match.group(1) - + # replace unwanted characters in filename if self.getConfig('filename_spaces'): pattern = '[^0-9A-Za-z\.\ ]+' else: pattern = '[^0-9A-Za-z\.]+' - + name = re.sub(pattern, self.getConfig('replacement_char'), - name) + name) return name + '.avi' def get_file_url(self): """ returns the absolute downloadable filepath - """ + """ if self.html is None: self.download_html() - match = re.search(r'(?P[^<]+)' FILE_SIZE_PATTERN = r'
  • Velikost: (?P[^<]+)' FILE_OFFLINE_PATTERN = r'

    Soubor nenalezen

    ' - + PREMIUM_URL_PATTERN = r'href="(http://[^/]+/dwn-premium.php.*?)"' DOMAIN = "http://csd01.coolshare.cz" - - DOMAIN = "http://s01.warserver.cz" - + + DOMAIN = "http://s01.warserver.cz" + def handleFree(self): - try: - self.download("%s/dwn-free.php?fid=%s" % (self.DOMAIN, self.file_info['ID'])) + try: + self.download("%s/dwn-free.php?fid=%s" % (self.DOMAIN, self.file_info['ID'])) except BadHeader, e: self.logError(e) if e.code == 403: - self.longWait(60,60) - else: raise + self.longWait(60, 60) + else: + raise self.checkDownloadedFile() - + def handlePremium(self): found = re.search(self.PREMIUM_URL_PATTERN, self.html) - if not found: self.parseError("Premium URL") + if not found: + self.parseError("Premium URL") url = html_unescape(found.group(1)) - self.logDebug("Premium URL: " + url) - if not url.startswith("http://"): self.resetAccount() + self.logDebug("Premium URL: " + url) + if not url.startswith("http://"): + self.resetAccount() self.download(url) - self.checkDownloadedFile() - + self.checkDownloadedFile() + def checkDownloadedFile(self): check = self.checkDownload({ "offline": ">404 Not Found<" - }) + }) if check == "offline": - self.offline() + self.offline() + -getInfo = create_getInfo(WarserverCz) \ No newline at end of file +getInfo = create_getInfo(WarserverCz) diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index 195e65a93..10a8078c5 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -18,7 +18,7 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.network.HTTPRequest import BadHeader + class WebshareCz(SimpleHoster): __name__ = "WebshareCz" @@ -31,18 +31,19 @@ class WebshareCz(SimpleHoster): FILE_NAME_PATTERN = r'

    Stahujete soubor:

    \s*
    (?P[^<]+)
    ' FILE_SIZE_PATTERN = r'

    Velikost souboru je:

    \s*
    (?P[^<]+)
    ' FILE_OFFLINE_PATTERN = r'

    Soubor ".*?" nebyl nalezen.

    ' - + DOWNLOAD_LINK_PATTERN = r'id="download_link" href="(?P.*?)"' - + def setup(self): self.multiDL = True def handleFree(self): url_a = re.search(r"(var l.*)", self.html).group(1) - url_b = re.search(r"(var keyStr.*)", self.html).group(1) + url_b = re.search(r"(var keyStr.*)", self.html).group(1) url = self.js.eval("%s\n%s\ndec(l)" % (url_a, url_b)) - + self.logDebug('Download link: ' + url) - self.download(url) + self.download(url) + -getInfo = create_getInfo(WebshareCz) \ No newline at end of file +getInfo = create_getInfo(WebshareCz) diff --git a/module/plugins/hoster/WrzucTo.py b/module/plugins/hoster/WrzucTo.py index 4a5e89f22..861e7f11e 100644 --- a/module/plugins/hoster/WrzucTo.py +++ b/module/plugins/hoster/WrzucTo.py @@ -17,9 +17,11 @@ """ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from pycurl import HTTPHEADER +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + class WrzucTo(SimpleHoster): __name__ = "WrzucTo" __type__ = "hoster" @@ -29,30 +31,32 @@ class WrzucTo(SimpleHoster): __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - SH_COOKIES = [("http://www.wrzuc.to", "language", "en")] + SH_COOKIES = [("http://www.wrzuc.to", "language", "en")] FILE_SIZE_PATTERN = r'class="info">\s*\s*(?P.*?)' FILE_NAME_PATTERN = r'id="file_info">\s*(?P.*?)' - + def setup(self): - self.multiDL = True - + self.multiDL = True + def handleFree(self): data = dict(re.findall(r'(md5|file): "(.*?)"', self.html)) - if len(data) != 2: self.parseError('File ID') - + if len(data) != 2: + self.parseError('File ID') + self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) self.req.http.lastURL = self.pyfile.url - self.load("http://www.wrzuc.to/ajax/server/prepair", post = {"md5": data['md5']}) - + self.load("http://www.wrzuc.to/ajax/server/prepair", post={"md5": data['md5']}) + self.req.http.lastURL = self.pyfile.url - self.html = self.load("http://www.wrzuc.to/ajax/server/download_link", post = {"file": data['file']}) - + self.html = self.load("http://www.wrzuc.to/ajax/server/download_link", post={"file": data['file']}) + data.update(re.findall(r'"(download_link|server_id)":"(.*?)"', self.html)) - if len(data) != 4: self.parseError('Download URL') - - download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link']) - self.logDebug("Download URL: %s" % download_url) + if len(data) != 4: + self.parseError('Download URL') + + download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link']) + self.logDebug("Download URL: %s" % download_url) self.download(download_url) - -getInfo = create_getInfo(WrzucTo) + +getInfo = create_getInfo(WrzucTo) diff --git a/module/plugins/hoster/X7To.py b/module/plugins/hoster/X7To.py index 965d84543..24d1643f3 100644 --- a/module/plugins/hoster/X7To.py +++ b/module/plugins/hoster/X7To.py @@ -3,7 +3,6 @@ import re from module.plugins.Hoster import Hoster -from module.network.RequestFactory import getURL def getInfo(urls): yield [(url, 0, 1, url) for url in urls] @@ -17,8 +16,8 @@ class X7To(Hoster): __description__ = """X7.To File Download Hoster""" __author_name__ = ("ernieb") __author_mail__ = ("ernieb") - - FILE_INFO_PATTERN=r'"," ",self.errmsg)) + self.logWarning(re.sub(r"<.*?>", " ", self.errmsg)) if 'wait' in self.errmsg: - wait_time = sum([int(v) * {"hour": 3600, "minute": 60, "second": 1}[u] for v, u in re.findall('(\d+)\s*(hour|minute|second)?', self.errmsg)]) + wait_time = sum([int(v) * {"hour": 3600, "minute": 60, "second": 1}[u] for v, u in + re.findall('(\d+)\s*(hour|minute|second)?', self.errmsg)]) self.setWait(wait_time, True) self.wait() elif 'captcha' in self.errmsg: @@ -229,9 +235,10 @@ class XFileSharingPro(SimpleHoster): def getPostParameters(self): for i in range(3): - if not self.errmsg: self.checkErrors() + if not self.errmsg: + self.checkErrors() - if hasattr(self,"FORM_PATTERN"): + if hasattr(self, "FORM_PATTERN"): action, inputs = self.parseHtmlForm(self.FORM_PATTERN) else: action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) @@ -263,7 +270,8 @@ class XFileSharingPro(SimpleHoster): self.captcha = self.handleCaptcha(inputs) - if wait_time: self.wait() + if wait_time: + self.wait() self.errmsg = None return inputs @@ -273,15 +281,18 @@ class XFileSharingPro(SimpleHoster): if self.premium: inputs['method_premium'] = "Premium Download" - if 'method_free' in inputs: del inputs['method_free'] + if 'method_free' in inputs: + del inputs['method_free'] else: inputs['method_free'] = "Free Download" - if 'method_premium' in inputs: del inputs['method_premium'] + if 'method_premium' in inputs: + del inputs['method_premium'] - self.html = self.load(self.pyfile.url, post = inputs, ref = True) + self.html = self.load(self.pyfile.url, post=inputs, ref=True) self.errmsg = None - else: self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) + else: + self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) def handleCaptcha(self, inputs): found = re.search(self.RECAPTCHA_URL_PATTERN, self.html) @@ -303,7 +314,7 @@ class XFileSharingPro(SimpleHoster): captcha_div = found.group(1) self.logDebug(captcha_div) numerals = re.findall('(\d)', html_unescape(captcha_div)) - inputs['code'] = "".join([a[1] for a in sorted(numerals, key = lambda num: int(num[0]))]) + inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))]) self.logDebug("CAPTCHA", inputs['code'], numerals) return 3 else: @@ -315,4 +326,5 @@ class XFileSharingPro(SimpleHoster): return 4 return 0 + getInfo = create_getInfo(XFileSharingPro) diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py index 866c5da45..cbdd818c7 100644 --- a/module/plugins/hoster/XHamsterCom.py +++ b/module/plugins/hoster/XHamsterCom.py @@ -2,17 +2,20 @@ # -*- coding: utf-8 -*- import re -from module.plugins.Hoster import Hoster from urllib import unquote + +from module.plugins.Hoster import Hoster from module.common.json_layer import json_loads + def clean_json(json_expr): json_expr = re.sub('[\n\r]', '', json_expr) json_expr = re.sub(' +', '', json_expr) - json_expr = re.sub('\'','"', json_expr) + json_expr = re.sub('\'', '"', json_expr) return json_expr - + + class XHamsterCom(Hoster): __name__ = "XHamsterCom" __type__ = "hoster" @@ -23,16 +26,16 @@ class XHamsterCom(Hoster): def setup(self): self.html = None - + def process(self, pyfile): self.pyfile = pyfile - + if not self.file_exists(): self.offline() if self.getConfig("type"): - self.desired_fmt = self.getConfig("type") - + self.desired_fmt = self.getConfig("type") + self.pyfile.name = self.get_file_name() + self.desired_fmt self.download(self.get_file_url()) @@ -45,32 +48,31 @@ class XHamsterCom(Hoster): """ if self.html is None: self.download_html() - + flashvar_pattern = re.compile('flashvars = ({.*?});', re.DOTALL) - json_flashvar=flashvar_pattern.search(self.html) + json_flashvar = flashvar_pattern.search(self.html) if json_flashvar is None: self.fail("Parse error (flashvars)") j = clean_json(json_flashvar.group(1)) flashvars = json_loads(j) - + if flashvars["srv"]: - srv_url = flashvars["srv"] + '/' + srv_url = flashvars["srv"] + '/' else: self.fail("Parse error (srv_url)") - + if flashvars["url_mode"]: - url_mode = flashvars["url_mode"] + url_mode = flashvars["url_mode"] else: self.fail("Parse error (url_mode)") - if self.desired_fmt == ".mp4": file_url = re.search(r"
    ([^<]+) retry: retry = None @@ -142,37 +139,36 @@ class Xdcc(Hoster): sock.close() self.fail("XDCC Bot did not answer") - fdset = select([sock], [], [], 0) if sock not in fdset[0]: continue - + readbuffer += sock.recv(1024) temp = readbuffer.split("\n") readbuffer = temp.pop() for line in temp: - if self.debug is 2: print "*> " + unicode(line, errors='ignore') - line = line.rstrip() + if self.debug is 2: + print "*> " + unicode(line, errors='ignore') + line = line.rstrip() first = line.split() if first[0] == "PING": sock.send("PONG %s\r\n" % first[1]) - + if first[0] == "ERROR": self.fail("IRC-Error: %s" % line) - + msg = line.split(None, 3) if len(msg) != 4: continue - - msg = { \ - "origin":msg[0][1:], \ - "action":msg[1], \ - "target":msg[2], \ - "text" :msg[3][1:] \ - } + msg = { + "origin": msg[0][1:], + "action": msg[1], + "target": msg[2], + "text": msg[3][1:] + } if nick == msg["target"][0:len(nick)] and "PRIVMSG" == msg["action"]: if msg["text"] == "\x01VERSION\x01": @@ -182,34 +178,34 @@ class Xdcc(Hoster): self.logDebug("Sending CTCP TIME.") sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time())) elif msg["text"] == "\x01LAG\x01": - pass # don't know how to answer - - if not (bot == msg["origin"][0:len(bot)] - and nick == msg["target"][0:len(nick)] - and msg["action"] in ("PRIVMSG", "NOTICE")): + pass # don't know how to answer + + if not (bot == msg["origin"][0:len(bot)] + and nick == msg["target"][0:len(nick)] + and msg["action"] in ("PRIVMSG", "NOTICE")): continue - + if self.debug is 1: print "%s: %s" % (msg["origin"], msg["text"]) - + if "You already requested that pack" in msg["text"]: retry = time.time() + 300 - + if "you must be on a known channel to request a pack" in msg["text"]: self.fail("Wrong channel") - + m = re.match('\x01DCC SEND (.*?) (\d+) (\d+)(?: (\d+))?\x01', msg["text"]) if m: done = True - + # get connection data - ip = socket.inet_ntoa(struct.pack('L', socket.ntohl(int(m.group(2))))) - port = int(m.group(3)) + ip = socket.inet_ntoa(struct.pack('L', socket.ntohl(int(m.group(2))))) + port = int(m.group(3)) packname = m.group(1) - + if len(m.groups()) > 3: self.req.filesize = int(m.group(4)) - + self.pyfile.name = packname filename = save_join(location, packname) self.logInfo("XDCC: Downloading %s from %s:%d" % (packname, ip, port)) @@ -219,11 +215,10 @@ class Xdcc(Hoster): if newname and newname != filename: self.logInfo("%(name)s saved as %(newname)s" % {"name": self.pyfile.name, "newname": newname}) filename = newname - + # kill IRC socket # sock.send("QUIT :byebye\r\n") sock.close() self.lastDownload = filename return self.lastDownload - diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index 901225944..37eaa17e5 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -20,6 +20,7 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.common.json_layer import json_loads + class YibaishiwuCom(SimpleHoster): __name__ = "YibaishiwuCom" __type__ = "hoster" @@ -31,24 +32,27 @@ class YibaishiwuCom(SimpleHoster): FILE_NAME_PATTERN = r"file_name: '(?P[^']+)'" FILE_SIZE_PATTERN = r"file_size: '(?P[^']+)'" FILE_OFFLINE_PATTERN = ur'

    哎呀!提取码不存在!不妨搜搜看吧!

    ' - - AJAX_URL_PATTERN = r'(/\?ct=(pickcode|download)[^"\']+)' - + + AJAX_URL_PATTERN = r'(/\?ct=(pickcode|download)[^"\']+)' + def handleFree(self): found = re.search(self.AJAX_URL_PATTERN, self.html) - if not found: self.parseError("AJAX URL") + if not found: + self.parseError("AJAX URL") url = found.group(1) self.logDebug(('FREEUSER' if found.group(2) == 'download' else 'GUEST') + ' URL', url) - - response = json_loads(self.load("http://115.com" + url, decode = False)) - for mirror in (response['urls'] if 'urls' in response else response['data'] if 'data' in response else []): + + response = json_loads(self.load("http://115.com" + url, decode=False)) + for mirror in (response['urls'] if 'urls' in response else response['data'] if 'data' in response else []): try: - url = mirror['url'].replace('\\','') + url = mirror['url'].replace('\\', '') self.logDebug("Trying URL: " + url) self.download(url) break except: continue - else: self.fail('No working link found') + else: + self.fail('No working link found') + getInfo = create_getInfo(YibaishiwuCom) diff --git a/module/plugins/hoster/YoupornCom.py b/module/plugins/hoster/YoupornCom.py index b17a4ef80..d029db7ba 100644 --- a/module/plugins/hoster/YoupornCom.py +++ b/module/plugins/hoster/YoupornCom.py @@ -4,6 +4,7 @@ import re from module.plugins.Hoster import Hoster + class YoupornCom(Hoster): __name__ = "YoupornCom" __type__ = "hoster" @@ -15,19 +16,19 @@ class YoupornCom(Hoster): def setup(self): self.html = None - + def process(self, pyfile): self.pyfile = pyfile - + if not self.file_exists(): self.offline() - + self.pyfile.name = self.get_file_name() self.download(self.get_file_url()) def download_html(self): url = self.pyfile.url - self.html = self.load(url, post={"user_choice":"Enter"}, cookies=False) + self.html = self.load(url, post={"user_choice": "Enter"}, cookies=False) def get_file_url(self): """ returns the absolute downloadable filepath @@ -43,7 +44,7 @@ class YoupornCom(Hoster): self.download_html() file_name_pattern = r"(.*) - Free Porn Videos - YouPorn" - return re.search(file_name_pattern, self.html).group(1).replace("&", "&").replace("/","") + '.flv' + return re.search(file_name_pattern, self.html).group(1).replace("&", "&").replace("/", "") + '.flv' def file_exists(self): """ returns True or False diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 4a192b32a..8c0784205 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -5,6 +5,7 @@ import re import urllib from module.plugins.Hoster import Hoster + class YourfilesTo(Hoster): __name__ = "YourfilesTo" __type__ = "hoster" @@ -18,35 +19,35 @@ class YourfilesTo(Hoster): self.html = None self.multiDL = True - def process(self,pyfile): + def process(self, pyfile): self.pyfile = pyfile self.prepare() self.download(self.get_file_url()) - + def prepare(self): if not self.file_exists(): self.offline() self.pyfile.name = self.get_file_name() - + wait_time = self.get_waiting_time() self.setWait(wait_time) - self.logDebug("%s: Waiting %d seconds." % (self.__name__,wait_time)) + self.logDebug("%s: Waiting %d seconds." % (self.__name__, wait_time)) self.wait() def get_waiting_time(self): if self.html is None: self.download_html() - + #var zzipitime = 15; m = re.search(r'var zzipitime = (\d+);', self.html) if m: sec = int(m.group(1)) else: sec = 0 - + return sec - + def download_html(self): url = self.pyfile.url self.html = self.load(url) @@ -61,7 +62,7 @@ class YourfilesTo(Hoster): return url else: self.fail("absolute filepath could not be found. offline? ") - + def get_file_name(self): if self.html is None: self.download_html() @@ -73,11 +74,8 @@ class YourfilesTo(Hoster): """ if self.html is None: self.download_html() - + if re.search(r"HTTP Status 404", self.html) is not None: return False else: return True - - - diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 129b948bf..1db5fc0a4 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -10,10 +10,12 @@ from urllib import unquote from module.utils import html_unescape from module.plugins.Hoster import Hoster + def which(program): """Works exactly like the unix command which Courtesy of http://stackoverflow.com/a/377028/675646""" + def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) @@ -30,45 +32,45 @@ def which(program): return None + class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" __pattern__ = r"https?://(?:[^/]*?)youtube\.com/watch.*?[?&]v=.*" __version__ = "0.34" __config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting", "hd"), - ("fmt", "int", "FMT/ITAG Number (5-102, 0 for auto)", 0), - (".mp4", "bool", "Allow .mp4", True), - (".flv", "bool", "Allow .flv", True), - (".webm", "bool", "Allow .webm", False), - (".3gp", "bool", "Allow .3gp", False), - ("3d", "bool", "Prefer 3D", False)] + ("fmt", "int", "FMT/ITAG Number (5-102, 0 for auto)", 0), + (".mp4", "bool", "Allow .mp4", True), + (".flv", "bool", "Allow .flv", True), + (".webm", "bool", "Allow .webm", False), + (".3gp", "bool", "Allow .3gp", False), + ("3d", "bool", "Prefer 3D", False)] __description__ = """Youtube.com Video Download Hoster""" __author_name__ = ("spoob", "zoidberg") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") # name, width, height, quality ranking, 3D formats = {5: (".flv", 400, 240, 1, False), - 6: (".flv", 640, 400, 4, False), + 6: (".flv", 640, 400, 4, False), 17: (".3gp", 176, 144, 0, False), 18: (".mp4", 480, 360, 2, False), 22: (".mp4", 1280, 720, 8, False), 43: (".webm", 640, 360, 3, False), 34: (".flv", 640, 360, 4, False), 35: (".flv", 854, 480, 6, False), - 36: (".3gp", 400, 240, 1, False), + 36: (".3gp", 400, 240, 1, False), 37: (".mp4", 1920, 1080, 9, False), 38: (".mp4", 4096, 3072, 10, False), 44: (".webm", 854, 480, 5, False), 45: (".webm", 1280, 720, 7, False), - 46: (".webm", 1920, 1080, 9, False), - 82: (".mp4", 640, 360, 3, True), - 83: (".mp4", 400, 240, 1, True), - 84: (".mp4", 1280, 720, 8, True), - 85: (".mp4", 1920, 1080, 9, True), - 100: (".webm", 640, 360, 3, True), - 101: (".webm", 640, 360, 4, True), - 102: (".webm", 1280, 720, 8, True) - } + 46: (".webm", 1920, 1080, 9, False), + 82: (".mp4", 640, 360, 3, True), + 83: (".mp4", 400, 240, 1, True), + 84: (".mp4", 1280, 720, 8, True), + 85: (".mp4", 1920, 1080, 9, True), + 100: (".webm", 640, 360, 3, True), + 101: (".webm", 640, 360, 4, True), + 102: (".webm", 1280, 720, 8, True)} def setup(self): self.resumeDownload = self.multiDL = True @@ -85,9 +87,11 @@ class YoutubeCom(Hoster): #get config use3d = self.getConfig("3d") if use3d: - quality = {"sd":82,"hd":84,"fullhd":85,"240p":83,"360p":82,"480p":82,"720p":84,"1080p":85,"3072p":85} + quality = {"sd": 82, "hd": 84, "fullhd": 85, "240p": 83, "360p": 82, + "480p": 82, "720p": 84, "1080p": 85, "3072p": 85} else: - quality = {"sd":18,"hd":22,"fullhd":37,"240p":5,"360p":18,"480p":35,"720p":22,"1080p":37,"3072p":38} + quality = {"sd": 18, "hd": 22, "fullhd": 37, "240p": 5, "360p": 18, + "480p": 35, "720p": 22, "1080p": 37, "3072p": 38} desired_fmt = self.getConfig("fmt") if desired_fmt and desired_fmt not in self.formats: self.logWarning("FMT %d unknown - using default." % desired_fmt) @@ -98,7 +102,7 @@ class YoutubeCom(Hoster): #parse available streams streams = re.search(r'"url_encoded_fmt_stream_map": "(.*?)",', html).group(1) streams = [x.split('\u0026') for x in streams.split(',')] - streams = [dict((y.split('=',1)) for y in x) for x in streams] + streams = [dict((y.split('=', 1)) for y in x) for x in streams] streams = [(int(x['itag']), "%s&signature=%s" % (unquote(x['url']), x['sig'])) for x in streams] #self.logDebug("Found links: %s" % streams) self.logDebug("AVAILABLE STREAMS: %s" % [x[0] for x in streams]) @@ -111,22 +115,19 @@ class YoutubeCom(Hoster): fmt_dict = dict([x for x in streams if self.formats[x[0]][4] == use3d] or streams) self.logDebug("DESIRED STREAM: ITAG:%d (%s) %sfound, %sallowed" % - (desired_fmt, - "%s %dx%d Q:%d 3D:%s" % self.formats[desired_fmt], - "" if desired_fmt in fmt_dict else "NOT ", - "" if allowed(desired_fmt) else "NOT ") - ) + (desired_fmt, "%s %dx%d Q:%d 3D:%s" % self.formats[desired_fmt], + "" if desired_fmt in fmt_dict else "NOT ", "" if allowed(desired_fmt) else "NOT ")) #return fmt nearest to quality index if desired_fmt in fmt_dict and allowed(desired_fmt): fmt = desired_fmt else: - sel = lambda x: self.formats[x][3] #select quality index + sel = lambda x: self.formats[x][3] # select quality index comp = lambda x, y: abs(sel(x) - sel(y)) self.logDebug("Choosing nearest fmt: %s" % [(x, allowed(x), comp(x, desired_fmt)) for x in fmt_dict.keys()]) fmt = reduce(lambda x, y: x if comp(x, desired_fmt) <= comp(y, desired_fmt) and - sel(x) > sel(y) else y, fmt_dict.keys()) + sel(x) > sel(y) else y, fmt_dict.keys()) self.logDebug("Chosen fmt: %s" % fmt) url = fmt_dict[fmt] diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py index ea45f4fd8..9940fd078 100644 --- a/module/plugins/hoster/ZDF.py +++ b/module/plugins/hoster/ZDF.py @@ -1,4 +1,3 @@ - import re from xml.etree.ElementTree import fromstring @@ -6,6 +5,7 @@ from module.plugins.Hoster import Hoster XML_API = "http://www.zdf.de/ZDFmediathek/xmlservice/web/beitragsDetails?id=%i" + class ZDF(Hoster): # Based on zdfm by Roland Beermann # http://github.com/enkore/zdfm/ @@ -23,7 +23,7 @@ class ZDF(Hoster): @staticmethod def video_valid(video): - return (video.findtext("url").startswith("http") and video.findtext("url").endswith(".mp4")) + return video.findtext("url").startswith("http") and video.findtext("url").endswith(".mp4") @staticmethod def get_id(url): @@ -40,7 +40,8 @@ class ZDF(Hoster): title = video.findtext("information/title") pyfile.name = title - - target_url = sorted((v for v in video.iter("formitaet") if self.video_valid(v)), key=self.video_key)[-1].findtext("url") + + target_url = sorted((v for v in video.iter("formitaet") if self.video_valid(v)), + key=self.video_key)[-1].findtext("url") self.download(target_url) diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py index 92f9e4dcd..e8b832a13 100644 --- a/module/plugins/hoster/ZeveraCom.py +++ b/module/plugins/hoster/ZeveraCom.py @@ -2,9 +2,7 @@ # -*- coding: utf-8 -*- from module.plugins.Hoster import Hoster -from module.utils import html_unescape -from urllib import quote, unquote -from time import sleep + class ZeveraCom(Hoster): __name__ = "ZeveraCom" @@ -14,95 +12,95 @@ class ZeveraCom(Hoster): __description__ = """zevera.com hoster plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - + def setup(self): self.resumeDownload = self.multiDL = True self.chunkLimit = 1 - + def process(self, pyfile): if not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "zevera.com") self.fail("No zevera.com account provided") self.logDebug("zevera.com: Old URL: %s" % pyfile.url) - - if self.account.getAPIData(self.req, cmd = "checklink", olink = pyfile.url) != "Alive": - self.fail("Offline or not downloadable - contact Zevera support") - - header = self.account.getAPIData(self.req, just_header = True, cmd="generatedownloaddirect", olink = pyfile.url) + + if self.account.getAPIData(self.req, cmd="checklink", olink=pyfile.url) != "Alive": + self.fail("Offline or not downloadable - contact Zevera support") + + header = self.account.getAPIData(self.req, just_header=True, cmd="generatedownloaddirect", olink=pyfile.url) if not "location" in header: self.fail("Unable to initialize download - contact Zevera support") - - self.download(header['location'], disposition = True) - - check = self.checkDownload({"error" : 'action="ErrorDownload.aspx'}) + + self.download(header['location'], disposition=True) + + check = self.checkDownload({"error": 'action="ErrorDownload.aspx'}) if check == "error": self.fail("Error response received - contact Zevera support") - - """ - # BitAPI not used - defunct, probably abandoned by Zevera - - api_url = "http://zevera.com/API.ashx" - - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your zevera.com account or deactivate this plugin")) - self.fail("No zevera.com account provided") - self.logDebug("zevera.com: Old URL: %s" % pyfile.url) - - last_size = retries = 0 - olink = self.pyfile.url #quote(self.pyfile.url.encode('utf_8')) - - for i in range(100): - self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_request', olink = olink) - self.checkAPIErrors(self.retData) - - if self.retData['FileInfo']['StatusID'] == 100: - break - elif self.retData['FileInfo']['StatusID'] == 99: - self.fail('Failed to initialize download (99)') - else: - if self.retData['FileInfo']['Progress']['BytesReceived'] <= last_size: - if retries >= 6: - self.fail('Failed to initialize download (%d)' % self.retData['FileInfo']['StatusID'] ) - retries += 1 - else: - retries = 0 - - last_size = self.retData['FileInfo']['Progress']['BytesReceived'] - - self.setWait(self.retData['Update_Wait']) - self.wait() - - pyfile.name = self.retData['FileInfo']['RealFileName'] - pyfile.size = self.retData['FileInfo']['FileSizeInBytes'] - - self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_start', FileID = self.retData['FileInfo']['FileID']) - self.checkAPIErrors(self.retData) - - self.download(self.api_url, get = { - 'cmd': "open_stream", - 'login': self.account.loginname, - 'pass': self.account.password, - 'FileID': self.retData['FileInfo']['FileID'], - 'startBytes': 0 - } - ) - - def checkAPIErrors(self, retData): - if not retData: - self.fail('Unknown API response') - - if retData['ErrorCode']: - self.logError(retData['ErrorCode'], retData['ErrorMessage']) - #self.fail('ERROR: ' + retData['ErrorMessage']) - - if self.pyfile.size / 1024000 > retData['AccountInfo']['AvailableTODAYTrafficForUseInMBytes']: - self.logWarning("Not enough data left to download the file") - - def crazyDecode(self, ustring): - # accepts decoded ie. unicode string - API response is double-quoted, double-utf8-encoded - # no idea what the proper order of calling these functions would be :-/ - return html_unescape(unquote(unquote(ustring.replace('@DELIMITER@','#'))).encode('raw_unicode_escape').decode('utf-8')) - """ \ No newline at end of file + # BitAPI not used - defunct, probably abandoned by Zevera + # + # api_url = "http://zevera.com/API.ashx" + # + # def process(self, pyfile): + # if not self.account: + # self.logError(_("Please enter your zevera.com account or deactivate this plugin")) + # self.fail("No zevera.com account provided") + # + # self.logDebug("zevera.com: Old URL: %s" % pyfile.url) + # + # last_size = retries = 0 + # olink = self.pyfile.url #quote(self.pyfile.url.encode('utf_8')) + # + # for i in range(100): + # self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_request', olink = olink) + # self.checkAPIErrors(self.retData) + # + # if self.retData['FileInfo']['StatusID'] == 100: + # break + # elif self.retData['FileInfo']['StatusID'] == 99: + # self.fail('Failed to initialize download (99)') + # else: + # if self.retData['FileInfo']['Progress']['BytesReceived'] <= last_size: + # if retries >= 6: + # self.fail('Failed to initialize download (%d)' % self.retData['FileInfo']['StatusID'] ) + # retries += 1 + # else: + # retries = 0 + # + # last_size = self.retData['FileInfo']['Progress']['BytesReceived'] + # + # self.setWait(self.retData['Update_Wait']) + # self.wait() + # + # pyfile.name = self.retData['FileInfo']['RealFileName'] + # pyfile.size = self.retData['FileInfo']['FileSizeInBytes'] + # + # self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_start', + # FileID = self.retData['FileInfo']['FileID']) + # self.checkAPIErrors(self.retData) + # + # self.download(self.api_url, get = { + # 'cmd': "open_stream", + # 'login': self.account.loginname, + # 'pass': self.account.password, + # 'FileID': self.retData['FileInfo']['FileID'], + # 'startBytes': 0 + # } + # ) + # + # def checkAPIErrors(self, retData): + # if not retData: + # self.fail('Unknown API response') + # + # if retData['ErrorCode']: + # self.logError(retData['ErrorCode'], retData['ErrorMessage']) + # #self.fail('ERROR: ' + retData['ErrorMessage']) + # + # if self.pyfile.size / 1024000 > retData['AccountInfo']['AvailableTODAYTrafficForUseInMBytes']: + # self.logWarning("Not enough data left to download the file") + # + # def crazyDecode(self, ustring): + # # accepts decoded ie. unicode string - API response is double-quoted, double-utf8-encoded + # # no idea what the proper order of calling these functions would be :-/ + # return html_unescape(unquote(unquote(ustring.replace( + # '@DELIMITER@','#'))).encode('raw_unicode_escape').decode('utf-8')) diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index e130be24c..3c7b68bb6 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -1,21 +1,26 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import re, subprocess, tempfile, os +import re +import subprocess +import tempfile +import os + from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp from module.plugins.internal.CaptchaService import ReCaptcha from module.common.json_layer import json_loads + class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" __type__ = "hoster" __pattern__ = r"(?Phttp://www\d{0,2}\.zippyshare.com)/v(?:/|iew.jsp.*key=)(?P\d+)" - __version__ = "0.38" + __version__ = "0.39" __description__ = """Zippyshare.com Download Hoster""" __author_name__ = ("spoob", "zoidberg", "stickell") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") __config__ = [("swfdump_path", "string", "Path to swfdump", "")] - + FILE_NAME_PATTERN = r'>Name:\s*]*>(?P[^<]+)
    ' FILE_SIZE_PATTERN = r'>Size:\s*]*>(?P[0-9.,]+) (?P[kKMG]+)i?B
    ' FILE_INFO_PATTERN = r'document\.getElementById\(\'dlbutton\'\)\.href = "[^;]*/(?P[^"]+)";' @@ -26,34 +31,35 @@ class ZippyshareCom(SimpleHoster): CAPTCHA_KEY_PATTERN = r'Recaptcha.create\("([^"]+)"' CAPTCHA_SHORTENCODE_PATTERN = r"shortencode: '([^']+)'" CAPTCHA_DOWNLOAD_PATTERN = r"document.location = '([^']+)'" - - LAST_KNOWN_VALUES = (9, 2374755) #time = (seed * multiply) % modulo + + LAST_KNOWN_VALUES = (9, 2374755) # time = (seed * multiply) % modulo def setup(self): self.html = None self.wantReconnect = False self.multiDL = True - def handleFree(self): + def handleFree(self): url = self.get_file_url() - if not url: self.fail("Download URL not found.") + if not url: + self.fail("Download URL not found.") self.logDebug("Download URL %s" % url) - self.download(url, cookies = True) - + self.download(url, cookies=True) + check = self.checkDownload({ "swf_values": re.compile(self.SEED_PATTERN) }) if check == "swf_values": - swf_sts = self.getStorage("swf_sts") + swf_sts = self.getStorage("swf_sts") if not swf_sts: self.setStorage("swf_sts", 2) self.setStorage("swf_stamp", 0) elif swf_sts == '1': self.setStorage("swf_sts", 2) - - self.retry(max_tries = 1) - + + self.retry(max_tries=1) + def get_file_url(self): """ returns the absolute downloadable filepath """ @@ -73,54 +79,55 @@ class ZippyshareCom(SimpleHoster): seed_search = re.search(self.SEED_PATTERN, self.html) if seed_search: swf_url, file_seed = seed_search.groups() - + swf_sts = self.getStorage("swf_sts") swf_stamp = int(self.getStorage("swf_stamp") or 0) swf_version = self.getStorage("version") self.logDebug("SWF", swf_sts, swf_stamp, swf_version) - - if not swf_sts: + + if not swf_sts: self.logDebug('Using default values') multiply, modulo = self.LAST_KNOWN_VALUES elif swf_sts == "1": - self.logDebug('Using stored values') + self.logDebug('Using stored values') multiply = self.getStorage("multiply") modulo = self.getStorage("modulo") - elif swf_sts == "2": + elif swf_sts == "2": if swf_version < self.__version__: - self.logDebug('Reverting to default values') + self.logDebug('Reverting to default values') self.setStorage("swf_sts", "") self.setStorage("version", self.__version__) - multiply, modulo = self.LAST_KNOWN_VALUES + multiply, modulo = self.LAST_KNOWN_VALUES elif (swf_stamp + 3600000) < timestamp(): swfdump = self.get_swfdump_path() - if swfdump: + if swfdump: multiply, modulo = self.get_swf_values(self.file_info['HOST'] + swf_url, swfdump) else: - self.logWarning("Swfdump not found. Install swftools to bypass captcha.") - + self.logWarning("Swfdump not found. Install swftools to bypass captcha.") + if multiply and modulo: - self.logDebug("TIME = (%s * %s) %s" % (file_seed, multiply, modulo)) - url = "/download?key=%s&time=%d" % (self.file_info['KEY'], (int(file_seed) * int(multiply)) % int(modulo)) - + self.logDebug("TIME = (%s * %s) %s" % (file_seed, multiply, modulo)) + url = "/download?key=%s&time=%d" % (self.file_info['KEY'], + (int(file_seed) * int(multiply)) % int(modulo)) + if not url: #Method #3: Captcha url = self.do_recaptcha() - + return self.file_info['HOST'] + url - + def get_swf_values(self, swf_url, swfdump): self.logDebug('Parsing values from %s' % swf_url) - multiply = modulo = None - + multiply = modulo = None + fd, fpath = tempfile.mkstemp() try: swf_data = self.load(swf_url) os.write(fd, swf_data) - + p = subprocess.Popen([swfdump, '-a', fpath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() - + if err: self.logError(err) else: @@ -128,9 +135,9 @@ class ZippyshareCom(SimpleHoster): multiply = re.search(r'pushbyte (\d+)', m_str).group(1) modulo = re.search(r'pushint (\d+)', m_str).group(1) finally: - os.close(fd) + os.close(fd) os.remove(fpath) - + if multiply and modulo: self.setStorage("multiply", multiply) self.setStorage("modulo", modulo) @@ -139,16 +146,16 @@ class ZippyshareCom(SimpleHoster): else: self.logError("Parsing SWF failed: swfdump not installed or plugin out of date") self.setStorage("swf_sts", 2) - - self.setStorage("swf_stamp", timestamp()) - + + self.setStorage("swf_stamp", timestamp()) + return multiply, modulo - + def get_swfdump_path(self): # used for detecting if swfdump is installed def is_exe(ppath): return os.path.isfile(ppath) and os.access(ppath, os.X_OK) - + program = self.getConfig("swfdump_path") or "swfdump" swfdump = None ppath, pname = os.path.split(program) @@ -160,33 +167,35 @@ class ZippyshareCom(SimpleHoster): exe_file = os.path.join(ppath, program) if is_exe(exe_file): swfdump = exe_file - + # return path to the executable or None if not found return swfdump - + def do_recaptcha(self): self.logDebug('Trying to solve captcha') captcha_key = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group(1) shortencode = re.search(self.CAPTCHA_SHORTENCODE_PATTERN, self.html).group(1) - url = re.search(self.CAPTCHA_DOWNLOAD_PATTERN, self.html).group(1) - + url = re.search(self.CAPTCHA_DOWNLOAD_PATTERN, self.html).group(1) + recaptcha = ReCaptcha(self) for i in range(5): challenge, code = recaptcha.challenge(captcha_key) response = json_loads(self.load(self.file_info['HOST'] + '/rest/captcha/test', - post={'challenge': challenge, - 'response': code, - 'shortencode': shortencode})) + post={'challenge': challenge, + 'response': code, + 'shortencode': shortencode})) self.logDebug("reCaptcha response : %s" % response) if response == True: - self.correctCaptcha + self.correctCaptcha() break else: self.invalidCaptcha() - else: self.fail("Invalid captcha") - - return url + else: + self.fail("Invalid captcha") + + return url + -getInfo = create_getInfo(ZippyshareCom) \ No newline at end of file +getInfo = create_getInfo(ZippyshareCom) -- cgit v1.2.3 From 5980441bdf231c7e48cf810bb95262c46f6e84d5 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 22 Jul 2013 20:59:47 +0200 Subject: fastix integration 2nd --- module/plugins/accounts/Fastix.py | 36 ++++++++++++++++++++ module/plugins/hooks/Fastix.py | 28 ++++++++++++++++ module/plugins/hoster/Fastix.py | 70 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 module/plugins/accounts/Fastix.py create mode 100644 module/plugins/hooks/Fastix.py create mode 100644 module/plugins/hoster/Fastix.py diff --git a/module/plugins/accounts/Fastix.py b/module/plugins/accounts/Fastix.py new file mode 100644 index 000000000..c52961843 --- /dev/null +++ b/module/plugins/accounts/Fastix.py @@ -0,0 +1,36 @@ +from module.plugins.Account import Account +from module.common.json_layer import json_loads + +class Fastix(Account): + __name__ = "Fastix" + __version__ = "0.02" + __type__ = "account" + __description__ = """Fastix account plugin""" + __author_name__ = ("Massimo, Rosamilia") + __author_mail__ = ("max@spiritix.eu") + + def loadAccountInfo(self, user, req): + data = self.getAccountData(user) + page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data["api"])) + page = json_loads(page) + points = page['points'] + kb = float(points) + kb = kb * 1024 ** 2 / 1000 + if points > 0: + account_info = {"validuntil": -1, "trafficleft": kb} + else: + account_info = {"validuntil": None, "trafficleft": None, "premium": False} + return account_info + + + def login(self, user, data, req): + page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data["password"])) + api = json_loads(page) + api = api['apikey'] + data["api"] = api + out_file = open("fastix_api.txt","w") + out_file.write(api) + out_file.close() + if "error_code" in page: + self.wrongPassword() + \ No newline at end of file diff --git a/module/plugins/hooks/Fastix.py b/module/plugins/hooks/Fastix.py new file mode 100644 index 000000000..2d2d09e38 --- /dev/null +++ b/module/plugins/hooks/Fastix.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +# should be working + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster +from module.common.json_layer import json_loads + + +class Fastix(MultiHoster): + __name__ = "Fastix" + __version__ = "0.02" + __type__ = "hook" + + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("unloadFailing", "bool", "Revert to standard download if download fails", "False"), + ("interval", "int", "Reload interval in hours (0 to disable)", "24")] + + __description__ = """Fastix hook plugin""" + __author_name__ = ("Massimo, Rosamilia") + __author_mail__ = ("max@spiritix.eu") + + def getHoster(self): + page = getURL("http://fastix.ru/api_v2/?apikey=5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y&sub=allowed_sources") + list = json_loads(page) + list = list['allow'] + return list \ No newline at end of file diff --git a/module/plugins/hoster/Fastix.py b/module/plugins/hoster/Fastix.py new file mode 100644 index 000000000..330ce78fc --- /dev/null +++ b/module/plugins/hoster/Fastix.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- + +import re +from urllib import unquote +from random import randrange +from module.plugins.Hoster import Hoster +from module.common.json_layer import json_loads +from module.utils import parseFileSize + + +class Fastix(Hoster): + __name__ = "Fastix" + __version__ = "0.02" + __type__ = "hoster" + + __pattern__ = r"http?://.*fastix.ru\..*" + __description__ = """Fastix hoster plugin""" + __author_name__ = ("Massimo, Rosamilia") + __author_mail__ = ("max@spiritix.eu") + + def getFilename(self, url): + try: + name = unquote(url.rsplit("/", 1)[1]) + except IndexError: + name = "Unknown_Filename..." + if name.endswith("..."): #incomplete filename, append random stuff + name += "%s.tmp" % randrange(100, 999) + return name + + def init(self): + self.tries = 0 + self.chunkLimit = 3 + self.resumeDownload = True + + def process(self, pyfile): + if not self.account: + self.logError("Please enter your Fastix account or deactivate this plugin") + self.fail("No Fastix account provided") + + self.log.debug("Fastix: Old URL: %s" % pyfile.url) + if re.match(self.__pattern__, pyfile.url): + new_url = pyfile.url + else: + in_file = open("fastix_api.txt","r") + api_key = in_file.read() + in_file.close() + url = "http://fastix.ru/api_v2/?apikey=%s&sub=getdirectlink&link=%s" % (api_key,pyfile.url) + page = self.load(url) + data = json_loads(page) + self.logDebug("Json data: %s" % str(data)) + if "error\":true" in page: + self.offline() + else: + new_url = data["downloadlink"] + + self.logDebug("Fastix: New URL: %s" % new_url) + + if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): + #only use when name wasnt already set + pyfile.name = self.getFilename(new_url) + + self.download(new_url, disposition=True) + + check = self.checkDownload({"error": "An error occurred while processing your request", + "empty": re.compile(r"^$")}) + + if check == "error": + self.retry(reason="An error occurred while generating link.", wait_time=60) + elif check == "empty": + self.retry(reason="Downloaded File was empty.", wait_time=60) -- cgit v1.2.3 From 1cbdd77c2b17c813163aabf0ef7b8bcae7996dc8 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 22 Jul 2013 23:26:20 +0200 Subject: fastix integration --- module/plugins/accounts/Fastix.py | 3 --- module/plugins/hoster/Fastix.py | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/module/plugins/accounts/Fastix.py b/module/plugins/accounts/Fastix.py index c52961843..862815a84 100644 --- a/module/plugins/accounts/Fastix.py +++ b/module/plugins/accounts/Fastix.py @@ -28,9 +28,6 @@ class Fastix(Account): api = json_loads(page) api = api['apikey'] data["api"] = api - out_file = open("fastix_api.txt","w") - out_file.write(api) - out_file.close() if "error_code" in page: self.wrongPassword() \ No newline at end of file diff --git a/module/plugins/hoster/Fastix.py b/module/plugins/hoster/Fastix.py index 330ce78fc..c16465d92 100644 --- a/module/plugins/hoster/Fastix.py +++ b/module/plugins/hoster/Fastix.py @@ -8,6 +8,7 @@ from module.common.json_layer import json_loads from module.utils import parseFileSize + class Fastix(Hoster): __name__ = "Fastix" __version__ = "0.02" @@ -41,9 +42,8 @@ class Fastix(Hoster): if re.match(self.__pattern__, pyfile.url): new_url = pyfile.url else: - in_file = open("fastix_api.txt","r") - api_key = in_file.read() - in_file.close() + api_key = self.account.getAccountData(self.user) + api_key = api_key["api"] url = "http://fastix.ru/api_v2/?apikey=%s&sub=getdirectlink&link=%s" % (api_key,pyfile.url) page = self.load(url) data = json_loads(page) -- cgit v1.2.3 From f5535809bebc6cc343475704832c8fd8674d2d06 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 23 Jul 2013 20:22:42 +0200 Subject: Fixed PEP 8 violations in Accounts --- module/plugins/accounts/AlldebridCom.py | 31 +++++++++++--------- module/plugins/accounts/BayfilesCom.py | 16 +++++------ module/plugins/accounts/BitshareCom.py | 9 +++--- module/plugins/accounts/BoltsharingCom.py | 1 + module/plugins/accounts/CramitIn.py | 5 ++-- module/plugins/accounts/CyberlockerCh.py | 5 ++-- module/plugins/accounts/DdlstorageCom.py | 5 ++-- module/plugins/accounts/DebridItaliaCom.py | 1 - module/plugins/accounts/DepositfilesCom.py | 15 +++++----- module/plugins/accounts/EasybytezCom.py | 36 ++++++++++++----------- module/plugins/accounts/EgoFilesCom.py | 4 ++- module/plugins/accounts/EuroshareEu.py | 25 ++++++++-------- module/plugins/accounts/FilebeerInfo.py | 22 +++++++-------- module/plugins/accounts/FilecloudIo.py | 22 +++++++-------- module/plugins/accounts/FilefactoryCom.py | 18 ++++++------ module/plugins/accounts/FilejungleCom.py | 20 +++++++------ module/plugins/accounts/FilerNet.py | 1 - module/plugins/accounts/FilerioCom.py | 5 ++-- module/plugins/accounts/FilesMailRu.py | 13 +++++---- module/plugins/accounts/FileserveCom.py | 2 +- module/plugins/accounts/FourSharedCom.py | 25 ++++++++-------- module/plugins/accounts/FreakshareCom.py | 4 ++- module/plugins/accounts/FshareVn.py | 19 +++++++------ module/plugins/accounts/Ftp.py | 5 ++-- module/plugins/accounts/HellshareCz.py | 18 ++++++------ module/plugins/accounts/HellspyCz.py | 23 ++++++++------- module/plugins/accounts/HotfileCom.py | 41 ++++++++++++++------------- module/plugins/accounts/Http.py | 5 ++-- module/plugins/accounts/MegasharesCom.py | 34 +++++++++++----------- module/plugins/accounts/MultishareCz.py | 25 ++++++++-------- module/plugins/accounts/NetloadIn.py | 14 +++++---- module/plugins/accounts/Premium4Me.py | 8 ++++-- module/plugins/accounts/PremiumizeMe.py | 20 ++++++------- module/plugins/accounts/QuickshareCz.py | 23 +++++++-------- module/plugins/accounts/RapidgatorNet.py | 37 +++++++++++------------- module/plugins/accounts/RapidshareCom.py | 19 +++++++------ module/plugins/accounts/RarefileNet.py | 3 +- module/plugins/accounts/RealdebridCom.py | 9 ++++-- module/plugins/accounts/RehostTo.py | 4 --- module/plugins/accounts/ReloadCc.py | 4 +-- module/plugins/accounts/RyushareCom.py | 12 ++++---- module/plugins/accounts/Share76Com.py | 1 + module/plugins/accounts/ShareFilesCo.py | 1 + module/plugins/accounts/ShareRapidCom.py | 21 +++++++------- module/plugins/accounts/ShareonlineBiz.py | 5 ++-- module/plugins/accounts/SpeedLoadOrg.py | 1 + module/plugins/accounts/StahnuTo.py | 18 ++++++------ module/plugins/accounts/TurbobitNet.py | 16 ++++++----- module/plugins/accounts/UlozTo.py | 28 +++++++++--------- module/plugins/accounts/UploadedTo.py | 17 ++++++----- module/plugins/accounts/UploadheroCom.py | 20 +++++++------ module/plugins/accounts/UploadingCom.py | 15 ++++++---- module/plugins/accounts/UploadstationCom.py | 3 +- module/plugins/accounts/UptoboxCom.py | 5 ++-- module/plugins/accounts/WarserverCz.py | 44 ++++++++++++++--------------- module/plugins/accounts/WuploadCom.py | 3 +- module/plugins/accounts/X7To.py | 7 +++-- module/plugins/accounts/YibaishiwuCom.py | 14 +++++---- module/plugins/accounts/ZeveraCom.py | 28 +++++++++--------- 59 files changed, 462 insertions(+), 393 deletions(-) diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index baaa9d264..9fb050535 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -1,10 +1,12 @@ -from module.plugins.Account import Account import xml.dom.minidom as dom -from BeautifulSoup import BeautifulSoup from time import time import re import urllib +from module.plugins.Account import Account +from BeautifulSoup import BeautifulSoup + + class AlldebridCom(Account): __name__ = "AlldebridCom" __version__ = "0.21" @@ -16,34 +18,35 @@ class AlldebridCom(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) page = req.load("http://www.alldebrid.com/account/") - soup=BeautifulSoup(page) + soup = BeautifulSoup(page) #Try to parse expiration date directly from the control panel page (better accuracy) try: - time_text=soup.find('div',attrs={'class':'remaining_time_text'}).strong.string + time_text = soup.find('div', attrs={'class': 'remaining_time_text'}).strong.string self.log.debug("Account expires in: %s" % time_text) p = re.compile('\d+') - exp_data=p.findall(time_text) - exp_time=time()+int(exp_data[0])*24*60*60+int(exp_data[1])*60*60+(int(exp_data[2])-1)*60 + exp_data = p.findall(time_text) + exp_time = time() + int(exp_data[0]) * 24 * 60 * 60 + int( + exp_data[1]) * 60 * 60 + (int(exp_data[2]) - 1) * 60 #Get expiration date from API except: data = self.getAccountData(user) - page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, data["password"])) + page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, + data["password"])) self.log.debug(page) xml = dom.parseString(page) - exp_time=time()+int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue)*86400 + exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 86400 account_info = {"validuntil": exp_time, "trafficleft": -1} return account_info - def login(self, user, data, req): - - urlparams = urllib.urlencode({'action':'login','login_login':user,'login_password':data["password"]}) - page = req.load("http://www.alldebrid.com/register/?%s" % (urlparams)) + def login(self, user, data, req): + urlparams = urllib.urlencode({'action': 'login', 'login_login': user, 'login_password': data["password"]}) + page = req.load("http://www.alldebrid.com/register/?%s" % urlparams) if "This login doesn't exist" in page: self.wrongPassword() - + if "The password is not valid" in page: self.wrongPassword() - + if "Invalid captcha" in page: self.wrongPassword() diff --git a/module/plugins/accounts/BayfilesCom.py b/module/plugins/accounts/BayfilesCom.py index 0d036488b..bf5cc54af 100644 --- a/module/plugins/accounts/BayfilesCom.py +++ b/module/plugins/accounts/BayfilesCom.py @@ -17,10 +17,11 @@ @author: zoidberg """ +from time import time + from module.plugins.Account import Account from module.common.json_layer import json_loads -import re -from time import time, mktime, strptime + class BayfilesCom(Account): __name__ = "BayfilesCom" @@ -33,14 +34,13 @@ class BayfilesCom(Account): def loadAccountInfo(self, user, req): for i in range(2): response = json_loads(req.load("http://api.bayfiles.com/v1/account/info")) - self.logDebug(response) - if not response["error"]: + self.logDebug(response) + if not response["error"]: break self.logWarning(response["error"]) self.relogin() - - return {"premium": bool(response['premium']), \ - "trafficleft": -1, \ + + return {"premium": bool(response['premium']), "trafficleft": -1, "validuntil": response['expires'] if response['expires'] >= int(time()) else -1} def login(self, user, data, req): @@ -48,4 +48,4 @@ class BayfilesCom(Account): self.logDebug(response) if response["error"]: self.logError(response["error"]) - self.wrongPassword() \ No newline at end of file + self.wrongPassword() diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index a4f56e31c..39cff36eb 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -19,6 +19,7 @@ from module.plugins.Account import Account + class BitshareCom(Account): __name__ = "BitshareCom" __version__ = "0.11" @@ -28,17 +29,17 @@ class BitshareCom(Account): def loadAccountInfo(self, user, req): page = req.load("http://bitshare.com/mysettings.html") - + if "\"http://bitshare.com/myupgrade.html\">Free" in page: - return {"validuntil": -1, "trafficleft":-1, "premium": False} + return {"validuntil": -1, "trafficleft": -1, "premium": False} if not '' in page: self.core.log.warning(_("Activate direct Download in your Bitshare Account")) return {"validuntil": -1, "trafficleft": -1, "premium": True} - def login(self, user, data, req): - page = req.load("http://bitshare.com/login.html", post={ "user" : user, "password" : data["password"], "submit" :"Login"}, cookies=True) + page = req.load("http://bitshare.com/login.html", + post={"user": user, "password": data["password"], "submit": "Login"}, cookies=True) if "login" in req.lastEffectiveURL: self.wrongPassword() diff --git a/module/plugins/accounts/BoltsharingCom.py b/module/plugins/accounts/BoltsharingCom.py index 678591d1d..76e010532 100644 --- a/module/plugins/accounts/BoltsharingCom.py +++ b/module/plugins/accounts/BoltsharingCom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from module.plugins.internal.XFSPAccount import XFSPAccount + class BoltsharingCom(XFSPAccount): __name__ = "BoltsharingCom" __version__ = "0.01" diff --git a/module/plugins/accounts/CramitIn.py b/module/plugins/accounts/CramitIn.py index 182c9d647..b0334b191 100644 --- a/module/plugins/accounts/CramitIn.py +++ b/module/plugins/accounts/CramitIn.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from module.plugins.internal.XFSPAccount import XFSPAccount + class CramitIn(XFSPAccount): __name__ = "CramitIn" __version__ = "0.01" @@ -8,5 +9,5 @@ class CramitIn(XFSPAccount): __description__ = """cramit.in account plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - - MAIN_PAGE = "http://cramit.in/" \ No newline at end of file + + MAIN_PAGE = "http://cramit.in/" diff --git a/module/plugins/accounts/CyberlockerCh.py b/module/plugins/accounts/CyberlockerCh.py index 31e0c3e24..0eaa262eb 100644 --- a/module/plugins/accounts/CyberlockerCh.py +++ b/module/plugins/accounts/CyberlockerCh.py @@ -2,6 +2,7 @@ from module.plugins.internal.XFSPAccount import XFSPAccount from module.plugins.internal.SimpleHoster import parseHtmlForm + class CyberlockerCh(XFSPAccount): __name__ = "CyberlockerCh" __version__ = "0.01" @@ -13,7 +14,7 @@ class CyberlockerCh(XFSPAccount): MAIN_PAGE = "http://cyberlocker.ch/" def login(self, user, data, req): - html = req.load(self.MAIN_PAGE + 'login.html', decode = True) + html = req.load(self.MAIN_PAGE + 'login.html', decode=True) action, inputs = parseHtmlForm('name="FL"', html) if not inputs: @@ -25,7 +26,7 @@ class CyberlockerCh(XFSPAccount): # Without this a 403 Forbidden is returned req.http.lastURL = self.MAIN_PAGE + 'login.html' - html = req.load(self.MAIN_PAGE, post = inputs, decode = True) + html = req.load(self.MAIN_PAGE, post=inputs, decode=True) if 'Incorrect Login or Password' in html or '>Error<' in html: self.wrongPassword() diff --git a/module/plugins/accounts/DdlstorageCom.py b/module/plugins/accounts/DdlstorageCom.py index 01d165f23..6c610aa84 100644 --- a/module/plugins/accounts/DdlstorageCom.py +++ b/module/plugins/accounts/DdlstorageCom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from module.plugins.internal.XFSPAccount import XFSPAccount + class DdlstorageCom(XFSPAccount): __name__ = "DdlstorageCom" __version__ = "0.01" @@ -8,5 +9,5 @@ class DdlstorageCom(XFSPAccount): __description__ = """DDLStorage.com account plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - - MAIN_PAGE = "http://ddlstorage.com/" \ No newline at end of file + + MAIN_PAGE = "http://ddlstorage.com/" diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index 91dd3787f..82acd8f8e 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -16,7 +16,6 @@ ############################################################################ import re -import _strptime import time from module.plugins.Account import Account diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index b0730de8e..177d7267f 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -17,10 +17,12 @@ @author: mkaay """ -from module.plugins.Account import Account import re from time import strptime, mktime +from module.plugins.Account import Account + + class DepositfilesCom(Account): __name__ = "DepositfilesCom" __version__ = "0.1" @@ -28,20 +30,19 @@ class DepositfilesCom(Account): __description__ = """depositfiles.com account plugin""" __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - - def loadAccountInfo(self, user, req): + def loadAccountInfo(self, user, req): src = req.load("http://depositfiles.com/de/gold/") validuntil = re.search("noch den Gold-Zugriff: (.*?)
  • ", src).group(1) validuntil = int(mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S"))) - tmp = {"validuntil":validuntil, "trafficleft":-1} + tmp = {"validuntil": validuntil, "trafficleft": -1} return tmp - - def login(self, user, data, req): + def login(self, user, data, req): req.load("http://depositfiles.com/de/gold/payment.php") - src = req.load("http://depositfiles.com/de/login.php", get={"return": "/de/gold/payment.php"}, post={"login": user, "password": data["password"]}) + src = req.load("http://depositfiles.com/de/login.php", get={"return": "/de/gold/payment.php"}, + post={"login": user, "password": data["password"]}) if r'
    Sie haben eine falsche Benutzername-Passwort-Kombination verwendet.
    ' in src: self.wrongPassword() diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py index ba7829b83..cd995fbe5 100644 --- a/module/plugins/accounts/EasybytezCom.py +++ b/module/plugins/accounts/EasybytezCom.py @@ -17,11 +17,13 @@ @author: zoidberg """ +import re +from time import mktime, strptime + from module.plugins.Account import Account from module.plugins.internal.SimpleHoster import parseHtmlForm -import re from module.utils import parseFileSize -from time import mktime, strptime + class EasybytezCom(Account): __name__ = "EasybytezCom" @@ -30,16 +32,16 @@ class EasybytezCom(Account): __description__ = """EasyBytez.com account plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - + VALID_UNTIL_PATTERN = r'Premium account expire:([^<]+)' TRAFFIC_LEFT_PATTERN = r'Traffic available today:(?P[^<]+)' - def loadAccountInfo(self, user, req): - html = req.load("http://www.easybytez.com/?op=my_account", decode = True) - + def loadAccountInfo(self, user, req): + html = req.load("http://www.easybytez.com/?op=my_account", decode=True) + validuntil = trafficleft = None premium = False - + found = re.search(self.VALID_UNTIL_PATTERN, html) if found: premium = True @@ -56,18 +58,18 @@ class EasybytezCom(Account): if "Unlimited" in trafficleft: premium = True else: - trafficleft = parseFileSize(trafficleft) / 1024 - - return ({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}) - + trafficleft = parseFileSize(trafficleft) / 1024 + + return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + def login(self, user, data, req): - html = req.load('http://www.easybytez.com/login.html', decode = True) + html = req.load('http://www.easybytez.com/login.html', decode=True) action, inputs = parseHtmlForm('name="FL"', html) inputs.update({"login": user, "password": data['password'], "redirect": "http://www.easybytez.com/"}) - - html = req.load(action, post = inputs, decode = True) - - if 'Incorrect Login or Password' in html or '>Error<' in html: - self.wrongPassword() \ No newline at end of file + + html = req.load(action, post=inputs, decode=True) + + if 'Incorrect Login or Password' in html or '>Error<' in html: + self.wrongPassword() diff --git a/module/plugins/accounts/EgoFilesCom.py b/module/plugins/accounts/EgoFilesCom.py index da1ed03ad..9c2b918c3 100644 --- a/module/plugins/accounts/EgoFilesCom.py +++ b/module/plugins/accounts/EgoFilesCom.py @@ -1,10 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account import re import time + +from module.plugins.Account import Account from module.utils import parseFileSize + class EgoFilesCom(Account): __name__ = "EgoFilesCom" __version__ = "0.2" diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py index 42967d975..830c1db3f 100644 --- a/module/plugins/accounts/EuroshareEu.py +++ b/module/plugins/accounts/EuroshareEu.py @@ -17,11 +17,12 @@ @author: zoidberg """ -from module.plugins.Account import Account from time import mktime, strptime -from string import replace import re +from module.plugins.Account import Account + + class EuroshareEu(Account): __name__ = "EuroshareEu" __version__ = "0.01" @@ -33,23 +34,23 @@ class EuroshareEu(Account): def loadAccountInfo(self, user, req): self.relogin(user) html = req.load("http://euroshare.eu/customer-zone/settings/") - + found = re.search('id="input_expire_date" value="(\d+\.\d+\.\d+ \d+:\d+)"', html) if found is None: premium, validuntil = False, -1 else: premium = True validuntil = mktime(strptime(found.group(1), "%d.%m.%Y %H:%M")) - + return {"validuntil": validuntil, "trafficleft": -1, "premium": premium} - + def login(self, user, data, req): - + html = req.load('http://euroshare.eu/customer-zone/login/', post={ - "trvale": "1", - "login": user, - "password": data["password"] - }, decode=True) - + "trvale": "1", + "login": user, + "password": data["password"] + }, decode=True) + if u">Nesprávne prihlasovacie meno alebo heslo" in html: - self.wrongPassword() \ No newline at end of file + self.wrongPassword() diff --git a/module/plugins/accounts/FilebeerInfo.py b/module/plugins/accounts/FilebeerInfo.py index 40ab70519..3c3a9edfd 100644 --- a/module/plugins/accounts/FilebeerInfo.py +++ b/module/plugins/accounts/FilebeerInfo.py @@ -20,7 +20,7 @@ import re from time import mktime, strptime from module.plugins.Account import Account -from module.utils import parseFileSize + class FilebeerInfo(Account): __name__ = "FilebeerInfo" @@ -29,29 +29,29 @@ class FilebeerInfo(Account): __description__ = """filebeer.info account plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - + VALID_UNTIL_PATTERN = r'Reverts To Free Account:\s\s*\s*(.*?)\s*' - + def loadAccountInfo(self, user, req): - html = req.load("http://filebeer.info/upgrade.php", decode = True) + html = req.load("http://filebeer.info/upgrade.php", decode=True) premium = not 'Free User ' in html - + validuntil = None if premium: try: - validuntil = mktime(strptime(re.search(self.VALID_UNTIL_PATTERN, html).group(1), "%d/%m/%Y %H:%M:%S")) + validuntil = mktime(strptime(re.search(self.VALID_UNTIL_PATTERN, html).group(1), "%d/%m/%Y %H:%M:%S")) except Exception, e: self.logError("Unable to parse account info", e) return {"validuntil": validuntil, "trafficleft": -1, "premium": premium} - + def login(self, user, data, req): - html = req.load('http://filebeer.info/login.php', post = { + html = req.load('http://filebeer.info/login.php', post={ "submit": 'Login', "loginPassword": data['password'], "loginUsername": user, "submitme": '1' - }, decode = True) - + }, decode=True) + if "
    " def loadPage(self, page_n): -- cgit v1.2.3 From f82b3acee9139d9b5903c71bc1436caf30d9d67b Mon Sep 17 00:00:00 2001 From: Stefano Date: Wed, 23 Oct 2013 12:57:24 +0200 Subject: NCryptIn: better folder name detect + cosmetics --- module/plugins/crypter/NCryptIn.py | 56 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 7b8b29861..3a474a1c6 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -13,7 +13,7 @@ class NCryptIn(Crypter): __name__ = "NCryptIn" __type__ = "crypter" __pattern__ = r"http://(?:www\.)?ncrypt.in/(?Pfolder|link|frame)-([^/\?]+)" - __version__ = "1.31" + __version__ = "1.32" __description__ = """NCrypt.in Crypter Plugin""" __author_name__ = ("fragonib", "stickell") __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "l.stickell@yahoo.it") @@ -22,6 +22,8 @@ class NCryptIn(Crypter): _JK_KEY_ = "jk" _CRYPTED_KEY_ = "crypted" + NAME_PATTERN = r'(?P[^<]+).*?</span>.*?</h2>' - m = re.findall(title_re, self.html, re.DOTALL) - if m is not None: - title = m[-1].strip() - name = folder = title + m = re.search(self.NAME_PATTERN, self.html) + if m: + name = folder = m.group('N').strip() self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) else: name = self.package.name @@ -175,16 +175,16 @@ class NCryptIn(Crypter): self.invalidCaptcha() self.retry() else: - self.correctCaptcha() + self.correctCaptcha() def handleLinkSource(self, link_source_type): - + # Check for JS engine require_js_engine = link_source_type in ('cnl2', 'rsdf', 'ccf', 'dlc') if require_js_engine and not self.js: self.logDebug("No JS engine available, skip %s links" % link_source_type) return [] - + # Select suitable handler if link_source_type == 'single': return self.handleSingleLink() @@ -196,24 +196,24 @@ class NCryptIn(Crypter): return self.handleWebLinks() else: self.fail('unknown source type "%s" (this is probably a bug)' % link_source_type) - + def handleSingleLink(self): self.logDebug("Handling Single link") package_links = [] - + # Decrypt single link decrypted_link = self.decryptLink(self.pyfile.url) if decrypted_link: package_links.append(decrypted_link) - + return package_links def handleCNL2(self): self.logDebug("Handling CNL2 links") package_links = [] - + if 'cnl2_output' in self.cleanedHtml: try: (vcrypted, vjk) = self._getCipherParams() @@ -221,21 +221,21 @@ class NCryptIn(Crypter): package_links.extend(self._getLinks(crypted, jk)) except: self.fail("Unable to decrypt CNL2 links") - + return package_links def handleContainers(self): self.logDebug("Handling Container links") package_links = [] - + pattern = r"/container/(rsdf|dlc|ccf)/([a-z0-9]+)" containersLinks = re.findall(pattern, self.html) self.logDebug("Decrypting %d Container links" % len(containersLinks)) for containerLink in containersLinks: link = "http://ncrypt.in/container/%s/%s.%s" % (containerLink[0], containerLink[1], containerLink[0]) package_links.append(link) - + return package_links def handleWebLinks(self): @@ -243,7 +243,7 @@ class NCryptIn(Crypter): self.logDebug("Handling Web links") pattern = r"(http://ncrypt\.in/link-.*?=)" links = re.findall(pattern, self.html) - + package_links = [] self.logDebug("Decrypting %d Web links" % len(links)) for i, link in enumerate(links): @@ -251,10 +251,10 @@ class NCryptIn(Crypter): decrypted_link = self.decrypt(link) if decrypted_link: package_links.append(decrypted_link) - + return package_links - - def decryptLink(self, link): + + def decryptLink(self, link): try: url = link.replace("link-", "frame-") link = self.load(url, just_header=True)['location'] -- cgit v1.2.3 From 57f21830085d3d5944b8d33fc9825d577e81ed8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 23 Oct 2013 14:21:05 +0200 Subject: Cleanup for setup vars. See #315 --- module/plugins/hoster/CzshareCom.py | 5 ----- module/plugins/hoster/DepositfilesCom.py | 5 ----- module/plugins/hoster/EgoFilesCom.py | 3 +-- module/plugins/hoster/FileApeCom.py | 1 - module/plugins/hoster/FilesMailRu.py | 1 - module/plugins/hoster/MyvideoDe.py | 3 --- module/plugins/hoster/NetloadIn.py | 5 +---- module/plugins/hoster/ShareplaceCom.py | 4 ---- module/plugins/hoster/ShragleCom.py | 1 - module/plugins/hoster/UploadedTo.py | 11 ++--------- module/plugins/hoster/WebshareCz.py | 3 --- module/plugins/hoster/WuploadCom.py | 6 ++---- module/plugins/hoster/X7To.py | 11 ++++------- module/plugins/hoster/XHamsterCom.py | 3 --- module/plugins/hoster/YoupornCom.py | 3 --- module/plugins/hoster/YourfilesTo.py | 4 ---- 16 files changed, 10 insertions(+), 59 deletions(-) diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index fdfce6226..58573d329 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -47,10 +47,6 @@ class CzshareCom(SimpleHoster): MULTIDL_PATTERN = r"<p><font color='red'>Z[^<]*PROFI.</font></p>" USER_CREDIT_PATTERN = r'<div class="credit">\s*kredit: <strong>([0-9., ]+)([kKMG]i?B)</strong>\s*</div><!-- .credit -->' - def setup(self): - self.multiDL = self.resumeDownload = self.premium - self.chunkLimit = 1 - def checkTrafficLeft(self): # check if user logged in found = re.search(self.USER_CREDIT_PATTERN, self.html) @@ -136,7 +132,6 @@ class CzshareCom(SimpleHoster): url = "http://%s/download.php?%s" % (found.group(1), found.group(2)) self.wait() - self.multiDL = True self.download(url) self.checkDownloadedFile() diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 7a84fdb25..01589f206 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -26,10 +26,6 @@ class DepositfilesCom(SimpleHoster): RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'" DOWNLOAD_LINK_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"' - def setup(self): - self.multiDL = False - self.resumeDownload = self.premium - def handleFree(self): self.html = self.load(self.pyfile.url, post={"gateway_result": "1"}, cookies=True) if re.search(self.FILE_OFFLINE_PATTERN, self.html): @@ -113,7 +109,6 @@ class DepositfilesCom(SimpleHoster): self.retry() link = unquote( re.search('<div id="download_url">\s*<a href="(http://.+?\.depositfiles.com/.+?)"', self.html).group(1)) - self.multiDL = True self.download(link, disposition=True) diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 274286cf1..22ca99931 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -39,8 +39,7 @@ class EgoFilesCom(SimpleHoster): DIRECT_LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>' RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' - def init(self): - self.file_info = {} + def setup(self): # Set English language self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) diff --git a/module/plugins/hoster/FileApeCom.py b/module/plugins/hoster/FileApeCom.py index dcfb4b3ca..f07fbfc8a 100644 --- a/module/plugins/hoster/FileApeCom.py +++ b/module/plugins/hoster/FileApeCom.py @@ -16,7 +16,6 @@ class FileApeCom(Hoster): def setup(self): self.multiDL = False - self.html = None def process(self, pyfile): self.pyfile = pyfile diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py index b18fec77b..720013657 100644 --- a/module/plugins/hoster/FilesMailRu.py +++ b/module/plugins/hoster/FilesMailRu.py @@ -41,7 +41,6 @@ class FilesMailRu(Hoster): def setup(self): if not self.account: self.multiDL = False - self.chunkLimit = 1 def process(self, pyfile): self.html = self.load(pyfile.url) diff --git a/module/plugins/hoster/MyvideoDe.py b/module/plugins/hoster/MyvideoDe.py index e32fee5c8..1bd73e376 100644 --- a/module/plugins/hoster/MyvideoDe.py +++ b/module/plugins/hoster/MyvideoDe.py @@ -14,9 +14,6 @@ class MyvideoDe(Hoster): __author_name__ = ("spoob") __author_mail__ = ("spoob@pyload.org") - def setup(self): - self.html = None - def process(self, pyfile): self.pyfile = pyfile self.download_html() diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index ff72a3b63..71c8dd4f2 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -59,10 +59,7 @@ class NetloadIn(Hoster): __author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "gregy@gregy.cz") def setup(self): - self.multiDL = False - if self.premium: - self.multiDL = self.resumeDownload = True - self.chunkLimit = -1 + self.multiDL = self.resumeDownload = self.premium def process(self, pyfile): self.url = pyfile.url diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py index 5f23f9708..e51c3160f 100644 --- a/module/plugins/hoster/ShareplaceCom.py +++ b/module/plugins/hoster/ShareplaceCom.py @@ -15,10 +15,6 @@ class ShareplaceCom(Hoster): __author_name__ = ("ACCakut, based on YourfilesTo by jeix and skydancer") __author_mail__ = ("none") - def setup(self): - self.html = None - self.multiDL = True - def process(self, pyfile): self.pyfile = pyfile self.prepare() diff --git a/module/plugins/hoster/ShragleCom.py b/module/plugins/hoster/ShragleCom.py index 2a2738974..5d19afbc7 100644 --- a/module/plugins/hoster/ShragleCom.py +++ b/module/plugins/hoster/ShragleCom.py @@ -46,7 +46,6 @@ class ShragleCom(Hoster): __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") def setup(self): - self.html = None self.multiDL = False self.check_data = None diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index aee7f32b1..88a8edebb 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -89,7 +89,7 @@ class UploadedTo(Hoster): __name__ = "UploadedTo" __type__ = "hoster" __pattern__ = r"https?://[\w\.-]*?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=|/)(?P<ID>\w+)" - __version__ = "0.71" + __version__ = "0.72" __description__ = """Uploaded.net Download Hoster""" __author_name__ = ("spoob", "mkaay", "zoidberg", "netpok", "stickell") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz", @@ -100,14 +100,8 @@ class UploadedTo(Hoster): DL_LIMIT_PATTERN = "You have reached the max. number of possible free downloads for this hour" def setup(self): - self.html = None - self.multiDL = self.resumeDownload = False - self.url = False + self.multiDL = self.resumeDownload = self.premium self.chunkLimit = 1 # critical problems with more chunks - if self.account: - self.premium = self.account.getAccountInfo(self.user)["premium"] - if self.premium: - self.multiDL = self.resumeDownload = True self.fileID = getID(self.pyfile.url) self.pyfile.url = "http://uploaded.net/file/%s" % self.fileID @@ -196,7 +190,6 @@ class UploadedTo(Hoster): downloadURL = "" for i in range(5): - #self.req.lastURL = str(self.url) re_captcha = ReCaptcha(self) challenge, result = re_captcha.challenge(challengeId.group(1)) options = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": result} diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index 10a8078c5..1c9ddb290 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -34,9 +34,6 @@ class WebshareCz(SimpleHoster): DOWNLOAD_LINK_PATTERN = r'id="download_link" href="(?P<url>.*?)"' - def setup(self): - self.multiDL = True - def handleFree(self): url_a = re.search(r"(var l.*)", self.html).group(1) url_b = re.search(r"(var keyStr.*)", self.html).group(1) diff --git a/module/plugins/hoster/WuploadCom.py b/module/plugins/hoster/WuploadCom.py index 3dab1b1bb..aaeeb59fd 100644 --- a/module/plugins/hoster/WuploadCom.py +++ b/module/plugins/hoster/WuploadCom.py @@ -47,7 +47,7 @@ class WuploadCom(Hoster): __name__ = "WuploadCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?wupload\..*?/file/(([a-z][0-9]+/)?[0-9]+)(/.*)?" - __version__ = "0.21" + __version__ = "0.22" __description__ = """Wupload com""" __author_name__ = ("jeix", "paulking") __author_mail__ = ("jeix@hasnomail.de", "") @@ -62,9 +62,7 @@ class WuploadCom(Hoster): CAPTCHA_TYPE1_PATTERN = r'Recaptcha.create\("(.*?)",' CAPTCHA_TYPE2_PATTERN = r'id="recaptcha_image"><img style="display: block;" src="(.+)image?c=(.+?)"' - def init(self): - if self.account: - self.premium = self.account.getAccountInfo(self.user)["premium"] + def setup(self): if not self.premium: self.chunkLimit = 1 self.multiDL = False diff --git a/module/plugins/hoster/X7To.py b/module/plugins/hoster/X7To.py index 1b8850d9d..59ec6ed06 100644 --- a/module/plugins/hoster/X7To.py +++ b/module/plugins/hoster/X7To.py @@ -12,19 +12,16 @@ class X7To(Hoster): __name__ = "X7To" __type__ = "hoster" __pattern__ = r"http://(?:www.)?x7.to/" - __version__ = "0.3" + __version__ = "0.4" __description__ = """X7.To File Download Hoster""" __author_name__ = ("ernieb") __author_mail__ = ("ernieb") FILE_INFO_PATTERN = r'<meta name="description" content="Download: (.*?) \(([0-9,.]+) (KB|MB|GB)\)' - def init(self): - if self.premium: - self.multiDL = self.resumeDownload = False - self.chunkLimit = 1 - else: - self.multiDL = False + def setup(self): + self.multiDL = self.resumeDownload = False + self.chunkLimit = 1 self.file_id = re.search(r"http://x7.to/([a-zA-Z0-9]+)", self.pyfile.url).group(1) self.logDebug("file id is %s" % self.file_id) diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py index cbdd818c7..721f1cb75 100644 --- a/module/plugins/hoster/XHamsterCom.py +++ b/module/plugins/hoster/XHamsterCom.py @@ -24,9 +24,6 @@ class XHamsterCom(Hoster): __config__ = [("type", ".mp4;.flv", "Preferred type", ".mp4")] __description__ = """XHamster.com Video Download Hoster""" - def setup(self): - self.html = None - def process(self, pyfile): self.pyfile = pyfile diff --git a/module/plugins/hoster/YoupornCom.py b/module/plugins/hoster/YoupornCom.py index d029db7ba..b0d594ca5 100644 --- a/module/plugins/hoster/YoupornCom.py +++ b/module/plugins/hoster/YoupornCom.py @@ -14,9 +14,6 @@ class YoupornCom(Hoster): __author_name__ = ("willnix") __author_mail__ = ("willnix@pyload.org") - def setup(self): - self.html = None - def process(self, pyfile): self.pyfile = pyfile diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 8c0784205..0fd094f61 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -15,10 +15,6 @@ class YourfilesTo(Hoster): __author_name__ = ("jeix", "skydancer") __author_mail__ = ("jeix@hasnomail.de", "skydancer@hasnomail.de") - def setup(self): - self.html = None - self.multiDL = True - def process(self, pyfile): self.pyfile = pyfile self.prepare() -- cgit v1.2.3 From 6d9a47d1a18060a055fd20523c0eece94be282b4 Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Wed, 23 Oct 2013 15:27:45 +0200 Subject: Novafile: fixed #337 --- module/plugins/hoster/NovafileCom.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/module/plugins/hoster/NovafileCom.py b/module/plugins/hoster/NovafileCom.py index 6457734e5..599ec5f7d 100644 --- a/module/plugins/hoster/NovafileCom.py +++ b/module/plugins/hoster/NovafileCom.py @@ -1,4 +1,9 @@ # -*- coding: utf-8 -*- + +# Test links (random.bin): +# http://novafile.com/vfun4z6o2cit +# http://novafile.com/s6zrr5wemuz4 + from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo @@ -6,16 +11,15 @@ class NovafileCom(XFileSharingPro): __name__ = "NovafileCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*novafile\.com/\w{12}" - __version__ = "0.01" + __version__ = "0.02" __description__ = """novafile.com hoster plugin""" - __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") + __author_name__ = ("zoidberg", "stickell") + __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") FILE_SIZE_PATTERN = r'<div class="size">(?P<S>.+?)</div>' - #FILE_OFFLINE_PATTERN = '<b>"File Not Found"</b>|File has been removed due to Copyright Claim' - FORM_PATTERN = r'name="F\d+"' ERROR_PATTERN = r'class="alert[^"]*alert-separate"[^>]*>\s*(?:<p>)?(.*?)\s*</' DIRECT_LINK_PATTERN = r'<a href="(http://s\d+\.novafile\.com/.*?)" class="btn btn-green">Download File</a>' + WAIT_PATTERN = r'<p>Please wait <span id="count"[^>]*>(\d+)</span> seconds</p>' HOSTER_NAME = "novafile.com" -- cgit v1.2.3 From ef72dfafc1a4995721d85c15bd9c32c44fb39bd5 Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Wed, 23 Oct 2013 15:40:56 +0200 Subject: YouTube: fixed #264 --- module/plugins/hoster/YoutubeCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 316eebd4b..e829bedd0 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -36,7 +36,7 @@ class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" __pattern__ = r"https?://(?:[^/]*?)youtube\.com/watch.*?[?&]v=.*" - __version__ = "0.35" + __version__ = "0.36" __config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting", "hd"), ("fmt", "int", "FMT/ITAG Number (5-102, 0 for auto)", 0), (".mp4", "bool", "Allow .mp4", True), @@ -49,7 +49,7 @@ class YoutubeCom(Hoster): __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") # Invalid characters that must be removed from the file name - invalidChars = ':?><"|\\' + invalidChars = u'\u2605:?><"|\\' # name, width, height, quality ranking, 3D formats = {5: (".flv", 400, 240, 1, False), -- cgit v1.2.3 From 4f9b5b02a512ffc581d5b80c3455d78cba244814 Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Wed, 23 Oct 2013 15:55:16 +0200 Subject: Ryushare: new test link + cosmetics --- module/plugins/hoster/RyushareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 4733015ec..675eaddde 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Test links (random.bin): -# http://ryushare.com/denawy6x6tzz/random.bin +# http://ryushare.com/cl0jy8ric2js/random.bin import re @@ -55,7 +55,7 @@ class RyushareCom(XFileSharingPro): retry = True self.wait() - if retry == True: + if retry: self.retry() for i in xrange(5): -- cgit v1.2.3 From c9e3192b5e96b087a93290ce64f3757741727cae Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Wed, 23 Oct 2013 16:01:09 +0200 Subject: Fastshare: fixed offline pattern --- module/plugins/hoster/FastshareCz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 1597d21e5..3e33d0fd9 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -27,12 +27,12 @@ class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?fastshare.cz/\d+/.+" - __version__ = "0.19" + __version__ = "0.20" __description__ = """FastShare.cz""" __author_name__ = ("zoidberg", "stickell") FILE_INFO_PATTERN = r'<h1 class="dwp">(?P<N>[^<]+)</h1>\s*<div class="fileinfo">\s*(?:Velikost|Size)\s*: (?P<S>[^,]+),' - FILE_OFFLINE_PATTERN = ur'<td align=center>Tento soubor byl smazán' + FILE_OFFLINE_PATTERN = 'The file ?has been deleted' FILE_URL_REPLACEMENTS = [('#.*', '')] SH_COOKIES = [('fastshare.cz', 'lang', 'en')] -- cgit v1.2.3 From e7cc8750280b48671cb55967ce2102e85b6f4ffd Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Thu, 24 Oct 2013 15:21:41 +0200 Subject: YouTube: using encode to avoid any bad char issue --- module/plugins/hoster/YoutubeCom.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index e829bedd0..9ef49c2d6 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -36,7 +36,7 @@ class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" __pattern__ = r"https?://(?:[^/]*?)youtube\.com/watch.*?[?&]v=.*" - __version__ = "0.36" + __version__ = "0.37" __config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting", "hd"), ("fmt", "int", "FMT/ITAG Number (5-102, 0 for auto)", 0), (".mp4", "bool", "Allow .mp4", True), @@ -48,9 +48,6 @@ class YoutubeCom(Hoster): __author_name__ = ("spoob", "zoidberg") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") - # Invalid characters that must be removed from the file name - invalidChars = u'\u2605:?><"|\\' - # name, width, height, quality ranking, 3D formats = {5: (".flv", 400, 240, 1, False), 6: (".flv", 640, 400, 4, False), @@ -141,8 +138,7 @@ class YoutubeCom(Hoster): name = re.search(file_name_pattern, html).group(1).replace("/", "") # Cleaning invalid characters from the file name - for c in self.invalidChars: - name = name.replace(c, '_') + name = name.encode('latin-1', 'replace') pyfile.name = html_unescape(name) -- cgit v1.2.3 From 13e299c93d05f9766251f948c79e64af543b7fec Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Sun, 27 Oct 2013 14:39:29 +0100 Subject: Putlocker: added support for "mobile" links. + Better url replacement (see #349) --- module/plugins/hoster/PutlockerCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py index 80d836655..3cb5065d5 100644 --- a/module/plugins/hoster/PutlockerCom.py +++ b/module/plugins/hoster/PutlockerCom.py @@ -26,8 +26,8 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class PutlockerCom(SimpleHoster): __name__ = "PutlockerCom" __type__ = "hoster" - __pattern__ = r'http://(www\.)?putlocker\.com/(file|embed)/[A-Z0-9]+' - __version__ = "0.29" + __pattern__ = r'http://(?:www\.)?putlocker\.com/(mobile/)?(file|embed)/(?P<ID>[A-Z0-9]+)' + __version__ = "0.30" __description__ = """Putlocker.Com""" __author_name__ = ("jeix", "stickell", "Walter Purcaro") __author_mail__ = ("", "l.stickell@yahoo.it", "vuolter@gmail.com") @@ -35,7 +35,7 @@ class PutlockerCom(SimpleHoster): FILE_OFFLINE_PATTERN = r"This file doesn't exist, or has been removed." FILE_INFO_PATTERN = r'site-content">\s*<h1>(?P<N>.+)<strong>\( (?P<S>[^)]+) \)</strong></h1>' - FILE_URL_REPLACEMENTS = [(r'http://putlocker\.com', r'http://www.putlocker.com')] + FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.putlocker.com/file/\g<ID>')] def setup(self): self.multiDL = self.resumeDownload = True -- cgit v1.2.3 From a72d7a1a0935f14666a0bd065bd1efd7bd506080 Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Sun, 27 Oct 2013 15:03:39 +0100 Subject: New hoster and folder: DuploadOrg --- module/plugins/crypter/DuploadOrgFolder.py | 30 +++++++++++++++++++++++++ module/plugins/hoster/DuploadOrg.py | 35 ++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 module/plugins/crypter/DuploadOrgFolder.py create mode 100644 module/plugins/hoster/DuploadOrg.py diff --git a/module/plugins/crypter/DuploadOrgFolder.py b/module/plugins/crypter/DuploadOrgFolder.py new file mode 100644 index 000000000..a1918f055 --- /dev/null +++ b/module/plugins/crypter/DuploadOrgFolder.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see <http://www.gnu.org/licenses/>. # +############################################################################ + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class DuploadOrgFolder(SimpleCrypter): + __name__ = "DuploadOrgFolder" + __type__ = "crypter" + __pattern__ = r"http://(www\.)?dupload\.org/folder/\d+/" + __version__ = "0.01" + __description__ = """Dupload.org Folder Plugin""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + LINK_PATTERN = r'<td style="[^"]+"><a href="(http://[^"]+)" target="_blank">[^<]+</a></td>' diff --git a/module/plugins/hoster/DuploadOrg.py b/module/plugins/hoster/DuploadOrg.py new file mode 100644 index 000000000..6ee2bcc7b --- /dev/null +++ b/module/plugins/hoster/DuploadOrg.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see <http://www.gnu.org/licenses/>. # +############################################################################ + +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + + +class DuploadOrg(XFileSharingPro): + __name__ = "DuploadOrg" + __type__ = "hoster" + __pattern__ = r"http://(www\.)?dupload\.org/\w{12}" + __version__ = "0.01" + __description__ = """Dupload.grg hoster plugin""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + HOSTER_NAME = "dupload.org" + + FILE_INFO_PATTERN = r'<h3[^>]*>(?P<N>.+) \((?P<S>[\d.]+) (?P<U>\w+)\)</h3>' + + +getInfo = create_getInfo(DuploadOrg) -- cgit v1.2.3 From 5b71ec94fabd87c267f1dea446c53ef786e1b8f7 Mon Sep 17 00:00:00 2001 From: AndroKev <neureither.kevin@gmail.com> Date: Sun, 27 Oct 2013 17:42:19 +0100 Subject: ExtractArchives - add an option to excludefiles --- module/plugins/hooks/ExtractArchive.py | 9 +++++---- module/plugins/internal/AbstractExtractor.py | 7 ++++--- module/plugins/internal/UnRar.py | 8 ++++++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 2cb546fbb..704ef3c6e 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -59,7 +59,7 @@ class ExtractArchive(Hook): Provides: unrarFinished (folder, filename) """ __name__ = "ExtractArchive" - __version__ = "0.15" + __version__ = "0.16" __description__ = "Extract different kind of archives" __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), @@ -68,11 +68,12 @@ class ExtractArchive(Hook): ("deletearchive", "bool", "Delete archives when done", False), ("subfolder", "bool", "Create subfolder for each package", False), ("destination", "folder", "Extract files to", ""), + ("excludefiles", "str", "Exclude files from unpacking(seperated by ;)", "nfo;log"), ("recursive", "bool", "Extract archives in archvies", True), ("queue", "bool", "Wait for all downloads to be finished", True), ("renice", "int", "CPU Priority", 0)] - __author_name__ = ("pyload Team") - __author_mail__ = ("admin<at>pyload.org") + __author_name__ = ("pyload Team", "AndroKev") + __author_mail__ = ("admin<at>pyload.org", "@pyloadforum") event_list = ["allDownloadsProcessed"] @@ -177,7 +178,7 @@ class ExtractArchive(Hook): continue extracted.append(target) # prevent extracting same file twice - klass = plugin(self, target, out, self.getConfig("fullpath"), self.getConfig("overwrite"), + klass = plugin(self, target, out, self.getConfig("fullpath"), self.getConfig("overwrite"), self.getConfig("excludefiles"), self.getConfig("renice")) klass.init() diff --git a/module/plugins/internal/AbstractExtractor.py b/module/plugins/internal/AbstractExtractor.py index 2130f910e..2ba2f2edf 100644 --- a/module/plugins/internal/AbstractExtractor.py +++ b/module/plugins/internal/AbstractExtractor.py @@ -27,10 +27,10 @@ class AbtractExtractor: raise NotImplementedError - def __init__(self, m, file, out, fullpath, overwrite, renice): + def __init__(self, m, file, out, fullpath, overwrite, excludefiles, renice): """Initialize extractor for specific file - :param m: ExtractArchive Hook plugin + :param m: Extracd pylctArchive Hook plugin :param file: Absolute filepath :param out: Absolute path to destination directory :param fullpath: extract to fullpath @@ -42,6 +42,7 @@ class AbtractExtractor: self.out = out self.fullpath = fullpath self.overwrite = overwrite + self.excludefiles = excludefiles self.renice = renice self.files = [] # Store extracted files here @@ -90,4 +91,4 @@ class AbtractExtractor: def getExtractedFiles(self): """Populate self.files at some point while extracting""" - return self.files \ No newline at end of file + return self.files diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index da8e7cf3d..00f15791a 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -29,7 +29,7 @@ from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPas class UnRar(AbtractExtractor): __name__ = "UnRar" - __version__ = "0.13" + __version__ = "0.14" # there are some more uncovered rar formats re_splitfile = re.compile(r"(.*)\.part(\d+)\.rar$", re.I) @@ -185,6 +185,11 @@ class UnRar(AbtractExtractor): args = [] #overwrite flag args.append("-o+") if self.overwrite else args.append("-o-") + + if self.excludefiles != "": + for word in self.excludefiles.split(';'): + args.append("-x*" + word) + # assume yes on all queries args.append("-y") @@ -195,7 +200,6 @@ class UnRar(AbtractExtractor): else: args.append("-p-") - #NOTE: return codes are not reliable, some kind of threading, cleanup whatever issue call = [self.CMD, command] + args + list(xargs) self.m.logDebug(" ".join(call)) -- cgit v1.2.3 From 5bbc5bdb087d98e0af584120eec0692d35f0fab7 Mon Sep 17 00:00:00 2001 From: AndroKev <AndroKev@users.noreply.github.com> Date: Sun, 27 Oct 2013 18:10:28 +0100 Subject: Update AbstractExtractor.py there was a little bug --- module/plugins/internal/AbstractExtractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/internal/AbstractExtractor.py b/module/plugins/internal/AbstractExtractor.py index 2ba2f2edf..ace79e149 100644 --- a/module/plugins/internal/AbstractExtractor.py +++ b/module/plugins/internal/AbstractExtractor.py @@ -30,7 +30,7 @@ class AbtractExtractor: def __init__(self, m, file, out, fullpath, overwrite, excludefiles, renice): """Initialize extractor for specific file - :param m: Extracd pylctArchive Hook plugin + :param m: ExtractArchive Hook plugin :param file: Absolute filepath :param out: Absolute path to destination directory :param fullpath: extract to fullpath -- cgit v1.2.3 From e64a821f51c57fc6fb516a115f69d7d3c939e15e Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Tue, 29 Oct 2013 14:45:07 +0100 Subject: SimpleHoster: new PREMIUM_ONLY_PATTERN (see #350). + cosmetics --- module/plugins/internal/SimpleHoster.py | 74 +++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 53f2e9f19..856d3fde6 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -25,6 +25,7 @@ from module.utils import html_unescape, fixup, parseFileSize from module.network.RequestFactory import getURL from module.network.CookieJar import CookieJar + def replace_patterns(string, ruleslist): for r in ruleslist: rf, rt = r @@ -32,18 +33,22 @@ def replace_patterns(string, ruleslist): #self.logDebug(rf, rt, string) return string + def set_cookies(cj, cookies): for cookie in cookies: if isinstance(cookie, tuple) and len(cookie) == 3: domain, name, value = cookie cj.setCookie(domain, name, value) + def parseHtmlTagAttrValue(attr_name, tag): - m = re.search(r"%s\s*=\s*([\"']?)((?<=\")[^\"]+|(?<=')[^']+|[^>\s\"'][^>\s]*)\1" % attr_name, tag, re.I) - return m.group(2) if m else None + m = re.search(r"%s\s*=\s*([\"']?)((?<=\")[^\"]+|(?<=')[^']+|[^>\s\"'][^>\s]*)\1" % attr_name, tag, re.I) + return m.group(2) if m else None + def parseHtmlForm(attr_str, html, input_names=None): - for form in re.finditer(r"(?P<tag><form[^>]*%s[^>]*>)(?P<content>.*?)</?(form|body|html)[^>]*>" % attr_str, html, re.S | re.I): + for form in re.finditer(r"(?P<tag><form[^>]*%s[^>]*>)(?P<content>.*?)</?(form|body|html)[^>]*>" % attr_str, + html, re.S | re.I): inputs = {} action = parseHtmlTagAttrValue("action", form.group('tag')) for inputtag in re.finditer(r'(<(input|textarea)[^>]*>)([^<]*(?=</\2)|)', form.group('content'), re.S | re.I): @@ -65,19 +70,20 @@ def parseHtmlForm(attr_str, html, input_names=None): continue elif hasattr(val, "search") and re.match(val, inputs[key]): continue - break # attibute value does not match + break # attibute value does not match else: - break # attibute name does not match + break # attibute name does not match else: - return action, inputs # passed attribute check + return action, inputs # passed attribute check else: # no attribute check return action, inputs - return {}, None # no matching form found + return {}, None # no matching form found + -def parseFileInfo(self, url = '', html = ''): - info = {"name" : url, "size" : 0, "status" : 3} +def parseFileInfo(self, url='', html=''): + info = {"name": url, "size": 0, "status": 3} if hasattr(self, "pyfile"): url = self.pyfile.url @@ -85,10 +91,12 @@ def parseFileInfo(self, url = '', html = ''): if hasattr(self, "req") and self.req.http.code == '404': info['status'] = 1 else: - if not html and hasattr(self, "html"): html = self.html + if not html and hasattr(self, "html"): + html = self.html if isinstance(self.SH_BROKEN_ENCODING, (str, unicode)): html = unicode(html, self.SH_BROKEN_ENCODING) - if hasattr(self, "html"): self.html = html + if hasattr(self, "html"): + self.html = html if hasattr(self, "FILE_OFFLINE_PATTERN") and re.search(self.FILE_OFFLINE_PATTERN, html): # File offline @@ -113,10 +121,12 @@ def parseFileInfo(self, url = '', html = ''): if 'N' in info: info['name'] = replace_patterns(info['N'], self.FILE_NAME_REPLACEMENTS) if 'S' in info: - size = replace_patterns(info['S'] + info['U'] if 'U' in info else info['S'], self.FILE_SIZE_REPLACEMENTS) + size = replace_patterns(info['S'] + info['U'] if 'U' in info else info['S'], + self.FILE_SIZE_REPLACEMENTS) info['size'] = parseFileSize(size) elif isinstance(info['size'], (str, unicode)): - if 'units' in info: info['size'] += info['units'] + if 'units' in info: + info['size'] += info['units'] info['size'] = parseFileSize(info['size']) if hasattr(self, "file_info"): @@ -124,34 +134,41 @@ def parseFileInfo(self, url = '', html = ''): return info['name'], info['size'], info['status'], url + def create_getInfo(plugin): def getInfo(urls): for url in urls: cj = CookieJar(plugin.__name__) - if isinstance(plugin.SH_COOKIES, list): set_cookies(cj, plugin.SH_COOKIES) + if isinstance(plugin.SH_COOKIES, list): + set_cookies(cj, plugin.SH_COOKIES) file_info = parseFileInfo(plugin, url, getURL(replace_patterns(url, plugin.FILE_URL_REPLACEMENTS), - decode = not plugin.SH_BROKEN_ENCODING, cookies = cj)) + decode=not plugin.SH_BROKEN_ENCODING, cookies=cj)) yield file_info + return getInfo + def timestamp(): - return int(time()*1000) + return int(time() * 1000) + class PluginParseError(Exception): def __init__(self, msg): Exception.__init__(self) self.value = 'Parse error (%s) - plugin may be out of date' % msg + def __str__(self): return repr(self.value) + class SimpleHoster(Hoster): __name__ = "SimpleHoster" - __version__ = "0.30" + __version__ = "0.31" __pattern__ = None __type__ = "hoster" __description__ = """Base hoster plugin""" - __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") + __author_name__ = ("zoidberg", "stickell") + __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") """ These patterns should be defined by each hoster: FILE_INFO_PATTERN = r'(?P<N>file_name) (?P<S>file_size) (?P<U>units)' @@ -159,15 +176,17 @@ class SimpleHoster(Hoster): and FILE_SIZE_PATTERN = r'(?P<S>file_size) (?P<U>units)' FILE_OFFLINE_PATTERN = r'File (deleted|not found)' TEMP_OFFLINE_PATTERN = r'Server maintainance' + + You can also define a PREMIUM_ONLY_PATTERN to detect links that can be downloaded only with a premium account. """ FILE_SIZE_REPLACEMENTS = [] FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup)] FILE_URL_REPLACEMENTS = [] - SH_BROKEN_ENCODING = False # Set to True or encoding name if encoding in http header is not correct - SH_COOKIES = True # or False or list of tuples [(domain, name, value)] - SH_CHECK_TRAFFIC = False # True = force check traffic left for a premium account + SH_BROKEN_ENCODING = False # Set to True or encoding name if encoding in http header is not correct + SH_COOKIES = True # or False or list of tuples [(domain, name, value)] + SH_CHECK_TRAFFIC = False # True = force check traffic left for a premium account def init(self): self.file_info = {} @@ -189,11 +208,14 @@ class SimpleHoster(Hoster): else: # This line is required due to the getURL workaround. Can be removed in 0.5 self.html = self.load(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES) + if hasattr(self, 'PREMIUM_ONLY_PATTERN') and re.search(self.PREMIUM_ONLY_PATTERN, self.html): + self.fail("This link require a premium account") self.handleFree() def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, decode=False): if type(url) == unicode: url = url.encode('utf8') - return Hoster.load(self, url=url, get=get, post=post, ref=ref, cookies=cookies, just_header=just_header, decode=decode) + return Hoster.load(self, url=url, get=get, post=post, ref=ref, cookies=cookies, + just_header=just_header, decode=decode) def getFileInfo(self): self.logDebug("URL: %s" % self.pyfile.url) @@ -230,7 +252,7 @@ class SimpleHoster(Hoster): def parseError(self, msg): raise PluginParseError(msg) - def longWait(self, wait_time = None, max_tries = 3): + def longWait(self, wait_time=None, max_tries=3): if wait_time and isinstance(wait_time, (int, long, float)): time_str = "%dh %dm" % divmod(wait_time / 60, 60) else: @@ -242,7 +264,7 @@ class SimpleHoster(Hoster): self.setWait(wait_time, True) self.wait() - self.retry(max_tries = max_tries, reason="Download limit reached") + self.retry(max_tries=max_tries, reason="Download limit reached") def parseHtmlForm(self, attr_str='', input_names=None): return parseHtmlForm(attr_str, self.html, input_names) @@ -253,4 +275,4 @@ class SimpleHoster(Hoster): return True size = self.pyfile.size / 1024 self.logInfo("Filesize: %i KiB, Traffic left for user %s: %i KiB" % (size, self.user, traffic)) - return size <= traffic \ No newline at end of file + return size <= traffic -- cgit v1.2.3 From 29f6a9e8638184d3c4618898a8708023e51b55e5 Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Tue, 29 Oct 2013 14:58:06 +0100 Subject: YouTube: using ASCII instead of LATIN-1. Fixes #353 --- module/plugins/hoster/YoutubeCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 9ef49c2d6..319eb36e6 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -36,7 +36,7 @@ class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" __pattern__ = r"https?://(?:[^/]*?)youtube\.com/watch.*?[?&]v=.*" - __version__ = "0.37" + __version__ = "0.38" __config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting", "hd"), ("fmt", "int", "FMT/ITAG Number (5-102, 0 for auto)", 0), (".mp4", "bool", "Allow .mp4", True), @@ -138,7 +138,7 @@ class YoutubeCom(Hoster): name = re.search(file_name_pattern, html).group(1).replace("/", "") # Cleaning invalid characters from the file name - name = name.encode('latin-1', 'replace') + name = name.encode('ascii', 'replace') pyfile.name = html_unescape(name) -- cgit v1.2.3 From f379668d9e037ead32bcb579b6f6a8378ca37d4f Mon Sep 17 00:00:00 2001 From: stefanos <antispam-github-com@trash-mail.com> Date: Thu, 31 Oct 2013 14:11:09 +0100 Subject: Captcha9kw: merged #356 --- module/plugins/hooks/Captcha9kw.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index d6fef549f..6a9de24de 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -29,7 +29,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" - __version__ = "0.08" + __version__ = "0.09" __description__ = """send captchas to 9kw.eu""" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), @@ -38,8 +38,9 @@ class Captcha9kw(Hook): ("captchaperhour", "int", "Captcha per hour (max. 9999)", "9999"), ("prio", "int", "Prio 1-10 (Cost +1-10)", "0"), ("selfsolve", "bool", - "If enabled and you have a 9kw client active only you will get your captcha to solve it", "False"), - ("timeout", "int", "Timeout (max. 300)", "220"), + "If enabled and you have a 9kw client active only you will get your captcha to solve it (Selfsolve)", + "False"), + ("timeout", "int", "Timeout (max. 300)", "300"), ("passkey", "password", "API key", ""), ] __author_name__ = ("RaNaN") __author_mail__ = ("RaNaN@pyload.org") -- cgit v1.2.3 From cc5be0a68ed2087da3cc2c3c39d7f8fa7f609811 Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Thu, 31 Oct 2013 16:39:45 +0100 Subject: Keep2share: added k2s.cc support see #92 --- module/plugins/hoster/Keep2shareCC.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index 5e4f5f540..2eada84ec 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -15,6 +15,9 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################ +# Test links (random.bin): +# http://k2s.cc/file/527111edfb9ba/random.bin + import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -24,8 +27,8 @@ from module.plugins.internal.CaptchaService import ReCaptcha class Keep2shareCC(SimpleHoster): __name__ = "Keep2shareCC" __type__ = "hoster" - __pattern__ = r"http://(?:www\.)?keep2share\.cc/file/\w+" - __version__ = "0.03" + __pattern__ = r"http://(?:www\.)?(?:keep2share|k2s)\.cc/file/(?P<ID>.+)" + __version__ = "0.04" __description__ = """Keep2share.cc hoster plugin""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -39,6 +42,8 @@ class Keep2shareCC(SimpleHoster): RECAPTCHA_KEY = '6LcYcN0SAAAAABtMlxKj7X0hRxOY8_2U86kI1vbb' + FILE_URL_REPLACEMENTS = [(__pattern__, r"http://www.keep2share.cc/file/\g<ID>")] + def handleFree(self): fid = re.search(r'<input type="hidden" name="slow_id" value="([^"]+)">', self.html).group(1) self.html = self.load(self.pyfile.url, post={'yt0': '', 'slow_id': fid}) -- cgit v1.2.3 From 2741891cd9d757548ac70e4122b80e14a83afeb2 Mon Sep 17 00:00:00 2001 From: chaosmaker <philipp.antczak@gmail.com> Date: Fri, 1 Nov 2013 17:10:25 +0000 Subject: Update RealdebridCom.py Changed Line 51 to use https instead of http as RealDebrid now only supports that. --- module/plugins/hoster/RealdebridCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 59997ee7c..40ee96df9 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -13,7 +13,7 @@ from module.plugins.Hoster import Hoster class RealdebridCom(Hoster): __name__ = "RealdebridCom" - __version__ = "0.52" + __version__ = "0.53" __type__ = "hoster" __pattern__ = r"https?://.*real-debrid\..*" @@ -48,7 +48,7 @@ class RealdebridCom(Hoster): else: password = password[0] - url = "http://real-debrid.com/ajax/unrestrict.php?lang=en&link=%s&password=%s&time=%s" % ( + url = "https://real-debrid.com/ajax/unrestrict.php?lang=en&link=%s&password=%s&time=%s" % ( quote(pyfile.url, ""), password, int(time() * 1000)) page = self.load(url) data = json_loads(page) -- cgit v1.2.3 From 277b8647356b2603ebdb8958de4113c2f9462894 Mon Sep 17 00:00:00 2001 From: chaosmaker <philipp.antczak@gmail.com> Date: Fri, 1 Nov 2013 17:11:54 +0000 Subject: Update RealdebridCom.py Real Debrid now only accepts https connections to any of their api and hence the change --- module/plugins/accounts/RealdebridCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index 6cac5d0bb..a9980b088 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -5,7 +5,7 @@ from module.plugins.Account import Account class RealdebridCom(Account): __name__ = "RealdebridCom" - __version__ = "0.42" + __version__ = "0.43" __type__ = "account" __description__ = """Real-Debrid.com account plugin""" __author_name__ = ("Devirex, Hazzard") @@ -14,7 +14,7 @@ class RealdebridCom(Account): def loadAccountInfo(self, user, req): if self.pin_code: return {"premium": False} - page = req.load("http://real-debrid.com/api/account.php") + page = req.load("https://real-debrid.com/api/account.php") xml = dom.parseString(page) account_info = {"validuntil": int(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue), "trafficleft": -1} -- cgit v1.2.3 From 7a80906521ba6013e549f29bcdf105e2bed3f11b Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Fri, 1 Nov 2013 23:53:56 +0100 Subject: New crypter: PastebinCom Requested in #361 --- module/plugins/crypter/PastebinCom.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 module/plugins/crypter/PastebinCom.py diff --git a/module/plugins/crypter/PastebinCom.py b/module/plugins/crypter/PastebinCom.py new file mode 100644 index 000000000..942ab613b --- /dev/null +++ b/module/plugins/crypter/PastebinCom.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see <http://www.gnu.org/licenses/>. # +############################################################################ + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class PastebinCom(SimpleCrypter): + __name__ = "PastebinCom" + __type__ = "crypter" + __pattern__ = r"http://(?:w{3}.)?pastebin\.com/\w+" + __version__ = "0.01" + __description__ = """Pastebin.com Plugin""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + LINK_PATTERN = r'<div class="de\d+">(https?://[^ <]+)(?:[^<]*)</div>' + TITLE_PATTERN = r'<div class="paste_box_line1" title="(?P<title>[^"]+)">' -- cgit v1.2.3 From 11bb888aca3ef536811d35edc4dad57dc00643aa Mon Sep 17 00:00:00 2001 From: Stefano <l.stickell@yahoo.it> Date: Fri, 1 Nov 2013 23:54:35 +0100 Subject: New crypter: FreetexthostCom Requested in #360 --- module/plugins/crypter/FreetexthostCom.py | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 module/plugins/crypter/FreetexthostCom.py diff --git a/module/plugins/crypter/FreetexthostCom.py b/module/plugins/crypter/FreetexthostCom.py new file mode 100644 index 000000000..8d165abe4 --- /dev/null +++ b/module/plugins/crypter/FreetexthostCom.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- + +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see <http://www.gnu.org/licenses/>. # +############################################################################ + +import re + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class FreetexthostCom(SimpleCrypter): + __name__ = "FreetexthostCom" + __type__ = "crypter" + __pattern__ = r"http://(?:w{3}.)?freetexthost\.com/\w+" + __version__ = "0.01" + __description__ = """Freetexthost.com Plugin""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + def getLinks(self): + m = re.search(r'<div id="contentsinner">\s*(.+)<div class="viewcount">', self.html, re.DOTALL) + if not m: + self.fail('Unable to extract links | Plugin may be out-of-date') + links = m.group(1) + return links.strip().split("<br />\r\n") -- cgit v1.2.3 From aa9c7048902bf0fc90153118cf36d47910c7699c Mon Sep 17 00:00:00 2001 From: AndroKev <neureither.kevin@gmail.com> Date: Sat, 2 Nov 2013 16:57:07 +0100 Subject: Deleted default value and cleaned the code a little bit --- module/plugins/hooks/ExtractArchive.py | 2 +- module/plugins/internal/UnRar.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 704ef3c6e..be023301c 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -68,7 +68,7 @@ class ExtractArchive(Hook): ("deletearchive", "bool", "Delete archives when done", False), ("subfolder", "bool", "Create subfolder for each package", False), ("destination", "folder", "Extract files to", ""), - ("excludefiles", "str", "Exclude files from unpacking(seperated by ;)", "nfo;log"), + ("excludefiles", "str", "Exclude files from unpacking (seperated by ;)", ""), ("recursive", "bool", "Extract archives in archvies", True), ("queue", "bool", "Wait for all downloads to be finished", True), ("renice", "int", "CPU Priority", 0)] diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index 00f15791a..8a97ac7b7 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -186,7 +186,7 @@ class UnRar(AbtractExtractor): #overwrite flag args.append("-o+") if self.overwrite else args.append("-o-") - if self.excludefiles != "": + if self.excludefiles: for word in self.excludefiles.split(';'): args.append("-x*" + word) -- cgit v1.2.3 From 1cc2e8415828c2e4d60a3c872ea6b6cfd5f284c5 Mon Sep 17 00:00:00 2001 From: AndroKev <neureither.kevin@gmail.com> Date: Sat, 2 Nov 2013 18:34:05 +0100 Subject: Deleted the wildcard --- module/plugins/internal/UnRar.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index 8a97ac7b7..80ee39cdf 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -188,9 +188,8 @@ class UnRar(AbtractExtractor): if self.excludefiles: for word in self.excludefiles.split(';'): - args.append("-x*" + word) + args.append("-x%s" % word ) - # assume yes on all queries args.append("-y") -- cgit v1.2.3 From 78f6e231b9be3e0376a584b260f035978eb4ff58 Mon Sep 17 00:00:00 2001 From: Dman <dmanugm@gmail.com> Date: Sun, 3 Nov 2013 14:16:45 +0100 Subject: New multi-hoster: RPNetBiz Merged #339 --- module/plugins/accounts/RPNetBiz.py | 45 ++++++++++++++++++++++ module/plugins/hooks/RPNetBiz.py | 47 +++++++++++++++++++++++ module/plugins/hoster/RPNetBiz.py | 76 +++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 module/plugins/accounts/RPNetBiz.py create mode 100644 module/plugins/hooks/RPNetBiz.py create mode 100644 module/plugins/hoster/RPNetBiz.py diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py new file mode 100644 index 000000000..ceb5e6bbb --- /dev/null +++ b/module/plugins/accounts/RPNetBiz.py @@ -0,0 +1,45 @@ +from module.plugins.Account import Account +from module.common.json_layer import json_loads + + +class RPNetBiz(Account): + __name__ = "RPNetBiz" + __version__ = "0.1" + __type__ = "account" + __description__ = """RPNet.biz account plugin""" + __author_name__ = ("Dman") + __author_mail__ = ("dmanugm@gmail.com") + + def loadAccountInfo(self, user, req): + # Get account information from rpnet.biz + response = self.getAccountStatus(user, req) + try: + if response['accountInfo']['isPremium']: + # Parse account info. Change the trafficleft later to support per host info. + account_info = {"validuntil": int(response['accountInfo']['premiumExpiry']), + "trafficleft": -1, "premium": True} + else: + account_info = {"validuntil": None, "trafficleft": None, "premium": False} + + except KeyError: + #handle wrong password exception + account_info = {"validuntil": None, "trafficleft": None, "premium": False} + + return account_info + + def login(self, user, data, req): + # Get account information from rpnet.biz + response = self.getAccountStatus(user, req) + + # If we have an error in the response, we have wrong login information + if 'error' in response: + self.wrongPassword() + + def getAccountStatus(self, user, req): + # Using the rpnet API, check if valid premium account + response = req.load("https://premium.rpnet.biz/client_api.php", + get={"username": user, "password": self.accounts[user]['password'], + "action": "showAccountInformation"}) + self.logDebug("JSON data: %s" % response) + + return json_loads(response) diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py new file mode 100644 index 000000000..69976ffc9 --- /dev/null +++ b/module/plugins/hooks/RPNetBiz.py @@ -0,0 +1,47 @@ +from module.plugins.internal.MultiHoster import MultiHoster +from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL + + +class RPNetBiz(MultiHoster): + __name__ = "RPNetBiz" + __version__ = "0.1" + __type__ = "hook" + __description__ = """RPNet.Biz hook plugin""" + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("hosterList", "str", "Hoster list (comma separated)", ""), + ("unloadFailing", "bool", "Revert to stanard download if download fails", "False"), + ("interval", "int", "Reload interval in hours (0 to disable)", "24")] + __author_name__ = ("Dman") + __author_mail__ = ("dmanugm@gmail.com") + + def getHoster(self): + # No hosts supported if no account + if not self.account or not self.account.canUse(): + return [] + + # Get account data + (user, data) = self.account.selectAccount() + + response = getURL("https://premium.rpnet.biz/client_api.php", + get={"username": user, "password": data['password'], "action": "showHosterList"}) + hoster_list = json_loads(response) + + # If account is not valid thera are no hosters available + if 'error' in hoster_list: + return [] + + # Extract hosters from json file + return hoster_list['hosters'] + + def coreReady(self): + # Get account plugin and check if there is a valid account available + self.account = self.core.accountManager.getAccountPlugin("RPNetBiz") + if not self.account.canUse(): + self.account = None + self.logError(_("Please enter your %s account or deactivate this plugin") % "rpnet") + return + + # Run the overwriten core ready which actually enables the multihoster hook + return MultiHoster.coreReady(self) diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py new file mode 100644 index 000000000..ae8ccf8a9 --- /dev/null +++ b/module/plugins/hoster/RPNetBiz.py @@ -0,0 +1,76 @@ +import re + +from module.plugins.Hoster import Hoster +from module.common.json_layer import json_loads + + +class RPNetBiz(Hoster): + __name__ = "RPNetBiz" + __version__ = "0.1" + __type__ = "hoster" + __description__ = """RPNet.Biz hoster plugin""" + __pattern__ = r"https?://.*rpnet\.biz" + __author_name__ = ("Dman") + __author_mail__ = ("dmanugm@gmail.com") + + def setup(self): + self.chunkLimit = -1 + self.resumeDownload = True + + def process(self, pyfile): + + if re.match(self.__pattern__, pyfile.url): + link_status = {'generated': pyfile.url} + elif not self.account: + # Check account + self.logError(_("Please enter your %s account or deactivate this plugin") % "rpnet") + self.fail("No rpnet account provided") + else: + (user, data) = self.account.selectAccount() + + self.logDebug("Original URL: %s" % pyfile.url) + # Get the download link + response = self.load("https://premium.rpnet.biz/client_api.php", + get={"username": user, "password": data['password'], + "action": "generate", "links": self.pyfile.url}) + + self.logDebug("JSON data: %s" % response) + link_status = json_loads(response)['links'][0] # get the first link... since we only queried one + + # Check if we only have an id as a HDD link + if 'id' in link_status: + self.logDebug("Need to wait at least 30 seconds before requery") + self.setWait(30) # wait for 30 seconds + self.wait() + # Lets query the server again asking for the status on the link, + # we need to keep doing this until we reach 100 + max_tries = 30 + my_try = 0 + while (my_try <= max_tries): + self.logDebug("Try: %d ; Max Tries: %d" % (my_try, max_tries)) + response = self.load("https://premium.rpnet.biz/client_api.php", + get={"username": user, "password": data['password'], + "action": "downloadInformation", "id": link_status['id']}) + self.logDebug("JSON data hdd query: %s" % response) + download_status = json_loads(response)['download'] + + if download_status['status'] == '100': + link_status['generated'] = download_status['rpnet_link'] + self.logDebug("Successfully downloaded to rpnet HDD: %s" % link_status['generated']) + break + else: + self.logDebug("At %s%% for the file download" % download_status['status']) + + self.setWait(30) + self.wait() + my_try += 1 + + if my_try > max_tries: # We went over the limit! + self.fail("Waited for about 15 minutes for download to finish but failed") + + if 'generated' in link_status: + self.download(link_status['generated'], disposition=True) + elif 'error' in link_status: + self.fail(link_status['error']) + else: + self.fail("Something went wrong, not supposed to enter here") -- cgit v1.2.3 From 2f1f711e66df754ad88a1e35880dc8980990469f Mon Sep 17 00:00:00 2001 From: igel-kun <mathiaswe@gmx.de> Date: Tue, 5 Nov 2013 00:01:58 +0100 Subject: Update MegasharesCom.py fixed a closing bracket --- module/plugins/hoster/MegasharesCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py index 134c44334..26b26b4a2 100644 --- a/module/plugins/hoster/MegasharesCom.py +++ b/module/plugins/hoster/MegasharesCom.py @@ -72,7 +72,7 @@ class MegasharesCom(SimpleHoster): url = ("http://d01.megashares.com%s&rs=check_passport_renewal" % request_uri + "&rsargs[]=%s&rsargs[]=%s&rsargs[]=%s" % (verifyinput, random_num, passport_num) + - "&rsargs[]=replace_sec_pprenewal&rsrnd=%s" % str(int(time() * 1000)) + "&rsargs[]=replace_sec_pprenewal&rsrnd=%s" % str(int(time() * 1000))) self.logDebug(url) response = self.load(url) -- cgit v1.2.3 From d7e4c8ecc7291291f26e4cecaf15b200e1374efc Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 5 Nov 2013 12:00:31 +0100 Subject: Hoster: TusfilesNet limitDL policy --- module/plugins/hoster/TusfilesNet.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/module/plugins/hoster/TusfilesNet.py b/module/plugins/hoster/TusfilesNet.py index a155439b2..e4a64cfdc 100644 --- a/module/plugins/hoster/TusfilesNet.py +++ b/module/plugins/hoster/TusfilesNet.py @@ -13,8 +13,17 @@ class TusfilesNet(XFileSharingPro): FILE_INFO_PATTERN = r'<li>(?P<N>[^<]+)</li>\s+<li><b>Size:</b> <small>(?P<S>[\d.]+) (?P<U>\w+)</small></li>' FILE_OFFLINE_PATTERN = r'The file you were looking for could not be found' - HOSTER_NAME = "tusfiles.net" + def setup(self): + self.chunkLimit = 1 + self.resumeDownload = self.multiDL = True + if self.premium: + self.limitDL = 5 + elif self.account: + self.limitDL = 3 + else: + self.limitDL = 2 + getInfo = create_getInfo(TusfilesNet) -- cgit v1.2.3 From da5b65005b2b241708d3a3f4d26756e7d90fe40d Mon Sep 17 00:00:00 2001 From: igel-kun <mathiaswe@gmx.de> Date: Tue, 5 Nov 2013 20:41:36 +0100 Subject: Update DepositfilesCom.py added depositfiles https recognition --- module/plugins/hoster/DepositfilesCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 01589f206..99c0d13a1 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" - __pattern__ = r"http://[\w\.]*?(depositfiles\.com|dfiles\.eu)(/\w{1,3})?/files/[\w]+" + __pattern__ = r"https?://[\w\.]*?(depositfiles\.com|dfiles\.eu)(/\w{1,3})?/files/[\w]+" __version__ = "0.45" __description__ = """Depositfiles.com Download Hoster""" __author_name__ = ("spoob", "zoidberg") -- cgit v1.2.3 From deb5fe4959e3d3b2ab62a20e5575500cfae18b25 Mon Sep 17 00:00:00 2001 From: igel-kun <mathiaswe@gmx.de> Date: Wed, 6 Nov 2013 18:27:19 +0100 Subject: Update MegasharesCom.py --- module/plugins/hoster/MegasharesCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py index 26b26b4a2..26cf8ab8e 100644 --- a/module/plugins/hoster/MegasharesCom.py +++ b/module/plugins/hoster/MegasharesCom.py @@ -25,7 +25,7 @@ class MegasharesCom(SimpleHoster): __name__ = "MegasharesCom" __type__ = "hoster" __pattern__ = r"http://(\w+\.)?megashares.com/.*" - __version__ = "0.23" + __version__ = "0.24" __description__ = """megashares.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") -- cgit v1.2.3 From b1c48147f3145183bbc1cd07a36e97cd7af7374c Mon Sep 17 00:00:00 2001 From: Joris <joris.onghena.83@gmail.com> Date: Fri, 11 Oct 2013 13:37:32 +0200 Subject: MovreelCom changed to use XFileSharingPro --- module/plugins/hoster/MovReelCom.py | 106 ++++-------------------------------- 1 file changed, 11 insertions(+), 95 deletions(-) diff --git a/module/plugins/hoster/MovReelCom.py b/module/plugins/hoster/MovReelCom.py index 2fbff66a6..a300d0482 100644 --- a/module/plugins/hoster/MovReelCom.py +++ b/module/plugins/hoster/MovReelCom.py @@ -1,110 +1,26 @@ # -*- coding: utf-8 -*- -import re -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.utils import html_unescape -from module.network.RequestFactory import getURL +#import re +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo +#from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME - -class MovReelCom(SimpleHoster): +class MovReelCom(XFileSharingPro): __name__ = "MovReelCom" __type__ = "hoster" __pattern__ = r"http://movreel.com/.*" - __version__ = "1.00" + __version__ = "1.10" __description__ = """MovReel.com hoster plugin""" __author_name__ = ("JorisV83") __author_mail__ = ("jorisv83-pyload@yahoo.com") + #FILE_NAME_PATTERN = r'<b>Filename:</b>(?P<N>.*?)<br>' + #FILE_SIZE_PATTERN = r'<b>Size:</b>(?P<S>.*?)<br>' FILE_INFO_PATTERN = r'You have requested <font color="red">http://movreel.com/.*/(?P<N>.+?)</font>.*\((?P<S>[\d.]+) (?P<U>..)\)</font>' FILE_OFFLINE_PATTERN = r'<b>File Not Found</b>' - - def setup(self): - self.resumeDownload = True - self.multiDL = False - - def handleFree(self): - - # Define search patterns - op_pattern = '<input type="hidden" name="op" value="(.*)">' - id_pattern = '<input type="hidden" name="id" value="(.*)">' - fn_pattern = '<input type="hidden" name="fname" value="(.*)">' - re_pattern = '<input type="hidden" name="referer" value="(.*)">' - ul_pattern = '<input type="hidden" name="usr_login" value="(.*)">' - rand_pattern = '<input type="hidden" name="rand" value="(.*)">' - link_pattern = "var file_link = '(.*)';" - downlimit_pattern = '<br><p class="err">You have reached the download-limit: .*</p>' - - # Get HTML source - self.logDebug("Getting first HTML source") - html = self.load(self.pyfile.url) - self.logDebug(" > Done") - - op_val = re.search(op_pattern, html).group(1) - id_val = re.search(id_pattern, html).group(1) - fn_val = re.search(fn_pattern, html).group(1) - re_val = re.search(re_pattern, html).group(1) - ul_val = re.search(ul_pattern, html).group(1) - - # Debug values - self.logDebug(" > Op " + op_val) - self.logDebug(" > Id " + id_val) - self.logDebug(" > Fname " + fn_val) - self.logDebug(" > Referer " + re_val) - self.logDebug(" > User Login " + ul_val) - - # Create post data - post_data = {"op": op_val, "usr_login": ul_val, "id": id_val, "fname": fn_val, "referer": re_val, + DIRECT_LINK_PATTERN = "var file_link = '(.*)';" + #OVR_DOWNLOAD_LINK_PATTERN = "var file_link = '(.*)';" + HOSTER_NAME = "movreel.com" "method_free": "+Free+Download"} - - # Post and get new HTML source - self.logDebug("Getting second HTML source") - html = self.load(self.pyfile.url, post=post_data, decode=True) - self.logDebug(" > Done") - - # Check download limit - if re.search(downlimit_pattern, html) is not None: - self.retry(3, 7200, "Download limit reached, wait 2h") - - # Retrieve data - if re.search(op_pattern, html) is not None: - op_val = re.search(op_pattern, html).group(1) - else: - self.retry(3, 10, "Second html: no op found!!") - - if re.search(id_pattern, html) is not None: - id_val = re.search(id_pattern, html).group(1) - else: - self.retry(3, 10, "Second html: no id found!!") - - if re.search(rand_pattern, html) is not None: - rand_val = re.search(rand_pattern, html).group(1) - else: - self.retry(3, 10, "Second html: no rand found!!") - - re_val = self.pyfile.url - - # Debug values - self.logDebug(" > Op " + op_val) - self.logDebug(" > Id " + id_val) - self.logDebug(" > Rand " + rand_val) - self.logDebug(" > Referer " + re_val) - - # Create post data - post_data = {"op": op_val, "id": id_val, "rand": rand_val, "referer": re_val, "method_free": "+Free+Download", "method_premium": "", "down_direct": "1"} - - # Post and get new HTML source - self.logDebug("Getting third HTML source") - html = self.load(self.pyfile.url, post=post_data, decode=True) - self.logDebug(" > Done") - - # Get link value - if re.search(link_pattern, html) is not None: - link_val = re.search(link_pattern, html).group(1) - self.logDebug(" > Link " + link_val) - self.download(link_val) - else: - self.logDebug("No link found!!") - self.retry(3, 10, "No link found!!") - + getInfo = create_getInfo(MovReelCom) -- cgit v1.2.3 From 5283039bee5a380228929df72096d19f1547566c Mon Sep 17 00:00:00 2001 From: Joris <joris.onghena.83@gmail.com> Date: Sat, 2 Nov 2013 18:58:50 +0100 Subject: Fixed MovReelCom. Now uses XFileSharingPro and adapted to new site. --- module/plugins/hoster/MovReelCom.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/module/plugins/hoster/MovReelCom.py b/module/plugins/hoster/MovReelCom.py index a300d0482..5d8754ee7 100644 --- a/module/plugins/hoster/MovReelCom.py +++ b/module/plugins/hoster/MovReelCom.py @@ -7,20 +7,17 @@ class MovReelCom(XFileSharingPro): __name__ = "MovReelCom" __type__ = "hoster" __pattern__ = r"http://movreel.com/.*" - __version__ = "1.10" + __version__ = "1.20" __description__ = """MovReel.com hoster plugin""" __author_name__ = ("JorisV83") __author_mail__ = ("jorisv83-pyload@yahoo.com") #FILE_NAME_PATTERN = r'<b>Filename:</b>(?P<N>.*?)<br>' #FILE_SIZE_PATTERN = r'<b>Size:</b>(?P<S>.*?)<br>' - FILE_INFO_PATTERN = r'You have requested <font color="red">http://movreel.com/.*/(?P<N>.+?)</font>.*\((?P<S>[\d.]+) (?P<U>..)\)</font>' - FILE_OFFLINE_PATTERN = r'<b>File Not Found</b>' - DIRECT_LINK_PATTERN = "var file_link = '(.*)';" + FILE_INFO_PATTERN = r'<h3>(?P<N>.+?) <small><sup>(?P<S>[\d.]+) (?P<U>..)</sup> </small></h3>' + FILE_OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>' + DIRECT_LINK_PATTERN = r'<a href="(http://[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/.*)">Download Link</a>' #OVR_DOWNLOAD_LINK_PATTERN = "var file_link = '(.*)';" HOSTER_NAME = "movreel.com" - "method_free": "+Free+Download"} - "method_premium": "", "down_direct": "1"} - getInfo = create_getInfo(MovReelCom) -- cgit v1.2.3 From df9004829112b93ea49c1100439d4f5ac477a55a Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 8 Nov 2013 17:38:46 +0100 Subject: SockshareCom added Merged #357 --- module/plugins/hoster/PutlockerCom.py | 15 +++++++++------ module/plugins/hoster/SockshareCom.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 module/plugins/hoster/SockshareCom.py diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py index 3cb5065d5..dbd13ac3b 100644 --- a/module/plugins/hoster/PutlockerCom.py +++ b/module/plugins/hoster/PutlockerCom.py @@ -27,7 +27,7 @@ class PutlockerCom(SimpleHoster): __name__ = "PutlockerCom" __type__ = "hoster" __pattern__ = r'http://(?:www\.)?putlocker\.com/(mobile/)?(file|embed)/(?P<ID>[A-Z0-9]+)' - __version__ = "0.30" + __version__ = "0.31" __description__ = """Putlocker.Com""" __author_name__ = ("jeix", "stickell", "Walter Purcaro") __author_mail__ = ("", "l.stickell@yahoo.it", "vuolter@gmail.com") @@ -36,6 +36,7 @@ class PutlockerCom(SimpleHoster): FILE_INFO_PATTERN = r'site-content">\s*<h1>(?P<N>.+)<strong>\( (?P<S>[^)]+) \)</strong></h1>' FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.putlocker.com/file/\g<ID>')] + HOSTER_NAME = "putlocker.com" def setup(self): self.multiDL = self.resumeDownload = True @@ -70,10 +71,12 @@ class PutlockerCom(SimpleHoster): else: link = re.search(r"playlist: '(/get_file\.php\?stream=[A-Za-z0-9=]+)'", self.html) if link: - self.html = self.load("http://www.putlocker.com" + link.group(1)) + self.html = self.load("http://www.%s%s" % (self.HOSTER_NAME, link.group(1))) link = re.search(r'media:content url="(http://.*?)"', self.html) if not link: - link = re.search("\"(http://media\\-b\\d+\\.putlocker\\.com/download/\\d+/.*?)\"", self.html) + hostername = self.HOSTER_NAME.rsplit(".") + pattern = "\"(http://media\\-b\\d+\\.%s\\.%s/download/\\d+/.*?)\"" % (hostername[0], hostername[1]) + link = re.search(pattern, self.html) else: self.parseError('Unable to detect a download link') @@ -81,14 +84,14 @@ class PutlockerCom(SimpleHoster): if link.startswith("http://"): return link else: - return "http://www.putlocker.com" + link + return "http://www.%s%s" % (self.HOSTER_NAME, link) def processName(self, name_old): name = self.pyfile.name if name <= name_old: return name_new = re.sub(r'\.[^.]+$', "", name_old) + name[len(name_old):] - file = self.lastDownload + filename = self.lastDownload self.pyfile.name = name_new - rename(file, file.rsplit(name)[0] + name_new) + rename(filename, filename.rsplit(name)[0] + name_new) self.logInfo("%(name)s renamed to %(newname)s" % {"name": name, "newname": name_new}) diff --git a/module/plugins/hoster/SockshareCom.py b/module/plugins/hoster/SockshareCom.py new file mode 100644 index 000000000..b2635d8bc --- /dev/null +++ b/module/plugins/hoster/SockshareCom.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: Walter Purcaro +""" + +from module.plugins.hoster.PutlockerCom import PutlockerCom + + +class SockshareCom(PutlockerCom): + __name__ = "SockshareCom" + __type__ = "hoster" + __pattern__ = r'http://(?:www\.)?sockshare\.com/(mobile/)?(file|embed)/(?P<ID>[A-Z0-9]+)' + __version__ = "0.01" + __description__ = """Sockshare.Com""" + __author_name__ = ("Walter Purcaro") + __author_mail__ = ("vuolter@gmail.com") + + FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.sockshare.com/file/\g<ID>')] + HOSTER_NAME = "sockshare.com" -- cgit v1.2.3 From a2201efe4e8fbc1c4e820cb35c3240559b60da48 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 10 Nov 2013 16:34:35 +0100 Subject: Hoster: PutlockerCom: Code cosmetic --- module/plugins/hoster/PutlockerCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py index dbd13ac3b..7b9ac1f84 100644 --- a/module/plugins/hoster/PutlockerCom.py +++ b/module/plugins/hoster/PutlockerCom.py @@ -74,8 +74,7 @@ class PutlockerCom(SimpleHoster): self.html = self.load("http://www.%s%s" % (self.HOSTER_NAME, link.group(1))) link = re.search(r'media:content url="(http://.*?)"', self.html) if not link: - hostername = self.HOSTER_NAME.rsplit(".") - pattern = "\"(http://media\\-b\\d+\\.%s\\.%s/download/\\d+/.*?)\"" % (hostername[0], hostername[1]) + pattern = "\"(http://media\\-b\\d+\\.%s\\.%s/download/\\d+/.*?)\"" % self.HOSTER_NAME.rsplit(".") link = re.search(pattern, self.html) else: self.parseError('Unable to detect a download link') -- cgit v1.2.3 From 227d73083e2f750c87ff3403f4512894b80b9834 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 10 Nov 2013 18:00:43 +0100 Subject: added version to abstract extractor --- module/plugins/internal/AbstractExtractor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/plugins/internal/AbstractExtractor.py b/module/plugins/internal/AbstractExtractor.py index ace79e149..f730a8434 100644 --- a/module/plugins/internal/AbstractExtractor.py +++ b/module/plugins/internal/AbstractExtractor.py @@ -11,6 +11,9 @@ class WrongPassword(Exception): pass class AbtractExtractor: + + __version__ = "0.1" + @staticmethod def checkDeps(): """ Check if system statisfy dependencies -- cgit v1.2.3 From a92c0e7561b90ed876ecae31833aaeec855f860e Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 16 Nov 2013 12:39:45 +0100 Subject: Hoster: FastixRu: Fixed pattern --- module/plugins/hoster/FastixRu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index c2791c5d2..8805081c9 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -9,11 +9,11 @@ from module.common.json_layer import json_loads class FastixRu(Hoster): __name__ = "FastixRu" - __version__ = "0.03" + __version__ = "0.04" __type__ = "hoster" - __pattern__ = r"http?://.*fastix.ru\..*" + __pattern__ = r"http://(?:www\.)?fastix\.(ru|it)/file/(?P<ID>[a-zA-Z0-9]{24})" __description__ = """Fastix hoster plugin""" - __author_name__ = ("Massimo, Rosamilia") + __author_name__ = ("Massimo Rosamilia") __author_mail__ = ("max@spiritix.eu") def getFilename(self, url): -- cgit v1.2.3 From 089d8cbbffcaa929723defc39d2d2c2ae872c096 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 16 Nov 2013 14:33:20 +0100 Subject: Hoster: NowDownloadEu: Plugin updated to support new ch domain --- module/plugins/hoster/NowDownloadEu.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index f1cace73b..b5e6b6493 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -24,16 +24,18 @@ from module.utils import fixup class NowDownloadEu(SimpleHoster): __name__ = "NowDownloadEu" __type__ = "hoster" - __pattern__ = r"http://(www\.)?nowdownload\.(eu|co)/dl/(?P<ID>[a-z0-9]+)" - __version__ = "0.02" - __description__ = """NowDownloadEu""" - __author_name__ = ("godofdream") + __pattern__ = r"http://(?:www\.)?nowdownload\.(ch|eu|co)/(dl/|download\.php\?id=)(?P<ID>[a-z0-9]+)" + __version__ = "0.03" + __description__ = """NowDownloadCh""" + __author_name__ = ("godofdream", "Walter Purcaro") + __author_mail__ = ("", "vuolter@gmail.com") + FILE_INFO_PATTERN = r'Downloading</span> <br> (?P<N>.*) (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B </h4>' FILE_OFFLINE_PATTERN = r'(This file does not exist!)' FILE_TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"' FILE_CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"' FILE_WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' - FILE_DOWNLOAD_LINK = r'"(http://f\d+\.nowdownload\.eu/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"' + FILE_DOWNLOAD_LINK = r'"(http://f\d+\.nowdownload\.ch/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"' FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')] @@ -45,19 +47,21 @@ class NowDownloadEu(SimpleHoster): def handleFree(self): tokenlink = re.search(self.FILE_TOKEN_PATTERN, self.html) continuelink = re.search(self.FILE_CONTINUE_PATTERN, self.html) - if (not tokenlink) or (not continuelink): + if not tokenlink or not continuelink: self.fail('Plugin out of Date') - wait = 60 found = re.search(self.FILE_WAIT_PATTERN, self.html) if found: wait = int(found.group(1)) + else + wait = 60 - self.html = self.load("http://www.nowdownload.eu" + str(tokenlink.group(1))) + baseurl = "http://www.nowdownload.ch" + self.html = self.load(baseurl + str(tokenlink.group(1))) self.setWait(wait) self.wait() - self.html = self.load("http://www.nowdownload.eu" + str(continuelink.group(1))) + self.html = self.load(baseurl + str(continuelink.group(1))) url = re.search(self.FILE_DOWNLOAD_LINK, self.html) if not url: -- cgit v1.2.3 From f7c27ed5a81851cb664af10f38057c1bd2bb80cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 17 Nov 2013 10:07:58 +0100 Subject: Hoster: Keep2shareCC: Pattern updated --- module/plugins/hoster/Keep2shareCC.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index 2eada84ec..d2a13e35b 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -27,8 +27,8 @@ from module.plugins.internal.CaptchaService import ReCaptcha class Keep2shareCC(SimpleHoster): __name__ = "Keep2shareCC" __type__ = "hoster" - __pattern__ = r"http://(?:www\.)?(?:keep2share|k2s)\.cc/file/(?P<ID>.+)" - __version__ = "0.04" + __pattern__ = r"https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P<ID>[a-zA-Z0-9]{13})" + __version__ = "0.05" __description__ = """Keep2share.cc hoster plugin""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -51,7 +51,7 @@ class Keep2shareCC(SimpleHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: wait_string = m.group(1) - wait_time = int(wait_string[0:2]) * 3600 + int(wait_string[3:5]) * 60 + int(wait_string[6:8]) + wait_time = int(wait_string[0:2]) * 60 * 60 + int(wait_string[3:5]) * 60 + int(wait_string[6:8]) self.setWait(wait_time, True) self.wait() self.process(self.pyfile) -- cgit v1.2.3