diff options
author | Ivo Buff <kagenoshin@gmx.ch> | 2013-07-12 11:28:40 +0200 |
---|---|---|
committer | Ivo Buff <kagenoshin@gmx.ch> | 2013-07-12 11:28:40 +0200 |
commit | 88f6fcac584da7e822d9ac4084553972c521f044 (patch) | |
tree | 79d7c70e65564e65baebc24502d9461241ca3680 /module/plugins/hoster | |
parent | SimplydebridCOM plugin added (diff) | |
download | pyload-88f6fcac584da7e822d9ac4084553972c521f044.tar.xz |
Cleanup
Some cleanup and changed tabs to 4 spaces
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/SimplydebridCOM.py | 75 |
1 files changed, 36 insertions, 39 deletions
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 |