summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-06 17:18:40 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-06 17:18:40 +0100
commitca0ce20d5a805080f69dad4c24997ace1958bbcb (patch)
tree7208656c5880b340d182a9f2d3752b2fbe26c18e /module/plugins/hoster
parent[RestartSlow] Temp removed (diff)
downloadpyload-ca0ce20d5a805080f69dad4c24997ace1958bbcb.tar.xz
Plugin code cosmetics
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/BasePlugin.py2
-rw-r--r--module/plugins/hoster/DebridItaliaCom.py2
-rw-r--r--module/plugins/hoster/MultishareCz.py9
-rw-r--r--module/plugins/hoster/NowDownloadSx.py (renamed from module/plugins/hoster/NowDownloadEu.py)10
-rw-r--r--module/plugins/hoster/NowVideoSx.py (renamed from module/plugins/hoster/NowVideoAt.py)8
-rw-r--r--module/plugins/hoster/RgHostNet.py13
6 files changed, 20 insertions, 24 deletions
diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py
index 0b1888e3b..c8d632dc7 100644
--- a/module/plugins/hoster/BasePlugin.py
+++ b/module/plugins/hoster/BasePlugin.py
@@ -60,7 +60,7 @@ class BasePlugin(Hoster):
self.logDebug("Logging on to %s" % server)
self.req.addAuth(account.accounts[server]['password'])
else:
- for pwd in pyfile.package().password.splitlines():
+ for pwd in self.getPassword().splitlines():
if ":" in pwd:
self.req.addAuth(pwd.strip())
break
diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py
index cb5d4c06a..17342b8cd 100644
--- a/module/plugins/hoster/DebridItaliaCom.py
+++ b/module/plugins/hoster/DebridItaliaCom.py
@@ -38,7 +38,7 @@ class DebridItaliaCom(Hoster):
self.fail(_("No DebridItalia account provided"))
else:
- html = self.load("http://www.debriditalia.com/api.php?generate=&link=%s" % pyfile.url)
+ html = self.load("http://www.debriditalia.com/api.php", get={'generate': "", 'link': pyfile.url})
if "ERROR" in html:
self.fail(re.search(r'ERROR:(.*)', html).strip())
diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py
index 10628149f..fc866e2b1 100644
--- a/module/plugins/hoster/MultishareCz.py
+++ b/module/plugins/hoster/MultishareCz.py
@@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class MultishareCz(SimpleHoster):
__name__ = "MultishareCz"
__type__ = "hoster"
- __version__ = "0.34"
+ __version__ = "0.35"
__pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P<ID>\d+).*'
@@ -19,10 +19,13 @@ class MultishareCz(SimpleHoster):
__authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
- INFO_PATTERN = ur'(?:<li>Název|Soubor): <strong>(?P<N>[^<]+)</strong><(?:/li><li|br)>Velikost: <strong>(?P<S>[^<]+)</strong>'
- OFFLINE_PATTERN = ur'<h1>Stáhnout soubor</h1><p><strong>Požadovaný soubor neexistuje.</strong></p>'
SIZE_REPLACEMENTS = [('&nbsp;', '')]
+ MULTI_HOSTER = True
+
+ INFO_PATTERN = ur'(?:<li>Název|Soubor): <strong>(?P<N>[^<]+)</strong><(?:/li><li|br)>Velikost: <strong>(?P<S>[^<]+)</strong>'
+ OFFLINE_PATTERN = ur'<h1>Stáhnout soubor</h1><p><strong>Požadovaný soubor neexistuje.</strong></p>'
+
def process(self, pyfile):
msurl = re.match(self.__pattern__, pyfile.url)
diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadSx.py
index 287026460..939b94260 100644
--- a/module/plugins/hoster/NowDownloadEu.py
+++ b/module/plugins/hoster/NowDownloadSx.py
@@ -6,14 +6,14 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.utils import fixup
-class NowDownloadEu(SimpleHoster):
- __name__ = "NowDownloadEu"
+class NowDownloadSx(SimpleHoster):
+ __name__ = "NowDownloadSx"
__type__ = "hoster"
__version__ = "0.05"
__pattern__ = r'http://(?:www\.)?nowdownload\.(at|ch|co|eu|sx)/(dl/|download\.php\?id=)\w+'
- __description__ = """NowDownload.at hoster plugin"""
+ __description__ = """NowDownload.sx hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("godofdream", "soilfiction@gmail.com"),
("Walter Purcaro", "vuolter@gmail.com")]
@@ -25,7 +25,7 @@ class NowDownloadEu(SimpleHoster):
TOKEN_PATTERN = r'"(/api/token\.php\?token=\w+)"'
CONTINUE_PATTERN = r'"(/dl2/\w+/\w+)"'
WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),'
- LINK_PATTERN = r'"(http://f\d+\.nowdownload\.at/dl/\w+/\w+)'
+ LINK_PATTERN = r'(http://s\d+\.coolcdn\.info/nowdownload/.+?)["\']'
NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')]
@@ -60,4 +60,4 @@ class NowDownloadEu(SimpleHoster):
self.download(str(url.group(1)))
-getInfo = create_getInfo(NowDownloadEu)
+getInfo = create_getInfo(NowDownloadSx)
diff --git a/module/plugins/hoster/NowVideoAt.py b/module/plugins/hoster/NowVideoSx.py
index 3d9b706d3..0623f49d6 100644
--- a/module/plugins/hoster/NowVideoAt.py
+++ b/module/plugins/hoster/NowVideoSx.py
@@ -5,14 +5,14 @@ import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-class NowVideoAt(SimpleHoster):
- __name__ = "NowVideoAt"
+class NowVideoSx(SimpleHoster):
+ __name__ = "NowVideoSx"
__type__ = "hoster"
__version__ = "0.07"
__pattern__ = r'http://(?:www\.)?nowvideo\.(at|ch|co|eu|sx)/(video|mobile/#/videos)/(?P<ID>\w+)'
- __description__ = """NowVideo.at hoster plugin"""
+ __description__ = """NowVideo.sx hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
@@ -41,4 +41,4 @@ class NowVideoAt(SimpleHoster):
self.download(m.group(1))
-getInfo = create_getInfo(NowVideoAt)
+getInfo = create_getInfo(NowVideoSx)
diff --git a/module/plugins/hoster/RgHostNet.py b/module/plugins/hoster/RgHostNet.py
index 982e18eda..aa4830563 100644
--- a/module/plugins/hoster/RgHostNet.py
+++ b/module/plugins/hoster/RgHostNet.py
@@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class RgHostNet(SimpleHoster):
__name__ = "RgHostNet"
__type__ = "hoster"
- __version__ = "0.02"
+ __version__ = "0.03"
__pattern__ = r'http://(?:www\.)?rghost\.net/\d+(?:r=\d+)?'
@@ -17,17 +17,10 @@ class RgHostNet(SimpleHoster):
__authors__ = [("z00nx", "z00nx0@gmail.com")]
- INFO_PATTERN = r'<h1>\s+(<a[^>]+>)?(?P<N>[^<]+)(</a>)?\s+<small[^>]+>\s+\((?P<S>[^)]+)\)\s+</small>\s+</h1>'
+ INFO_PATTERN = r'<h1>\s+(<a[^>]+>)?(?P<N>[^<]+)(</a>)?\s+<small[^>]+>\s+\((?P<S>[^)]+)\)\s+</small>\s+</h1>'
OFFLINE_PATTERN = r'File is deleted|this page is not found'
- LINK_PATTERN = r'''<a\s+href="([^"]+)"\s+class="btn\s+large\s+download"[^>]+>Download</a>'''
-
- def handleFree(self):
- m = re.search(self.LINK_PATTERN, self.html)
- if m is None:
- self.error(_("LINK_PATTERN not found"))
- download_link = m.group(1)
- self.download(download_link, disposition=True)
+ LINK_FREE_PATTERN = r'<a\s+href="([^"]+)"\s+class="btn\s+large\s+download"[^>]+>Download</a>'
getInfo = create_getInfo(RgHostNet)