summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/plugins/accounts/DebridItaliaCom.py30
-rw-r--r--module/plugins/accounts/OboomCom.py12
-rw-r--r--module/plugins/accounts/PremiumTo.py2
-rw-r--r--module/plugins/accounts/RapiduNet.py45
-rw-r--r--module/plugins/container/RSDF.py4
-rw-r--r--module/plugins/crypter/RelinkUs.py4
-rw-r--r--module/plugins/hooks/DebridItaliaCom.py17
-rw-r--r--module/plugins/hooks/ExtractArchive.py4
-rw-r--r--module/plugins/hooks/HotFolder.py4
-rw-r--r--module/plugins/hooks/UpdateManager.py4
-rw-r--r--module/plugins/hoster/BezvadataCz.py2
-rw-r--r--module/plugins/hoster/DateiTo.py20
-rw-r--r--module/plugins/hoster/DebridItaliaCom.py37
-rw-r--r--module/plugins/hoster/DodanePl.py18
-rw-r--r--module/plugins/hoster/FastshareCz.py10
-rw-r--r--module/plugins/hoster/FileSharkPl.py95
-rw-r--r--module/plugins/hoster/FilerNet.py69
-rw-r--r--module/plugins/hoster/FreakshareCom.py4
-rw-r--r--module/plugins/hoster/FshareVn.py2
-rw-r--r--module/plugins/hoster/GigapetaCom.py2
-rw-r--r--module/plugins/hoster/Keep2shareCc.py4
-rw-r--r--module/plugins/hoster/PremiumTo.py4
-rw-r--r--module/plugins/hoster/RapiduNet.py82
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py1
-rw-r--r--module/plugins/hoster/UploadheroCom.py2
-rw-r--r--module/plugins/internal/SimpleHoster.py4
-rw-r--r--module/plugins/internal/XFSHoster.py2
27 files changed, 321 insertions, 163 deletions
diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py
index f5a536004..e9d4964cc 100644
--- a/module/plugins/accounts/DebridItaliaCom.py
+++ b/module/plugins/accounts/DebridItaliaCom.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
import re
-import time
+
+from time import mktime, strptime
from module.plugins.Account import Account
@@ -9,32 +10,35 @@ from module.plugins.Account import Account
class DebridItaliaCom(Account):
__name__ = "DebridItaliaCom"
__type__ = "account"
- __version__ = "0.1"
+ __version__ = "0.11"
__description__ = """Debriditalia.com account plugin"""
__license__ = "GPLv3"
- __authors__ = [("stickell", "l.stickell@yahoo.it")]
+ __authors__ = [("stickell", "l.stickell@yahoo.it"),
+ ("Walter Purcaro", "vuolter@gmail.com")]
- WALID_UNTIL_PATTERN = r'Premium valid till: (?P<D>[^|]+) \|'
+ WALID_UNTIL_PATTERN = r'Premium valid till: (.+?) \|'
def loadAccountInfo(self, user, req):
+ info = {"premium": False, "validuntil": None, "trafficleft": None}
html = req.load("http://debriditalia.com/")
- if 'Account premium not activated' in html:
- return {"premium": False, "validuntil": None, "trafficleft": None}
+ if 'Account premium not activated' not in html:
+ m = re.search(self.WALID_UNTIL_PATTERN, html)
+ if m:
+ validuntil = int(mktime(strptime(m.group(1), "%d/%m/%Y %H:%M")))
+ info = {"premium": True, "validuntil": validuntil, "trafficleft": -1}
+ else:
+ self.logError(_("Unable to retrieve account information"))
- m = re.search(self.WALID_UNTIL_PATTERN, html)
- if m:
- validuntil = int(time.mktime(time.strptime(m.group('D'), "%d/%m/%Y %H:%M")))
- return {"premium": True, "validuntil": validuntil, "trafficleft": -1}
- else:
- self.logError(_("Unable to retrieve account information"))
+ return info
def login(self, user, data, req):
html = req.load("http://debriditalia.com/login.php",
- get={"u": user, "p": data['password']})
+ get={'u': user, 'p': data['password']})
+
if 'NO' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py
index 067edc92a..9bb45224c 100644
--- a/module/plugins/accounts/OboomCom.py
+++ b/module/plugins/accounts/OboomCom.py
@@ -11,7 +11,7 @@ from module.plugins.Account import Account
class OboomCom(Account):
__name__ = "OboomCom"
__type__ = "account"
- __version__ = "0.2"
+ __version__ = "0.21"
__description__ = """Oboom.com account plugin"""
__license__ = "GPLv3"
@@ -51,11 +51,11 @@ class OboomCom(Account):
session = accountData['session']
- return {'premium': premium,
- 'validuntil': validUntil,
- 'trafficleft': trafficLeft,
- 'maxtraffic': maxTraffic,
- 'session': session}
+ return {'premium' : premium,
+ 'validuntil' : validUntil,
+ 'trafficleft': trafficLeft / 1024, #@TODO: Remove / 1024 in 0.4.10
+ 'maxtraffic' : maxTraffic / 1024, #@TODO: Remove / 1024 in 0.4.10
+ 'session' : session}
def login(self, user, data, req):
diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py
index 9acb5ad1c..44bce1c7c 100644
--- a/module/plugins/accounts/PremiumTo.py
+++ b/module/plugins/accounts/PremiumTo.py
@@ -20,7 +20,7 @@ class PremiumTo(Account):
get={'username': self.username, 'password': self.password})
traffic = sum(map(int, api_r.split(';')))
- return {"trafficleft": int(traffic) / 1024, "validuntil": -1}
+ return {"trafficleft": int(traffic) / 1024, "validuntil": -1} #@TODO: Remove / 1024 in 0.4.10
def login(self, user, data, req):
diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py
new file mode 100644
index 000000000..2fabb6120
--- /dev/null
+++ b/module/plugins/accounts/RapiduNet.py
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+
+import re
+from module.plugins.Account import Account
+from module.common.json_layer import json_loads
+
+
+class RapiduNet(Account):
+ __name__ = "RapiduNet"
+ __type__ = "account"
+ __version__ = "0.01"
+
+ __description__ = """Rapidu.net account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("prOq", None)]
+
+
+ ACCOUNT_INFO_PATTERN = '<a href="premium/" style="padding-left: 0px;">Account: <b>(.*?)</b></a>'
+
+
+ def loadAccountInfo(self, user, req):
+ premium = False
+
+ req.load('https://rapidu.net/ajax.php?a=getChangeLang', post={"_go": "", "lang": "en"})
+ self.html = req.load('https://rapidu.net/', decode=True)
+
+ m = re.search(self.ACCOUNT_INFO_PATTERN, self.html)
+ if m:
+ if m.group(1) == "Premium":
+ premium = True
+
+ return {"validuntil": None, "trafficleft": None, "premium": premium}
+
+
+ def login(self, user, data, req):
+ try:
+ json = req.load('https://rapidu.net/ajax.php?a=getUserLogin', post={"_go": "", "login": user, "pass": data['password'], "member": "1"})
+ json = json_loads(json)
+ self.logDebug(json)
+
+ if not json['message'] == "success":
+ self.wrongPassword()
+ except Exception, e:
+ self.logError(e)
+
diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py
index 9c57c8ddb..0c43f0e6c 100644
--- a/module/plugins/container/RSDF.py
+++ b/module/plugins/container/RSDF.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
+from __future__ import with_statement
+
import base64
import binascii
import re
@@ -10,7 +12,7 @@ from module.utils import fs_encode
class RSDF(Container):
__name__ = "RSDF"
- __version__ = "0.23"
+ __version__ = "0.24"
__pattern__ = r'.+\.rsdf'
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index 4c84b62f7..1111118b2 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
+from __future__ import with_statement
+
import base64
import binascii
import re
@@ -12,7 +14,7 @@ from module.plugins.Crypter import Crypter
class RelinkUs(Crypter):
__name__ = "RelinkUs"
__type__ = "crypter"
- __version__ = "3.1"
+ __version__ = "3.11"
__pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<id>.+)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py
index 86d37b3bd..b7f0ef1c7 100644
--- a/module/plugins/hooks/DebridItaliaCom.py
+++ b/module/plugins/hooks/DebridItaliaCom.py
@@ -1,12 +1,15 @@
# -*- coding: utf-8 -*-
+import re
+
+from module.network.RequestFactory import getURL
from module.plugins.internal.MultiHoster import MultiHoster
class DebridItaliaCom(MultiHoster):
__name__ = "DebridItaliaCom"
__type__ = "hook"
- __version__ = "0.07"
+ __version__ = "0.08"
__config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", ""),
@@ -15,14 +18,10 @@ class DebridItaliaCom(MultiHoster):
__description__ = """Debriditalia.com hook plugin"""
__license__ = "GPLv3"
- __authors__ = [("stickell", "l.stickell@yahoo.it")]
+ __authors__ = [("stickell", "l.stickell@yahoo.it"),
+ ("Walter Purcaro", "vuolter@gmail.com")]
def getHoster(self):
- return ["netload.in", "hotfile.com", "rapidshare.com", "multiupload.com",
- "uploading.com", "megashares.com", "crocko.com", "filepost.com",
- "bitshare.com", "share-links.biz", "putlocker.com", "uploaded.to",
- "speedload.org", "rapidgator.net", "likeupload.net", "cyberlocker.ch",
- "depositfiles.com", "extabit.com", "filefactory.com", "sharefiles.co",
- "ryushare.com", "tusfiles.net", "nowvideo.co", "cloudzer.net", "letitbit.net",
- "easybytez.com", "uptobox.com", "ddlstorage.com"]
+ html = getURL("http://www.debriditalia.com/status.php")
+ return re.findall(r'title="(.+?)"> \1</td><td><img src="/images/(?:attivo|testing)', html)
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 11c44a6d1..07db13aa1 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
+from __future__ import with_statement
+
import os
import sys
@@ -57,7 +59,7 @@ from module.utils import save_join, fs_encode
class ExtractArchive(Hook):
__name__ = "ExtractArchive"
__type__ = "hook"
- __version__ = "0.17"
+ __version__ = "0.18"
__config__ = [("activated", "bool", "Activated", True),
("fullpath", "bool", "Extract full path", True),
diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py
index 518bbac2b..b0b59e2ba 100644
--- a/module/plugins/hooks/HotFolder.py
+++ b/module/plugins/hooks/HotFolder.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
+from __future__ import with_statement
+
import time
from os import listdir, makedirs
@@ -13,7 +15,7 @@ from module.utils import fs_encode, save_join
class HotFolder(Hook):
__name__ = "HotFolder"
__type__ = "hook"
- __version__ = "0.11"
+ __version__ = "0.12"
__config__ = [("folder", "str", "Folder to observe", "container"),
("watch_file", "bool", "Observe link file", False),
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index a47742ab5..c72699228 100644
--- a/module/plugins/hooks/UpdateManager.py
+++ b/module/plugins/hooks/UpdateManager.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
+from __future__ import with_statement
+
import re
import sys
@@ -14,7 +16,7 @@ from module.utils import save_join
class UpdateManager(Hook):
__name__ = "UpdateManager"
__type__ = "hook"
- __version__ = "0.41"
+ __version__ = "0.42"
__config__ = [("activated" , "bool" , "Activated" , True ),
("mode" , "pyLoad + plugins;plugins only", "Check updates for" , "pyLoad + plugins"),
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py
index cefa04e9e..d89616c86 100644
--- a/module/plugins/hoster/BezvadataCz.py
+++ b/module/plugins/hoster/BezvadataCz.py
@@ -83,6 +83,8 @@ class BezvadataCz(SimpleHoster):
elif '<div class="infobox' in self.html:
self.tempOffline()
+ self.info.pop('error', None)
+
def loadcaptcha(self, data, *args, **kwargs):
return data.decode("base64")
diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py
index 683c6b75d..e4bff8458 100644
--- a/module/plugins/hoster/DateiTo.py
+++ b/module/plugins/hoster/DateiTo.py
@@ -18,12 +18,13 @@ class DateiTo(SimpleHoster):
__authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
- NAME_PATTERN = r'Dateiname:</td>\s*<td colspan="2"><strong>(?P<N>.*?)</'
- SIZE_PATTERN = r'Dateigr&ouml;&szlig;e:</td>\s*<td colspan="2">(?P<S>.*?)</'
+ NAME_PATTERN = r'Dateiname:</td>\s*<td colspan="2"><strong>(?P<N>.*?)</'
+ SIZE_PATTERN = r'Dateigr&ouml;&szlig;e:</td>\s*<td colspan="2">(?P<S>.*?)</'
OFFLINE_PATTERN = r'>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+)'
+ WAIT_PATTERN = r'countdown\({seconds: (\d+)'
+ MULTIDL_PATTERN = r'>Du lädst bereits eine Datei herunter<'
+
DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",'
@@ -55,16 +56,19 @@ class DateiTo(SimpleHoster):
else:
self.fail(_("Too bad..."))
- download_url = self.html
- self.download(download_url)
+ self.download(self.html)
def checkErrors(self):
- m = re.search(self.PARALELL_PATTERN, self.html)
+ m = re.search(self.MULTIDL_PATTERN, self.html)
if m:
m = re.search(self.WAIT_PATTERN, self.html)
wait_time = int(m.group(1)) if m else 30
- self.retry(wait_time=wait_time)
+
+ errmsg = self.info['error'] = _("Parallel downloads")
+ self.retry(wait_time=wait_time, reason=errmsg)
+
+ self.info.pop('error', None)
def doWait(self):
diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py
index dbac000c8..90f1233ff 100644
--- a/module/plugins/hoster/DebridItaliaCom.py
+++ b/module/plugins/hoster/DebridItaliaCom.py
@@ -3,48 +3,51 @@
import re
from module.plugins.Hoster import Hoster
+from module.plugins.internal.SimpleHoster import replace_patterns
class DebridItaliaCom(Hoster):
__name__ = "DebridItaliaCom"
__type__ = "hoster"
- __version__ = "0.05"
+ __version__ = "0.06"
- __pattern__ = r'https?://(?:[^/]*\.)?debriditalia\.com'
+ __pattern__ = r'http://s\d+\.debriditalia\.com/dl/\d+'
__description__ = """Debriditalia.com hoster plugin"""
__license__ = "GPLv3"
- __authors__ = [("stickell", "l.stickell@yahoo.it")]
+ __authors__ = [("stickell", "l.stickell@yahoo.it"),
+ ("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ URL_REPLACEMENTS = [(r'(/dl/\d+)$', '\1/')]
def setup(self):
- self.chunkLimit = -1
+ self.chunkLimit = -1
self.resumeDownload = True
def process(self, pyfile):
+ pyfile.url = replace_patterns(pyfile.url, cls.URL_REPLACEMENTS)
+
if re.match(self.__pattern__, pyfile.url):
- new_url = pyfile.url
+ link = pyfile.url
+
elif not self.account:
self.logError(_("Please enter your %s account or deactivate this plugin") % "DebridItalia")
self.fail(_("No DebridItalia account provided"))
+
else:
- self.logDebug("Old URL: %s" % pyfile.url)
- url = "http://debriditalia.com/linkgen2.php?xjxfun=convertiLink&xjxargs[]=S<![CDATA[%s]]>" % pyfile.url
- page = self.load(url)
- self.logDebug("XML data: %s" % page)
+ html = self.load("http://www.debriditalia.com/api.php?generate=&link=%s" % pyfile.url)
- if 'File not available' in page:
- self.fail(_("File not available"))
- else:
- new_url = re.search(r'<a href="(?:[^"]+)">(?P<direct>[^<]+)</a>', page).group('direct')
+ if "ERROR" in html:
+ self.fail(re.search(r'ERROR:(.*)', html).split())
- if new_url != pyfile.url:
- self.logDebug("New URL: %s" % new_url)
+ link = html.split()
- self.download(new_url, disposition=True)
+ self.download(link, disposition=True)
- check = self.checkDownload({"empty": re.compile(r"^$")})
+ check = self.checkDownload({'empty': re.compile(r"^$")})
if check == "empty":
self.retry(5, 2 * 60, "Empty file downloaded")
diff --git a/module/plugins/hoster/DodanePl.py b/module/plugins/hoster/DodanePl.py
new file mode 100644
index 000000000..58f1c02d8
--- /dev/null
+++ b/module/plugins/hoster/DodanePl.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.DeadHoster import DeadHoster, parseFileInfo
+
+
+class DodanePl(DeadHoster):
+ __name__ = "DodanePl"
+ __type__ = "hoster"
+ __version__ = "0.03"
+
+ __pattern__ = r'http://(?:www\.)?dodane\.pl/file/\d+'
+
+ __description__ = """Dodane.pl hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("z00nx", "z00nx0@gmail.com")]
+
+
+getInfo = create_getInfo(DodanePl)
diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py
index 8b01b5edd..1f1e9e6ee 100644
--- a/module/plugins/hoster/FastshareCz.py
+++ b/module/plugins/hoster/FastshareCz.py
@@ -35,14 +35,16 @@ class FastshareCz(SimpleHoster):
def checkErrors(self):
if self.SLOT_ERROR in self.html:
- e = self.info['error'] = _("No free slots")
- self.retry(12, 60, e)
+ errmsg = self.info['error'] = _("No free slots")
+ self.retry(12, 60, errmsg)
if self.CREDIT_ERROR in self.html:
- e = self.info['error'] = _("Not enough traffic left")
- self.logWarning(e)
+ errmsg = self.info['error'] = _("Not enough traffic left")
+ self.logWarning(errmsg)
self.resetAccount()
+ self.info.pop('error', None)
+
def handleFree(self):
m = re.search(self.FREE_URL_PATTERN, self.html)
diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py
index 5a9cbb456..ea2b56821 100644
--- a/module/plugins/hoster/FileSharkPl.py
+++ b/module/plugins/hoster/FileSharkPl.py
@@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FileSharkPl(SimpleHoster):
__name__ = "FileSharkPl"
__type__ = "hoster"
- __version__ = "0.01"
+ __version__ = "0.03"
__pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d{6}/\w{5}'
@@ -20,22 +20,23 @@ class FileSharkPl(SimpleHoster):
("Walter Purcaro", "vuolter@gmail.com")]
+ CONTENT_DISPOSITION = True
+
NAME_PATTERN = r'<h2 class="name-file">(?P<N>.+)</h2>'
SIZE_PATTERN = r'<p class="size-file">(.*?)<strong>(?P<S>\d+\.?\d*)\s(?P<U>\w+)</strong></p>'
OFFLINE_PATTERN = '(P|p)lik zosta. (usuni.ty|przeniesiony)'
- DOWNLOAD_ALERT = r'<p class="lead text-center alert alert-warning">(.*?)</p>'
- IP_BLOCKED_PATTERN = 'Strona jest dost.pna wy..cznie dla u.ytkownik.w znajduj.cych si. na terenie Polski'
- DOWNLOAD_SLOTS_ERROR_PATTERN = r'Osi.gni.to maksymaln. liczb. .ci.ganych jednocze.nie plik.w\.'
-
- DOWNLOAD_URL_FREE = r'<a href="(.*?)" class="btn-upload-free">'
- DOWNLOAD_URL_PREMIUM = r'<a href="(.*?)" class="btn-upload-premium">'
+ LINK_FREE_PATTERN = r'<a href="(.*?)" class="btn-upload-free">'
+ LINK_PREMIUM_PATTERN = r'<a href="(.*?)" class="btn-upload-premium">'
- SECONDS_PATTERN = r'var timeToDownload = (\d+);'
+ WAIT_PATTERN = r'var timeToDownload = (\d+);'
+ ERROR_PATTERN = r'<p class="lead text-center alert alert-warning">(.*?)</p>'
+ IP_ERROR_PATTERN = r'Strona jest dost.pna wy..cznie dla u.ytkownik.w znajduj.cych si. na terenie Polski'
+ SLOT_ERROR_PATTERN = r'Osi.gni.to maksymaln. liczb. .ci.ganych jednocze.nie plik.w\.'
- CAPTCHA_IMG_PATTERN = '<img src="data:image/jpeg;base64,(.*?)" title="captcha"'
- CAPTCHA_TOKEN_PATTERN = r'name="form\[_token\]" value="(.*?)" />'
+ CAPTCHA_PATTERN = '<img src="data:image/jpeg;base64,(.*?)" title="captcha"'
+ TOKEN_PATTERN = r'name="form\[_token\]" value="(.*?)" />'
def setup(self):
@@ -47,77 +48,79 @@ class FileSharkPl(SimpleHoster):
self.multiDL = False
- def prepare(self):
- super(FileSharkPl, self).prepare()
+ def checkErrors(self):
+ # check if file is now available for download (-> file name can be found in html body)
+ m = re.search(self.WAIT_PATTERN, self.html)
+ if m:
+ errmsg = self.info['error'] = _("Another download already run")
+ self.retry(15, int(m.group(1)), errmsg)
- m = re.search(self.DOWNLOAD_ALERT, self.html):
+ m = re.search(self.ERROR_PATTERN, self.html):
if m:
- return
+ alert = m.group(1)
- alert = m.group(1)
+ if re.match(self.IP_ERROR_PATTERN, alert):
+ self.fail(_("Only connections from Polish IP are allowed"))
- if re.match(self.IP_BLOCKED_PATTERN, alert):
- self.fail(_("Only connections from Polish IP are allowed"))
- elif re.match(self.DOWNLOAD_SLOTS_ERROR_PATTERN, alert):
- self.logInfo(_("No free download slots available"))
- self.retry(10, 30 * 60, _("Still no free download slots available"))
- else:
- self.logInfo(alert)
- self.retry(10, 10 * 60, _("Try again later"))
+ elif re.match(self.SLOT_ERROR_PATTERN, alert):
+ errmsg = self.info['error'] = _("No free download slots available")
+ self.logWarning(errmsg)
+ self.retry(10, 30 * 60, _("Still no free download slots available"))
+
+ else:
+ self.info['error'] = alert
+ self.retry(10, 10 * 60, _("Try again later"))
+
+ self.info.pop('error', None)
#@NOTE: handlePremium method was never been tested
def handlePremium(self):
- self.logDebug("Premium accounts support in experimental modus!")
- m = re.search(self.DOWNLOAD_URL_PREMIUM, self.html)
- file_url = urljoin("http://fileshark.pl", m.group(1))
-
- self.download(file_url, disposition=True)
- self.checkDownload()
+ super(FilerNet, self).handlePremium()
+ if self.link:
+ self.link = urljoin("http://fileshark.pl/", self.link)
def handleFree(self):
- m = re.search(self.DOWNLOAD_URL_FREE, self.html)
+ m = re.search(self.LINK_FREE_PATTERN, self.html)
if m is None:
self.error(_("Download url not found"))
- file_url = urljoin("http://fileshark.pl", m.group(1))
+ link = urljoin("http://fileshark.pl", m.group(1))
- m = re.search(self.SECONDS_PATTERN, self.html)
+ m = re.search(self.WAIT_PATTERN, self.html)
if m:
seconds = int(m.group(1))
self.logDebug("Wait %s seconds" % seconds)
- self.wait(seconds + 2)
+ self.wait(seconds)
action, inputs = self.parseHtmlForm('action=""')
- m = re.search(self.CAPTCHA_TOKEN_PATTERN, self.html)
+
+ m = re.search(self.TOKEN_PATTERN, self.html)
if m is None:
self.retry(reason=_("Captcha form not found"))
inputs['form[_token]'] = m.group(1)
- m = re.search(self.CAPTCHA_IMG_PATTERN, self.html)
+ m = re.search(self.CAPTCHA_PATTERN, self.html)
if m is None:
self.retry(reason=_("Captcha image not found"))
- tmp_load = self.load
- self.load = self.decode64 #: injects decode64 inside decryptCaptcha
+ tmp_load = self.load
+ self.load = self._decode64 #: work-around: injects decode64 inside decryptCaptcha
inputs['form[captcha]'] = self.decryptCaptcha(m.group(1), imgtype='jpeg')
inputs['form[start]'] = ""
self.load = tmp_load
- self.download(file_url, post=inputs, cookies=True, disposition=True)
- self.checkDownload()
+ self.download(link, post=inputs, cookies=True, disposition=True)
- def checkDownload(self):
- check = super(FileSharkPl, self).checkDownload({
- 'wrong_captcha': re.compile(r'<label for="form_captcha" generated="true" class="error">(.*?)</label>'),
- 'wait_pattern': re.compile(self.SECONDS_PATTERN),
- 'DL-found': re.compile('<a href="(.*)">')
- })
+ def checkFile(self):
+ check = self.checkDownload({'wrong_captcha': re.compile(r'<label for="form_captcha" generated="true" class="error">(.*?)</label>'),
+ 'wait_pattern' : re.compile(self.SECONDS_PATTERN),
+ 'DL-found' : re.compile('<a href="(.*)">')})
if check == "DL-found":
self.correctCaptcha()
@@ -130,7 +133,7 @@ class FileSharkPl(SimpleHoster):
self.retry()
- def decode64(self, data, *args, **kwargs):
+ def _decode64(self, data, *args, **kwargs):
return data.decode("base64")
diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py
index d9876c573..c943a076d 100644
--- a/module/plugins/hoster/FilerNet.py
+++ b/module/plugins/hoster/FilerNet.py
@@ -4,7 +4,6 @@
# http://filer.net/get/ivgf5ztw53et3ogd
# http://filer.net/get/hgo14gzcng3scbvv
-import pycurl
import re
from urlparse import urljoin
@@ -16,83 +15,67 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FilerNet(SimpleHoster):
__name__ = "FilerNet"
__type__ = "hoster"
- __version__ = "0.08"
+ __version__ = "0.09"
__pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+'
__description__ = """Filer.net hoster plugin"""
__license__ = "GPLv3"
- __authors__ = [("stickell", "l.stickell@yahoo.it")]
+ __authors__ = [("stickell", "l.stickell@yahoo.it")
+ ("Walter Purcaro", "vuolter@gmail.com")]
- INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>[\w^_]+)</small></h1>'
+ CONTENT_DISPOSITION = True
+
+ INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>[\w^_]+)</small></h1>'
OFFLINE_PATTERN = r'Nicht gefunden'
- LINK_PATTERN = r'href="([^"]+)">Get download</a>'
+ LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'href="([^"]+)">Get download</a>'
- def handleFree(self):
+ def checkErrors(self):
# Wait between downloads
m = re.search(r'musst du <span id="time">(\d+)</span> Sekunden warten', self.html)
if m:
- self.retry(wait_time=int(m.group(1)), reason=_("Wait between free downloads"))
+ errmsg = self.info['error'] = _("Wait between free downloads")
+ self.retry(wait_time=int(m.group(1)), reason=errmsg)
- self.html = self.load(self.pyfile.url, decode=True)
+ self.info.pop('error', None)
+
+ def handleFree(self):
inputs = self.parseHtmlForm(input_names={'token': re.compile(r'.+')})[1]
if 'token' not in inputs:
self.error(_("Unable to detect token"))
- token = inputs['token']
- self.logDebug("Token: " + token)
- self.html = self.load(self.pyfile.url, post={'token': token}, decode=True)
+ self.html = self.load(self.pyfile.url, post={'token': inputs['token']}, decode=True)
inputs = self.parseHtmlForm(input_names={'hash': re.compile(r'.+')})[1]
if 'hash' not in inputs:
self.error(_("Unable to detect hash"))
- hash_data = inputs['hash']
- self.logDebug("Hash: " + hash_data)
- downloadURL = r''
recaptcha = ReCaptcha(self)
for _i in xrange(5):
challenge, response = recaptcha.challenge()
- post_data = {'recaptcha_challenge_field': challenge,
- 'recaptcha_response_field': response,
- 'hash': hash_data}
-
- # Workaround for 0.4.9 just_header issue. In 0.5 clean the code using just_header
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
- self.load(self.pyfile.url, post=post_data)
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
-
- if 'location' in self.req.http.header.lower():
- location = re.search(r'location: (\S+)', self.req.http.header, re.I).group(1)
- downloadURL = urljoin('http://filer.net', location)
+
+ header = self.load(self.pyfile.url,
+ post={'recaptcha_challenge_field': challenge,
+ 'recaptcha_response_field' : response,
+ 'hash' : inputs['hash']})
+
+ if 'location' in header and header['location']:
self.correctCaptcha()
- break
+ self.link = urljoin('http://filer.net', header['location'])
+ return
else:
self.invalidCaptcha()
- 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 'location' in header: # Direct Download ON
- dl = self.pyfile.url
- else: # Direct Download OFF
- html = self.load(self.pyfile.url)
- m = re.search(self.LINK_PATTERN, html)
- if m is None:
- self.error(_("LINK_PATTERN not found"))
- dl = 'http://filer.net' + m.group(1)
-
- self.download(dl, disposition=True)
+ super(FilerNet, self).handlePremium()
+ if self.link:
+ self.link = urljoin("http://filer.net/", self.link)
getInfo = create_getInfo(FilerNet)
diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py
index 1a811b007..00c31c528 100644
--- a/module/plugins/hoster/FreakshareCom.py
+++ b/module/plugins/hoster/FreakshareCom.py
@@ -163,10 +163,6 @@ class FreakshareCom(Hoster):
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"<input\stype=\".*?\"\svalue=\"(\S*?)\".*?name=\"(\S*?)\"\s.*?\/>", herewego)
request_options = dict((n, v) for (v, n) in to_sort)
diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py
index 2ab65ae99..3c230bbe2 100644
--- a/module/plugins/hoster/FshareVn.py
+++ b/module/plugins/hoster/FshareVn.py
@@ -112,6 +112,8 @@ class FshareVn(SimpleHoster):
self.logError(msg)
self.retry(30, 2 * 60, msg)
+ self.info.pop('error', None)
+
def checkDownloadedFile(self):
# check download
diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py
index c015b8ac3..37af7f216 100644
--- a/module/plugins/hoster/GigapetaCom.py
+++ b/module/plugins/hoster/GigapetaCom.py
@@ -61,5 +61,7 @@ class GigapetaCom(SimpleHoster):
self.wait(5 * 60, True)
self.retry()
+ self.info.pop('error', None)
+
getInfo = create_getInfo(GigapetaCom)
diff --git a/module/plugins/hoster/Keep2shareCc.py b/module/plugins/hoster/Keep2shareCc.py
index 7ca29701a..cb5e65a29 100644
--- a/module/plugins/hoster/Keep2shareCc.py
+++ b/module/plugins/hoster/Keep2shareCc.py
@@ -49,8 +49,8 @@ class Keep2shareCc(SimpleHoster):
m = re.search(self.ERROR_PATTERN, self.html)
if m:
- e = self.info['error'] = m.group(1)
- self.error(e)
+ errmsg = self.info['error'] = m.group(1)
+ self.error(errmsg)
m = re.search(self.WAIT_PATTERN, self.html)
if m:
diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py
index beab4391e..b4fe327db 100644
--- a/module/plugins/hoster/PremiumTo.py
+++ b/module/plugins/hoster/PremiumTo.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
+from __future__ import with_statement
+
from os import remove
from os.path import exists
from urllib import quote
@@ -11,7 +13,7 @@ from module.utils import fs_encode
class PremiumTo(Hoster):
__name__ = "PremiumTo"
__type__ = "hoster"
- __version__ = "0.10"
+ __version__ = "0.11"
__pattern__ = r'https?://(?:www\.)?premium\.to/.*'
diff --git a/module/plugins/hoster/RapiduNet.py b/module/plugins/hoster/RapiduNet.py
new file mode 100644
index 000000000..e14b18a4f
--- /dev/null
+++ b/module/plugins/hoster/RapiduNet.py
@@ -0,0 +1,82 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from pycurl import HTTPHEADER
+from time import time, altzone
+
+from module.common.json_layer import json_loads
+from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+class RapiduNet(SimpleHoster):
+ __name__ = "RapiduNet"
+ __type__ = "hoster"
+ __version__ = "0.02"
+
+ __pattern__ = r'https?://(?:www\.)?rapidu\.net/(?P<ID>\d{10})'
+
+ __description__ = """Rapidu.net hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("prOq", None)]
+
+
+ COOKIES = [("rapidu.net", "rapidu_lang", "en")]
+
+ FILE_INFO_PATTERN = r'<h1 title="(?P<N>.*)">.*</h1>\s*<small>(?P<S>\d+(\.\d+)?)\s(?P<U>\w+)</small>'
+ OFFLINE_PATTERN = r'404 - File not found'
+
+ ERROR_PATTERN = r'<div class="error">'
+
+ RECAPTCHA_KEY = r'6Ld12ewSAAAAAHoE6WVP_pSfCdJcBQScVweQh8Io'
+
+
+ def setup(self):
+ self.resumeDownload = True
+ self.multiDL = True
+ self.limitDL = 0 if self.premium else 2
+
+
+ def handleFree(self):
+ self.req.http.lastURL = self.pyfile.url
+ self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
+
+ jsvars = self.getJsonResponse("https://rapidu.net/ajax.php?a=getLoadTimeToDownload", {'_go': None})
+
+ if str(jsvars['timeToDownload']) is "stop":
+ t = (24 * 60 * 60) - (int(time()) % (24 *60 * 60)) + altzone
+
+ self.logInfo("You've reach your daily download transfer")
+
+ self.retry(10, 10 if t < 1 else None, "Try tomorrow again") #@NOTE: check t in case of not synchronised clock
+
+ else:
+ self.wait(int(jsvars['timeToDownload']) - int(time()))
+
+ recaptcha = ReCaptcha(self)
+
+ for _i in xrange(10):
+ challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY)
+
+ jsvars = self.getJsonResponse("https://rapidu.net/ajax.php?a=getCheckCaptcha",
+ {'_go' : None,
+ 'captcha1': challenge,
+ 'captcha2': code,
+ 'fileId' : self.info['ID']})
+ if jsvars['message'] == 'success':
+ self.download(jsvars['url'])
+ break
+
+
+ def getJsonResponse(self, url, post_data):
+ response = self.load(url, post=post_data, decode=True)
+ if not response.startswith('{'):
+ self.retry()
+
+ self.logDebug(url, response)
+
+ return json_loads(response)
+
+
+getInfo = create_getInfo(RapiduNet)
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index d52328fd6..1cb651b12 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -160,6 +160,7 @@ class ShareonlineBiz(SimpleHoster):
def checkErrors(self):
m = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL)
if m is None:
+ self.info.pop('error', None)
return
errmsg = m.group(1).lower()
diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py
index 92066abb5..189079017 100644
--- a/module/plugins/hoster/UploadheroCom.py
+++ b/module/plugins/hoster/UploadheroCom.py
@@ -75,5 +75,7 @@ class UploadheroCom(SimpleHoster):
self.wait(wait_time, True)
self.retry()
+ self.info.pop('error', None)
+
getInfo = create_getInfo(UploadheroCom)
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 809e89c02..f391445fd 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -399,8 +399,8 @@ class SimpleHoster(Hoster):
if hasattr(self, 'ERROR_PATTERN'):
m = re.search(self.ERROR_PATTERN, self.html)
if m:
- e = self.info['error'] = m.group(1)
- self.error(e)
+ errmsg = self.info['error'] = m.group(1)
+ self.error(errmsg)
if hasattr(self, 'PREMIUM_ONLY_PATTERN'):
m = re.search(self.PREMIUM_ONLY_PATTERN, self.html)
diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py
index c3db3f335..3ae0692dc 100644
--- a/module/plugins/internal/XFSHoster.py
+++ b/module/plugins/internal/XFSHoster.py
@@ -256,8 +256,6 @@ class XFSHoster(SimpleHoster):
else:
self.info.pop('error', None)
- return self.errmsg
-
def getPostParameters(self):
if self.FORM_PATTERN or self.FORM_INPUTS_MAP: