summaryrefslogtreecommitdiffstats
path: root/pyload/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin')
-rw-r--r--pyload/plugin/Container.py2
-rw-r--r--pyload/plugin/Crypter.py6
-rw-r--r--pyload/plugin/Plugin.py28
-rw-r--r--pyload/plugin/account/FastixRu.py7
-rw-r--r--pyload/plugin/account/NoPremiumPl.py2
-rw-r--r--pyload/plugin/account/OboomCom.py4
-rw-r--r--pyload/plugin/account/PremiumTo.py2
-rw-r--r--pyload/plugin/account/PremiumizeMe.py2
-rw-r--r--pyload/plugin/account/RapidgatorNet.py2
-rw-r--r--pyload/plugin/account/ShareonlineBiz.py5
-rw-r--r--pyload/plugin/account/SimplyPremiumCom.py2
-rw-r--r--pyload/plugin/account/UnrestrictLi.py2
-rw-r--r--pyload/plugin/account/UploadedTo.py6
-rw-r--r--pyload/plugin/account/ZeveraCom.py2
-rw-r--r--pyload/plugin/addon/AntiVirus.py2
-rw-r--r--pyload/plugin/addon/Checksum.py4
-rw-r--r--pyload/plugin/addon/ClickNLoad.py4
-rw-r--r--pyload/plugin/addon/ExternalScripts.py44
-rw-r--r--pyload/plugin/addon/ExtractArchive.py20
-rw-r--r--pyload/plugin/addon/MergeFiles.py4
-rw-r--r--pyload/plugin/addon/MultiHome.py2
-rw-r--r--pyload/plugin/addon/UpdateManager.py28
-rw-r--r--pyload/plugin/addon/UserAgentSwitcher.py4
-rw-r--r--pyload/plugin/container/CCF.py2
-rw-r--r--pyload/plugin/crypter/DailymotionComFolder.py2
-rw-r--r--pyload/plugin/crypter/MegaCoNz.py3
-rw-r--r--pyload/plugin/crypter/RelinkUs.py2
-rw-r--r--pyload/plugin/crypter/YoutubeComFolder.py2
-rw-r--r--pyload/plugin/hoster/FilerNet.py6
-rw-r--r--pyload/plugin/hoster/FreakshareCom.py2
-rw-r--r--pyload/plugin/hoster/GigapetaCom.py2
-rw-r--r--pyload/plugin/hoster/HostujeNet.py46
-rw-r--r--pyload/plugin/hoster/MegasharesCom.py2
-rw-r--r--pyload/plugin/hoster/QuickshareCz.py2
-rw-r--r--pyload/plugin/hoster/UploadedTo.py4
-rw-r--r--pyload/plugin/hoster/XdadevelopersCom.py3
-rw-r--r--pyload/plugin/hoster/Xdcc.py2
-rw-r--r--pyload/plugin/hoster/YadiSk.py81
-rw-r--r--pyload/plugin/hoster/ZippyshareCom.py4
-rw-r--r--pyload/plugin/internal/SimpleCrypter.py2
-rw-r--r--pyload/plugin/internal/SimpleDereferer.py5
-rw-r--r--pyload/plugin/internal/SimpleHoster.py10
-rw-r--r--pyload/plugin/internal/XFSHoster.py2
-rw-r--r--pyload/plugin/ocr/NetloadIn.py2
44 files changed, 203 insertions, 167 deletions
diff --git a/pyload/plugin/Container.py b/pyload/plugin/Container.py
index 87d75976f..e8e42bb2b 100644
--- a/pyload/plugin/Container.py
+++ b/pyload/plugin/Container.py
@@ -45,7 +45,7 @@ class Container(Crypter):
if self.pyfile.url.startswith("http"):
self.pyfile.name = re.findall("([^\/=]+)", self.pyfile.url)[-1]
content = self.load(self.pyfile.url)
- self.pyfile.url = fs_join(self.core.config['general']['download_folder'], self.pyfile.name)
+ self.pyfile.url = fs_join(self.core.config.get("general", "download_folder"), self.pyfile.name)
try:
with open(self.pyfile.url, "wb") as f:
f.write(content)
diff --git a/pyload/plugin/Crypter.py b/pyload/plugin/Crypter.py
index aa9966ab4..3c1413f09 100644
--- a/pyload/plugin/Crypter.py
+++ b/pyload/plugin/Crypter.py
@@ -12,7 +12,7 @@ class Crypter(Plugin):
__version = "0.05"
__pattern = r'^unmatchable$'
- __config = [("use_subfolder", "bool", "Save package to subfolder", True), #: Overrides core.config['general']['folder_per_package']
+ __config = [("use_subfolder", "bool", "Save package to subfolder", True), #: Overrides core.config.get("general", "folder_per_package")
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
__description = """Base decrypter plugin"""
@@ -42,7 +42,7 @@ class Crypter(Plugin):
self.generatePackages()
elif not self.packages:
- self.error(_("No link extracted"), "decrypt")
+ self.error(_("No link grabbed"), "decrypt")
self.createPackages()
@@ -65,7 +65,7 @@ class Crypter(Plugin):
package_password = self.pyfile.package().password
package_queue = self.pyfile.package().queue
- folder_per_package = self.core.config['general']['folder_per_package']
+ folder_per_package = self.core.config.get("general", "folder_per_package")
try:
use_subfolder = self.getConfig('use_subfolder')
except Exception:
diff --git a/pyload/plugin/Plugin.py b/pyload/plugin/Plugin.py
index 3ccf94f34..c18e16643 100644
--- a/pyload/plugin/Plugin.py
+++ b/pyload/plugin/Plugin.py
@@ -252,8 +252,8 @@ class Plugin(Base):
def getChunkCount(self):
if self.chunkLimit <= 0:
- return self.core.config['download']['chunks']
- return min(self.core.config['download']['chunks'], self.chunkLimit)
+ return self.core.config.get("download", "chunks")
+ return min(self.core.config.get("download", "chunks"), self.chunkLimit)
def __call__(self):
@@ -616,17 +616,17 @@ class Plugin(Base):
if disposition:
self.pyfile.name = urlparse.urlparse(url).path.split('/')[-1] or self.pyfile.name
- download_folder = self.core.config['general']['download_folder']
+ download_folder = self.core.config.get("general", "download_folder")
location = fs_join(download_folder, self.pyfile.package().folder)
if not exists(location):
try:
- makedirs(location, int(self.core.config['permission']['folder'], 8))
+ makedirs(location, int(self.core.config.get("permission", "folder"), 8))
- if self.core.config['permission']['change_dl'] and os.name != "nt":
- uid = getpwnam(self.core.config['permission']['user'])[2]
- gid = getgrnam(self.core.config['permission']['group'])[2]
+ if self.core.config.get("permission", "change_dl") and os.name != "nt":
+ uid = getpwnam(self.core.config.get("permission", "user"))[2]
+ gid = getgrnam(self.core.config.get("permission", "group"))[2]
chown(location, uid, gid)
except Exception, e:
@@ -657,16 +657,16 @@ class Plugin(Base):
fs_filename = fs_encode(filename)
- if self.core.config['permission']['change_file']:
+ if self.core.config.get("permission", "change_file"):
try:
- chmod(fs_filename, int(self.core.config['permission']['file'], 8))
+ chmod(fs_filename, int(self.core.config.get("permission", "file"), 8))
except Exception, e:
self.logWarning(_("Setting file mode failed"), e)
- if self.core.config['permission']['change_dl'] and os.name != "nt":
+ if self.core.config.get("permission", "change_dl") and os.name != "nt":
try:
- uid = getpwnam(self.core.config['permission']['user'])[2]
- gid = getgrnam(self.core.config['permission']['group'])[2]
+ uid = getpwnam(self.core.config.get("permission", "user"))[2]
+ gid = getgrnam(self.core.config.get("permission", "group"))[2]
chown(fs_filename, uid, gid)
except Exception, e:
@@ -740,10 +740,10 @@ class Plugin(Base):
elif pyfile.status in (5, 7) and starting: # a download is waiting/starting and was appenrently started before
raise SkipDownload(pyfile.pluginname)
- download_folder = self.core.config['general']['download_folder']
+ download_folder = self.core.config.get("general", "download_folder")
location = fs_join(download_folder, pack.folder, self.pyfile.name)
- if starting and self.core.config['download']['skip_existing'] and exists(location):
+ if starting and self.core.config.get("download", "skip_existing") and exists(location):
size = os.stat(location).st_size
if size >= self.pyfile.size:
raise SkipDownload("File exists")
diff --git a/pyload/plugin/account/FastixRu.py b/pyload/plugin/account/FastixRu.py
index fbb635437..ead4e63aa 100644
--- a/pyload/plugin/account/FastixRu.py
+++ b/pyload/plugin/account/FastixRu.py
@@ -18,13 +18,14 @@ class FastixRu(Account):
data = self.getAccountData(user)
html = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"}))
- points = html['points']
- kb = float(points) * 1024 ** 2 / 1000
+ points = html['points']
+ trafficleft = float(points) * 1024 ** 2 / 1000
if points > 0:
- account_info = {"validuntil": -1, "trafficleft": kb}
+ account_info = {"validuntil": -1, "trafficleft": trafficleft}
else:
account_info = {"validuntil": None, "trafficleft": None, "premium": False}
+
return account_info
diff --git a/pyload/plugin/account/NoPremiumPl.py b/pyload/plugin/account/NoPremiumPl.py
index ac0e64cd4..d825b38ed 100644
--- a/pyload/plugin/account/NoPremiumPl.py
+++ b/pyload/plugin/account/NoPremiumPl.py
@@ -46,7 +46,7 @@ class NoPremiumPl(Account):
if "expire" in result.keys() and result["expire"]:
premium = True
valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple())
- traffic_left = result["balance"] * 1024
+ traffic_left = result["balance"] * 2 ** 20
return ({
"validuntil": valid_untill,
diff --git a/pyload/plugin/account/OboomCom.py b/pyload/plugin/account/OboomCom.py
index 17d81428c..68e083d75 100644
--- a/pyload/plugin/account/OboomCom.py
+++ b/pyload/plugin/account/OboomCom.py
@@ -64,8 +64,8 @@ class OboomCom(Account):
traffic = userData['traffic']
- trafficLeft = traffic['current'] / 1024 #@TODO: Remove `/ 1024` in 0.4.10
- maxTraffic = traffic['max'] / 1024 #@TODO: Remove `/ 1024` in 0.4.10
+ trafficLeft = traffic['current']
+ maxTraffic = traffic['max']
session = accountData['session']
diff --git a/pyload/plugin/account/PremiumTo.py b/pyload/plugin/account/PremiumTo.py
index fcd856ea7..586ddf635 100644
--- a/pyload/plugin/account/PremiumTo.py
+++ b/pyload/plugin/account/PremiumTo.py
@@ -20,7 +20,7 @@ class PremiumTo(Account):
get={'username': self.username, 'password': self.password})
if "wrong username" not in traffic:
- trafficleft = sum(map(float, traffic.split(';'))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
+ trafficleft = sum(map(float, traffic.split(';')))
return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1}
else:
return {'premium': False, 'trafficleft': None, 'validuntil': None}
diff --git a/pyload/plugin/account/PremiumizeMe.py b/pyload/plugin/account/PremiumizeMe.py
index 7a701d03b..06e6ffb98 100644
--- a/pyload/plugin/account/PremiumizeMe.py
+++ b/pyload/plugin/account/PremiumizeMe.py
@@ -22,7 +22,7 @@ class PremiumizeMe(Account):
# Parse account info
account_info = {"validuntil": float(status['result']['expires']),
- "trafficleft": max(0, status['result']['trafficleft_bytes'] / 1024)} #@TODO: Remove `/ 1024` in 0.4.10
+ "trafficleft": max(0, status['result']['trafficleft_bytes'])}
if status['result']['type'] == 'free':
account_info['premium'] = False
diff --git a/pyload/plugin/account/RapidgatorNet.py b/pyload/plugin/account/RapidgatorNet.py
index 17b615a0b..729635037 100644
--- a/pyload/plugin/account/RapidgatorNet.py
+++ b/pyload/plugin/account/RapidgatorNet.py
@@ -38,7 +38,7 @@ class RapidgatorNet(Account):
self.scheduleRefresh(user, json['response']['reset_in'])
validuntil = json['response']['expire_date']
- trafficleft = float(json['response']['traffic_left']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
+ trafficleft = float(json['response']['traffic_left'])
premium = True
else:
self.logError(json['response_details'])
diff --git a/pyload/plugin/account/ShareonlineBiz.py b/pyload/plugin/account/ShareonlineBiz.py
index a27d52736..06b2818c9 100644
--- a/pyload/plugin/account/ShareonlineBiz.py
+++ b/pyload/plugin/account/ShareonlineBiz.py
@@ -27,7 +27,7 @@ class ShareonlineBiz(Account):
premium = False
validuntil = None
trafficleft = -1
- maxtraffic = 100 * 1024 * 1024 * 1024 #: 100 GB
+ maxtraffic = 100 * 2 ** 30 #: 100 GB
api = {}
for line in self.api_response(user, req).splitlines():
@@ -48,9 +48,6 @@ class ShareonlineBiz(Account):
maxtraffic = max(maxtraffic, traffic)
trafficleft = maxtraffic - traffic
- maxtraffic /= 1024 #@TODO: Remove `/ 1024` in 0.4.10
- trafficleft /= 1024 #@TODO: Remove `/ 1024` in 0.4.10
-
return {'premium' : premium,
'validuntil' : validuntil,
'trafficleft': trafficleft,
diff --git a/pyload/plugin/account/SimplyPremiumCom.py b/pyload/plugin/account/SimplyPremiumCom.py
index 92e4edbb9..2547dad56 100644
--- a/pyload/plugin/account/SimplyPremiumCom.py
+++ b/pyload/plugin/account/SimplyPremiumCom.py
@@ -32,7 +32,7 @@ class SimplyPremiumCom(Account):
validuntil = float(json_data['result']['timeend'])
if 'remain_traffic' in json_data['result'] and json_data['result']['remain_traffic']:
- trafficleft = float(json_data['result']['remain_traffic']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
+ trafficleft = float(json_data['result']['remain_traffic'])
return {"premium": premium, "validuntil": validuntil, "trafficleft": trafficleft}
diff --git a/pyload/plugin/account/UnrestrictLi.py b/pyload/plugin/account/UnrestrictLi.py
index 8d3071580..d57b998ca 100644
--- a/pyload/plugin/account/UnrestrictLi.py
+++ b/pyload/plugin/account/UnrestrictLi.py
@@ -23,7 +23,7 @@ class UnrestrictLi(Account):
return {"premium": False}
validuntil = json_data['result']['expires']
- trafficleft = float(json_data['result']['traffic'] / 1024) #@TODO: Remove `/ 1024` in 0.4.10
+ trafficleft = float(json_data['result']['traffic'])
return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft}
diff --git a/pyload/plugin/account/UploadedTo.py b/pyload/plugin/account/UploadedTo.py
index 13b0f3112..61765faf8 100644
--- a/pyload/plugin/account/UploadedTo.py
+++ b/pyload/plugin/account/UploadedTo.py
@@ -49,11 +49,7 @@ class UploadedTo(Account):
size = traffic['S'].replace('.', '')
unit = traffic['U'].lower()
- if unit.startswith('t'): #@NOTE: Remove in 0.4.10
- trafficleft = float(size.replace(',', '.')) / 1024
- trafficleft *= 1 << 40
- else:
- trafficleft = self.parseTraffic(size + unit)
+ trafficleft = self.parseTraffic(size + unit)
return {'validuntil' : validuntil,
'trafficleft': trafficleft,
diff --git a/pyload/plugin/account/ZeveraCom.py b/pyload/plugin/account/ZeveraCom.py
index 9be032ca1..25c2c5512 100644
--- a/pyload/plugin/account/ZeveraCom.py
+++ b/pyload/plugin/account/ZeveraCom.py
@@ -41,7 +41,7 @@ class ZeveraCom(Account):
if "No trafic" not in api and api['endsubscriptiondate'] != "Expired!":
validuntil = time.mktime(time.strptime(api['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S"))
- trafficleft = float(api['availabletodaytraffic']) * 1024 if api['orondaytrafficlimit'] != '0' else -1
+ trafficleft = float(api['availabletodaytraffic']) * 2 ** 20 if api['orondaytrafficlimit'] != '0' else -1
premium = True
return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}
diff --git a/pyload/plugin/addon/AntiVirus.py b/pyload/plugin/addon/AntiVirus.py
index 3866014ee..87780e337 100644
--- a/pyload/plugin/addon/AntiVirus.py
+++ b/pyload/plugin/addon/AntiVirus.py
@@ -28,8 +28,6 @@ class AntiVirus(Addon):
def setup(self):
- self.info = {} #@TODO: Remove in 0.4.10
-
try:
import send2trash
diff --git a/pyload/plugin/addon/Checksum.py b/pyload/plugin/addon/Checksum.py
index 53b9b4e9f..ed50b0f5e 100644
--- a/pyload/plugin/addon/Checksum.py
+++ b/pyload/plugin/addon/Checksum.py
@@ -105,7 +105,7 @@ class Checksum(Addon):
self.checkFailed(pyfile, None, "No file downloaded")
local_file = fs_encode(pyfile.plugin.lastDownload)
- #download_folder = self.config['general']['download_folder']
+ #download_folder = self.config.get("general", "download_folder")
#local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name))
if not isfile(local_file):
@@ -166,7 +166,7 @@ class Checksum(Addon):
def packageFinished(self, pypack):
- download_folder = fs_join(self.config['general']['download_folder'], pypack.folder, "")
+ download_folder = fs_join(self.config.get("general", "download_folder"), pypack.folder, "")
for link in pypack.getChildren().itervalues():
file_type = splitext(link['name'])[1][1:].lower()
diff --git a/pyload/plugin/addon/ClickNLoad.py b/pyload/plugin/addon/ClickNLoad.py
index b6448598a..4e1be807d 100644
--- a/pyload/plugin/addon/ClickNLoad.py
+++ b/pyload/plugin/addon/ClickNLoad.py
@@ -37,11 +37,11 @@ class ClickNLoad(Addon):
def activate(self):
- if not self.core.config['webui']['activated']:
+ if not self.core.config.get("webui", "activated"):
return
ip = "" if self.getConfig('extern') else "127.0.0.1"
- webport = self.core.config['webui']['port']
+ webport = self.core.config.get("webui", "port")
cnlport = self.getConfig('port')
self.proxy(ip, webport, cnlport)
diff --git a/pyload/plugin/addon/ExternalScripts.py b/pyload/plugin/addon/ExternalScripts.py
index 75c9ae810..341dd6dcd 100644
--- a/pyload/plugin/addon/ExternalScripts.py
+++ b/pyload/plugin/addon/ExternalScripts.py
@@ -30,7 +30,7 @@ class ExternalScripts(Addon):
def setup(self):
- self.info = {'oldip': None}
+ self.info['oldip'] = None
self.scripts = {}
folders = ["pyload_start", "pyload_restart", "pyload_stop",
@@ -38,7 +38,7 @@ class ExternalScripts(Addon):
"download_preparing", "download_failed", "download_finished",
"archive_extract_failed", "archive_extracted",
"package_finished", "package_deleted", "package_extract_failed", "package_extracted",
- "all_downloads_processed", "all_downloads_finished", # @TODO: Invert `all_downloads_processed`, `all_downloads_finished` order in 0.4.10
+ "all_downloads_processed", "all_downloads_finished", #@TODO: Invert `all_downloads_processed`, `all_downloads_finished` order in 0.4.10
"all_archives_extracted", "all_archives_processed"]
for folder in folders:
@@ -84,7 +84,7 @@ class ExternalScripts(Addon):
self.logDebug("Executing: %s" % os.path.abspath(script), "Args: " + ' '.join(cmd_args))
- p = subprocess.Popen(cmd, bufsize=-1) # @NOTE: output goes to pyload
+ p = subprocess.Popen(cmd, bufsize=-1) #@NOTE: output goes to pyload
if self.getConfig('waitend'):
p.communicate()
@@ -113,7 +113,7 @@ class ExternalScripts(Addon):
def afterReconnecting(self, ip):
for script in self.scripts['after_reconnect']:
- self.callScript(script, ip, self.info['oldip']) # @TODO: Use built-in oldip in 0.4.10
+ self.callScript(script, ip, self.info['oldip']) #@TODO: Use built-in oldip in 0.4.10
def downloadPreparing(self, pyfile):
@@ -122,10 +122,10 @@ class ExternalScripts(Addon):
def downloadFailed(self, pyfile):
- if self.core.config['general']['folder_per_package']:
- download_folder = fs_join(self.core.config['general']['download_folder'], pyfile.package().folder)
+ if self.core.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.core.config.get("general", "download_folder"), pyfile.package().folder)
else:
- download_folder = self.core.config['general']['download_folder']
+ download_folder = self.core.config.get("general", "download_folder")
for script in self.scripts['download_failed']:
file = fs_join(download_folder, pyfile.name)
@@ -133,10 +133,10 @@ class ExternalScripts(Addon):
def downloadFinished(self, pyfile):
- if self.core.config['general']['folder_per_package']:
- download_folder = fs_join(self.core.config['general']['download_folder'], pyfile.package().folder)
+ if self.core.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.core.config.get("general", "download_folder"), pyfile.package().folder)
else:
- download_folder = self.core.config['general']['download_folder']
+ download_folder = self.core.config.get("general", "download_folder")
for script in self.scripts['download_finished']:
file = fs_join(download_folder, pyfile.name)
@@ -154,10 +154,10 @@ class ExternalScripts(Addon):
def packageFinished(self, pypack):
- if self.core.config['general']['folder_per_package']:
- download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder)
+ if self.core.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder)
else:
- download_folder = self.core.config['general']['download_folder']
+ download_folder = self.core.config.get("general", "download_folder")
for script in self.scripts['package_finished']:
self.callScript(script, pypack.id, pypack.name, download_folder, pypack.password)
@@ -166,30 +166,30 @@ class ExternalScripts(Addon):
def packageDeleted(self, pid):
pack = self.core.api.getPackageInfo(pid)
- if self.core.config['general']['folder_per_package']:
- download_folder = fs_join(self.core.config['general']['download_folder'], pack.folder)
+ if self.core.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.core.config.get("general", "download_folder"), pack.folder)
else:
- download_folder = self.core.config['general']['download_folder']
+ download_folder = self.core.config.get("general", "download_folder")
for script in self.scripts['package_deleted']:
self.callScript(script, pack.id, pack.name, download_folder, pack.password)
def package_extract_failed(self, pypack):
- if self.core.config['general']['folder_per_package']:
- download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder)
+ if self.core.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder)
else:
- download_folder = self.core.config['general']['download_folder']
+ download_folder = self.core.config.get("general", "download_folder")
for script in self.scripts['package_extract_failed']:
self.callScript(script, pypack.id, pypack.name, download_folder, pypack.password)
def package_extracted(self, pypack):
- if self.core.config['general']['folder_per_package']:
- download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder)
+ if self.core.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder)
else:
- download_folder = self.core.config['general']['download_folder']
+ download_folder = self.core.config.get("general", "download_folder")
for script in self.scripts['package_extracted']:
self.callScript(script, pypack.id, pypack.name, download_folder)
diff --git a/pyload/plugin/addon/ExtractArchive.py b/pyload/plugin/addon/ExtractArchive.py
index bc1b06306..a106d22ab 100644
--- a/pyload/plugin/addon/ExtractArchive.py
+++ b/pyload/plugin/addon/ExtractArchive.py
@@ -198,11 +198,11 @@ class ExtractArchive(Addon):
while packages:
if self.lastPackage: #: called from allDownloadsProcessed
self.lastPackage = False
- if self.extract(packages, thread): # @NOTE: check only if all gone fine, no failed reporting for now
+ if self.extract(packages, thread): #@NOTE: check only if all gone fine, no failed reporting for now
self.manager.dispatchEvent("all_archives_extracted")
self.manager.dispatchEvent("all_archives_processed")
else:
- if self.extract(packages, thread): # @NOTE: check only if all gone fine, no failed reporting for now
+ if self.extract(packages, thread): #@NOTE: check only if all gone fine, no failed reporting for now
pass
packages = self.queue.get() #: check for packages added during extraction
@@ -234,7 +234,7 @@ class ExtractArchive(Addon):
@Expose
- def extract(self, ids, thread=None): # @TODO: Use pypack, not pid to improve method usability
+ def extract(self, ids, thread=None): #@TODO: Use pypack, not pid to improve method usability
if not ids:
return False
@@ -264,7 +264,7 @@ class ExtractArchive(Addon):
# reload from txt file
self.reloadPasswords()
- download_folder = self.config['general']['download_folder']
+ download_folder = self.config.get("general", "download_folder")
# iterate packages -> extractors -> targets
for pid in ids:
@@ -551,16 +551,16 @@ class ExtractArchive(Addon):
continue
try:
- if self.config['permission']['change_file']:
+ if self.config.get("permission", "change_file"):
if os.path.isfile(f):
- os.chmod(f, int(self.config['permission']['file'], 8))
+ os.chmod(f, int(self.config.get("permission", "file"), 8))
elif os.path.isdir(f):
- os.chmod(f, int(self.config['permission']['folder'], 8))
+ os.chmod(f, int(self.config.get("permission", "folder"), 8))
- if self.config['permission']['change_dl'] and os.name != "nt":
- uid = getpwnam(self.config['permission']['user'])[2]
- gid = getgrnam(self.config['permission']['group'])[2]
+ if self.config.get("permission", "change_dl") and os.name != "nt":
+ uid = getpwnam(self.config.get("permission", "user"))[2]
+ gid = getgrnam(self.config.get("permission", "group"))[2]
os.chown(f, uid, gid)
except Exception, e:
diff --git a/pyload/plugin/addon/MergeFiles.py b/pyload/plugin/addon/MergeFiles.py
index dfc5f41d4..4f95ef9d7 100644
--- a/pyload/plugin/addon/MergeFiles.py
+++ b/pyload/plugin/addon/MergeFiles.py
@@ -37,9 +37,9 @@ class MergeFiles(Addon):
files[data['name'][:-4]].sort()
fid_dict[data['name']] = fid
- download_folder = self.config['general']['download_folder']
+ download_folder = self.config.get("general", "download_folder")
- if self.config['general']['folder_per_package']:
+ if self.config.get("general", "folder_per_package"):
download_folder = fs_join(download_folder, pack.folder)
for name, file_list in files.iteritems():
diff --git a/pyload/plugin/addon/MultiHome.py b/pyload/plugin/addon/MultiHome.py
index 057764a1e..bca6493db 100644
--- a/pyload/plugin/addon/MultiHome.py
+++ b/pyload/plugin/addon/MultiHome.py
@@ -24,7 +24,7 @@ class MultiHome(Addon):
self.parseInterfaces(self.getConfig('interfaces').split(";"))
if not self.interfaces:
- self.parseInterfaces([self.config['download']['interface']])
+ self.parseInterfaces([self.config.get("download", "interface")])
self.setConfig("interfaces", self.toConfig())
diff --git a/pyload/plugin/addon/UpdateManager.py b/pyload/plugin/addon/UpdateManager.py
index 60fc71d0a..cf8349e79 100644
--- a/pyload/plugin/addon/UpdateManager.py
+++ b/pyload/plugin/addon/UpdateManager.py
@@ -30,7 +30,7 @@ def exists(path):
class UpdateManager(Addon):
__name = "UpdateManager"
__type = "addon"
- __version = "0.50"
+ __version = "0.51"
__config = [("activated", "bool", "Activated", False),
("checkinterval", "int", "Check interval in hours", 8),
@@ -50,6 +50,8 @@ class UpdateManager(Addon):
SERVER_URL = "http://updatemanager.pyload.org" if release_status == 5 else None
MIN_CHECK_INTERVAL = 3 * 60 * 60 #: 3 hours
+ event_list = ["allDownloadsProcessed"]
+
def activate(self):
if self.checkonstart:
@@ -69,6 +71,14 @@ class UpdateManager(Addon):
else:
self.checkonstart = False
+ self.do_restart = False
+
+
+ def allDownloadsProcessed(self):
+ if self.do_restart is True:
+ self.logWarning(_("Downloads are done, restarting pyLoad to reload the updated plugins"))
+ self.core.api.restart()
+
def periodical(self):
if self.core.debug:
@@ -129,7 +139,11 @@ class UpdateManager(Addon):
self.core.api.pauseServer()
if self._update() is 2 and self.getConfig('autorestart'):
- self.core.api.restart()
+ if not self.core.api.statusDownloads():
+ self.core.api.restart()
+ else:
+ self.do_restart = True
+ self.logWarning(_("Downloads are active, will restart once the download is done"))
else:
self.core.api.unpauseServer()
@@ -208,7 +222,7 @@ class UpdateManager(Addon):
for plugin in sorted(updatelist, key=itemgetter("type", "name")):
filename = plugin['name']
- prefix = plugin['type']
+ type = plugin['type']
version = plugin['version']
if filename.endswith(".pyc"):
@@ -216,12 +230,6 @@ class UpdateManager(Addon):
else:
name = filename.replace(".py", "")
- #@TODO: Remove in 0.4.10
- if prefix.endswith("s"):
- type = prefix[:-1]
- else:
- type = prefix
-
plugins = getattr(self.core.pluginManager, "%sPlugins" % type)
oldver = float(plugins[name]['version']) if name in plugins else None
@@ -259,7 +267,7 @@ class UpdateManager(Addon):
if self.core.pluginManager.reloadPlugins(updated):
exitcode = 1
else:
- self.logWarning(_("Restart pyLoad to reload the updated plugins"))
+ self.logWarning(_("pyLoad restart required to reload the updated plugins"))
self.info['plugins'] = True
exitcode = 2
diff --git a/pyload/plugin/addon/UserAgentSwitcher.py b/pyload/plugin/addon/UserAgentSwitcher.py
index ec1640e63..31a2b763b 100644
--- a/pyload/plugin/addon/UserAgentSwitcher.py
+++ b/pyload/plugin/addon/UserAgentSwitcher.py
@@ -25,10 +25,6 @@ class UserAgentSwitcher(Addon):
__authors = [("Walter Purcaro", "vuolter@gmail.com")]
- def setup(self):
- self.info = {} #@TODO: Remove in 0.4.10
-
-
def downloadPreparing(self, pyfile):
uar = self.getConfig('uar')
uaf = fs_encode(self.getConfig('uaf'))
diff --git a/pyload/plugin/container/CCF.py b/pyload/plugin/container/CCF.py
index 12031989e..ef105d8a8 100644
--- a/pyload/plugin/container/CCF.py
+++ b/pyload/plugin/container/CCF.py
@@ -33,7 +33,7 @@ class CCF(Container):
'filename': "test.ccf",
'upload' : open(fs_filename, "rb")}).read()
- download_folder = self.config['general']['download_folder']
+ download_folder = self.config.get("general", "download_folder")
dlc_file = fs_join(download_folder, "tmp_%s.dlc" % pyfile.name)
try:
diff --git a/pyload/plugin/crypter/DailymotionComFolder.py b/pyload/plugin/crypter/DailymotionComFolder.py
index 2fdb1ec8e..fe173fe82 100644
--- a/pyload/plugin/crypter/DailymotionComFolder.py
+++ b/pyload/plugin/crypter/DailymotionComFolder.py
@@ -101,6 +101,6 @@ class DailymotionComFolder(Crypter):
for p_id, p_name, p_owner in playlists:
p_videos = self.getVideos(p_id)
- p_folder = fs_join(self.config['general']['download_folder'], p_owner, p_name)
+ p_folder = fs_join(self.config.get("general", "download_folder"), p_owner, p_name)
self.logDebug("%s video\s found on playlist \"%s\"" % (len(p_videos), p_name))
self.packages.append((p_name, p_videos, p_folder)) #: folder is NOT recognized by pyload 0.4.9!
diff --git a/pyload/plugin/crypter/MegaCoNz.py b/pyload/plugin/crypter/MegaCoNz.py
index 2ab7ec55c..c66b3f112 100644
--- a/pyload/plugin/crypter/MegaCoNz.py
+++ b/pyload/plugin/crypter/MegaCoNz.py
@@ -27,6 +27,3 @@ class MegaCoNz(Crypter):
url = "https://mega.co.nz/#F!%s!%s" % re.match(self.__pattern, pyfile.url).groups()
self.html = self.load("http://rapidgen.org/linkfinder", post={'linklisturl': url})
self.urls = re.findall(r'(https://mega.co.nz/#N!.+?)<', self.html)
-
- if not self.urls: #@TODO: Remove in 0.4.10
- self.fail(_("No link grabbed"))
diff --git a/pyload/plugin/crypter/RelinkUs.py b/pyload/plugin/crypter/RelinkUs.py
index e7fb7ed06..6296e9f40 100644
--- a/pyload/plugin/crypter/RelinkUs.py
+++ b/pyload/plugin/crypter/RelinkUs.py
@@ -219,7 +219,7 @@ class RelinkUs(Crypter):
try:
dlc = self.load(container_url)
dlc_filename = self.fileid + ".dlc"
- dlc_filepath = fs_join(self.config['general']['download_folder'], dlc_filename)
+ dlc_filepath = fs_join(self.config.get("general", "download_folder"), dlc_filename)
with open(dlc_filepath, "wb") as f:
f.write(dlc)
package_links.append(dlc_filepath)
diff --git a/pyload/plugin/crypter/YoutubeComFolder.py b/pyload/plugin/crypter/YoutubeComFolder.py
index da76e556b..84277207a 100644
--- a/pyload/plugin/crypter/YoutubeComFolder.py
+++ b/pyload/plugin/crypter/YoutubeComFolder.py
@@ -132,7 +132,7 @@ class YoutubeComFolder(Crypter):
for p in playlists:
p_name = p['title']
p_videos = self.getVideosId(p['id'])
- p_folder = fs_join(self.config['general']['download_folder'], p['channelTitle'], p_name)
+ p_folder = fs_join(self.config.get("general", "download_folder"), p['channelTitle'], p_name)
self.logDebug("%s video\s found on playlist \"%s\"" % (len(p_videos), p_name))
if not p_videos:
diff --git a/pyload/plugin/hoster/FilerNet.py b/pyload/plugin/hoster/FilerNet.py
index f9b38e8cb..86a5809da 100644
--- a/pyload/plugin/hoster/FilerNet.py
+++ b/pyload/plugin/hoster/FilerNet.py
@@ -48,13 +48,9 @@ class FilerNet(SimpleHoster):
recaptcha = ReCaptcha(self)
response, challenge = recaptcha.challenge()
- #@NOTE: Work-around for v0.4.9 just_header issue
- #@TODO: Check for v0.4.10
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
self.load(pyfile.url, post={'recaptcha_challenge_field': challenge,
'recaptcha_response_field': response,
- 'hash': inputs['hash']})
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
+ 'hash': inputs['hash']}, follow_location=False)
if 'location' in self.req.http.header.lower():
self.link = re.search(r'location: (\S+)', self.req.http.header, re.I).group(1)
diff --git a/pyload/plugin/hoster/FreakshareCom.py b/pyload/plugin/hoster/FreakshareCom.py
index c5315cdc8..64d8f8308 100644
--- a/pyload/plugin/hoster/FreakshareCom.py
+++ b/pyload/plugin/hoster/FreakshareCom.py
@@ -130,7 +130,7 @@ class FreakshareCom(Hoster):
if m:
units = float(m.group(1).replace(",", ""))
pow = {'KB': 1, 'MB': 2, 'GB': 3}[m.group(2)]
- size = int(units * 1024 ** pow)
+ size = int(units * (2 ** 20) ** pow)
return size
diff --git a/pyload/plugin/hoster/GigapetaCom.py b/pyload/plugin/hoster/GigapetaCom.py
index adbdc2396..c524a0a7c 100644
--- a/pyload/plugin/hoster/GigapetaCom.py
+++ b/pyload/plugin/hoster/GigapetaCom.py
@@ -43,7 +43,7 @@ class GigapetaCom(SimpleHoster):
m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I)
if m:
- self.link = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10
+ self.link = m.group(1)
break
elif "Entered figures don&#96;t coincide with the picture" in self.html:
self.invalidCaptcha()
diff --git a/pyload/plugin/hoster/HostujeNet.py b/pyload/plugin/hoster/HostujeNet.py
new file mode 100644
index 000000000..4dd5bb1c3
--- /dev/null
+++ b/pyload/plugin/hoster/HostujeNet.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from pyload.plugin.internal.SimpleHoster import SimpleHoster
+
+
+class HostujeNet(SimpleHoster):
+ __name__ = "HostujeNet"
+ __type__ = "hoster"
+ __version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?hostuje\.net/\w+'
+
+ __description__ = """Hostuje.net hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("GammaC0de", None)]
+
+
+ NAME_PATTERN = r'<input type="hidden" name="name" value="(?P<N>.+?)">'
+ SIZE_PATTERN = r'<b>Rozmiar:</b> (?P<S>[\d.,]+) (?P<U>[\w^_]+)<br>'
+ OFFLINE_PATTERN = ur'Podany plik nie został odnaleziony\.\.\.'
+
+
+ def setup(self):
+ self.multiDL = True
+ self.chunkLimit = 1
+
+
+ def handleFree(self, pyfile):
+ m = re.search(r'<script src="([\w^_]+.php)"></script>', self.html)
+ if m:
+ jscript = self.load("http://hostuje.net/" + m.group(1))
+ m = re.search(r"\('(\w+\.php\?i=\w+)'\);", jscript)
+ if m:
+ self.load("http://hostuje.net/" + m.group(1))
+ else:
+ self.error(_("unexpected javascript format"))
+ else:
+ self.error(_("script not found"))
+
+ action, inputs = self.parseHtmlForm(pyfile.url.replace(".", "\.").replace( "?", "\?"))
+ if not action:
+ self.error(_("form not found"))
+
+ self.download(action, post=inputs)
diff --git a/pyload/plugin/hoster/MegasharesCom.py b/pyload/plugin/hoster/MegasharesCom.py
index 184be2fd6..ac7a81313 100644
--- a/pyload/plugin/hoster/MegasharesCom.py
+++ b/pyload/plugin/hoster/MegasharesCom.py
@@ -89,7 +89,7 @@ class MegasharesCom(SimpleHoster):
self.fail(_("Passport not found"))
self.logInfo(_("Download passport: %s") % m.group(1))
- data_left = float(m.group(2)) * 1024 ** {'B': 0, 'KB': 1, 'MB': 2, 'GB': 3}[m.group(3)]
+ data_left = float(m.group(2)) * (2 ** 20) ** {'B': 0, 'KB': 1, 'MB': 2, 'GB': 3}[m.group(3)]
self.logInfo(_("Data left: %s %s (%d MB needed)") % (m.group(2), m.group(3), self.pyfile.size / 1048576))
if not data_left:
diff --git a/pyload/plugin/hoster/QuickshareCz.py b/pyload/plugin/hoster/QuickshareCz.py
index 6d6f21c71..3dd11f04a 100644
--- a/pyload/plugin/hoster/QuickshareCz.py
+++ b/pyload/plugin/hoster/QuickshareCz.py
@@ -65,7 +65,7 @@ class QuickshareCz(SimpleHoster):
if m is None:
self.fail(_("File not found"))
- self.link = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10
+ self.link = m.group(1)
self.logDebug("FREE URL2:" + self.link)
# check errors
diff --git a/pyload/plugin/hoster/UploadedTo.py b/pyload/plugin/hoster/UploadedTo.py
index 7031d0ab2..487c01576 100644
--- a/pyload/plugin/hoster/UploadedTo.py
+++ b/pyload/plugin/hoster/UploadedTo.py
@@ -11,7 +11,7 @@ from pyload.plugin.internal.SimpleHoster import SimpleHoster
class UploadedTo(SimpleHoster):
__name = "UploadedTo"
__type = "hoster"
- __version = "0.85"
+ __version = "0.86"
__pattern = r'https?://(?:www\.)?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=|/)(?P<ID>\w+)'
__config = [("use_premium", "bool", "Use premium account if available", True)]
@@ -21,6 +21,8 @@ class UploadedTo(SimpleHoster):
__authors = [("Walter Purcaro", "vuolter@gmail.com")]
+ DISPOSITION = False
+
API_KEY = "lhF2IeeprweDfu9ccWlxXVVypA5nA3EL"
URL_REPLACEMENTS = [(__pattern + ".*", r'http://uploaded.net/file/\g<ID>')]
diff --git a/pyload/plugin/hoster/XdadevelopersCom.py b/pyload/plugin/hoster/XdadevelopersCom.py
index 488d29c44..0fe9197aa 100644
--- a/pyload/plugin/hoster/XdadevelopersCom.py
+++ b/pyload/plugin/hoster/XdadevelopersCom.py
@@ -33,4 +33,5 @@ class XdadevelopersCom(SimpleHoster):
def handleFree(self, pyfile):
- self.link = pyfile.url + "&task=get" #@TODO: Revert to `get={'task': "get"}` in 0.4.10
+ self.download(pyfile.url,
+ get={'task': "get"})
diff --git a/pyload/plugin/hoster/Xdcc.py b/pyload/plugin/hoster/Xdcc.py
index 587c73157..f2b5d0b8f 100644
--- a/pyload/plugin/hoster/Xdcc.py
+++ b/pyload/plugin/hoster/Xdcc.py
@@ -191,7 +191,7 @@ class Xdcc(Hoster):
self.pyfile.name = packname
- download_folder = self.config['general']['download_folder']
+ download_folder = self.config.get("general", "download_folder")
filename = fs_join(download_folder, packname)
self.logInfo(_("Downloading %s from %s:%d") % (packname, ip, port))
diff --git a/pyload/plugin/hoster/YadiSk.py b/pyload/plugin/hoster/YadiSk.py
index 528d6bc80..f68039e2e 100644
--- a/pyload/plugin/hoster/YadiSk.py
+++ b/pyload/plugin/hoster/YadiSk.py
@@ -10,7 +10,7 @@ from pyload.utils import json_loads
class YadiSk(SimpleHoster):
__name = "YadiSk"
__type = "hoster"
- __version = "0.03"
+ __version = "0.04"
__pattern = r'https?://yadi\.sk/d/\w+'
@@ -22,6 +22,42 @@ class YadiSk(SimpleHoster):
OFFLINE_PATTERN = r'Nothing found'
+ @classmethod
+ def getInfo(cls, url="", html=""):
+ info = super(YadiSk, cls).getInfo(url, html)
+
+ if html:
+ if 'idclient' not in info:
+ info['idclient'] = ""
+ for _i in xrange(32):
+ info ['idclient'] += random.choice('0123456abcdef')
+
+ m = re.search(r'<script id="models-client" type="application/json">(.+?)</script>', html)
+ if m:
+ api_data = json_loads(m.group(1))
+ try:
+ for sect in api_data:
+ if 'model' in sect:
+ if sect['model'] == "config":
+ info['version'] = sect['data']['version']
+ info['sk'] = sect['data']['sk']
+
+ elif sect['model'] == "resource":
+ info['id'] = sect['data']['id']
+ info['size'] = sect['data']['meta']['size']
+ info['name'] = sect['data']['name']
+
+ except Exception, e:
+ info['status'] = 8
+ info['error'] = _("Unexpected server response: %s") % e.message
+
+ else:
+ info['status'] = 8
+ info['error'] = _("could not find required json data")
+
+ return info
+
+
def setup(self):
self.resumeDownload = False
self.multiDL = False
@@ -29,51 +65,18 @@ class YadiSk(SimpleHoster):
def handleFree(self, pyfile):
- m = re.search(r'<script id="models-client" type="application/json">(.+?)</script>', self.html)
- if m is None:
- self.error(_("could not find required json data"))
-
- res = json_loads(m.group(1))
-
- yadisk_ver = None
- yadisk_sk = None
- yadisk_id = None
- yadisk_size = None
- yadisk_name = None
-
- try: #@TODO: Copy to apiInfo
- for sect in res:
- if 'model' in sect:
- if sect['model'] == "config":
- yadisk_ver = sect['data']['version']
- yadisk_sk = sect['data']['sk']
-
- elif sect['model'] == "resource":
- yadisk_id = sect['data']['id']
- yadisk_size = sect['data']['meta']['size']
- yadisk_name = sect['data']['name']
-
- except Exception, e:
- self.fail(_("Unexpected server response"), e)
-
- if None in (yadisk_id, yadisk_sk, yadisk_id, yadisk_size, yadisk_name):
+ if any(True for _k in ['id', 'sk', 'version', 'idclient'] if _k not in self.info):
self.error(_("Missing JSON data"))
- self.pyfile.size = yadisk_size
- self.pyfile.name = yadisk_name
-
- yadisk_idclient = ""
- for _i in range(32):
- yadisk_idclient += random.choice('0123456abcdef')
try:
self.html = self.load("https://yadi.sk/models/",
get={'_m': "do-get-resource-url"},
- post={'idClient': yadisk_idclient,
- 'version' : yadisk_ver,
+ post={'idClient': self.info['idclient'],
+ 'version' : self.info['version'],
'_model.0': "do-get-resource-url",
- 'sk' : yadisk_sk,
- 'id.0' : yadisk_id})
+ 'sk' : self.info['sk'],
+ 'id.0' : self.info['id']})
self.link = json_loads(self.html)['models'][0]['data']['file']
diff --git a/pyload/plugin/hoster/ZippyshareCom.py b/pyload/plugin/hoster/ZippyshareCom.py
index 91a636f0a..a062df458 100644
--- a/pyload/plugin/hoster/ZippyshareCom.py
+++ b/pyload/plugin/hoster/ZippyshareCom.py
@@ -67,13 +67,13 @@ class ZippyshareCom(SimpleHoster):
def replElementById(element):
- id = element.group(1) # id might be either 'x' (a real id) or x (a variable)
+ id = element.group(1) #: id might be either 'x' (a real id) or x (a variable)
attr = element.group(4) # attr might be None
varName = re.sub(r'-', '', 'GVAR[%s+"_%s"]' %(id, attr))
realid = id.strip('"\'')
- if id != realid: #id is not a variable, so look for realid.attr in the html
+ if id != realid: #: id is not a variable, so look for realid.attr in the html
initValues = filter(None, [elt.get(attr, None) for elt in soup.findAll(id=realid)])
initValue = '"%s"' % initValues[-1] if initValues else 'null'
initScripts.add('%s = %s;' % (varName, initValue))
diff --git a/pyload/plugin/internal/SimpleCrypter.py b/pyload/plugin/internal/SimpleCrypter.py
index f6c5aa5e2..c6582647f 100644
--- a/pyload/plugin/internal/SimpleCrypter.py
+++ b/pyload/plugin/internal/SimpleCrypter.py
@@ -15,7 +15,7 @@ class SimpleCrypter(Crypter, SimpleHoster):
__version = "0.43"
__pattern = r'^unmatchable$'
- __config = [("use_subfolder" , "bool", "Save package to subfolder" , True), #: Overrides core.config['general']['folder_per_package']
+ __config = [("use_subfolder" , "bool", "Save package to subfolder" , True), #: Overrides core.config.get("general", "folder_per_package")
("subfolder_per_pack", "bool", "Create a subfolder for each package", True)]
__description = """Simple decrypter plugin"""
diff --git a/pyload/plugin/internal/SimpleDereferer.py b/pyload/plugin/internal/SimpleDereferer.py
index f3596b32c..c82afe0b4 100644
--- a/pyload/plugin/internal/SimpleDereferer.py
+++ b/pyload/plugin/internal/SimpleDereferer.py
@@ -59,10 +59,7 @@ class SimpleDereferer(Crypter):
link = self.getLink()
if link.strip():
- self.urls = [link.strip()] #@TODO: Remove `.strip()` in 0.4.10
-
- elif not self.urls and not self.packages: #@TODO: Remove in 0.4.10
- self.fail(_("No link grabbed"))
+ self.urls = [link]
def prepare(self):
diff --git a/pyload/plugin/internal/SimpleHoster.py b/pyload/plugin/internal/SimpleHoster.py
index c0cdc05a8..add54786f 100644
--- a/pyload/plugin/internal/SimpleHoster.py
+++ b/pyload/plugin/internal/SimpleHoster.py
@@ -244,7 +244,7 @@ def secondsToMidnight(gmt=0):
class SimpleHoster(Hoster):
__name = "SimpleHoster"
__type = "hoster"
- __version = "1.37"
+ __version = "1.38"
__pattern = r'^unmatchable$'
__config = [("use_premium", "bool", "Use premium account if available", True)]
@@ -609,7 +609,7 @@ class SimpleHoster(Hoster):
self.tempOffline()
elif status is 8:
- self.fail()
+ self.fail(self.info['error'] if 'error' in self.info else "Failed")
finally:
self.logDebug("File status: %s" % statusMap[status])
@@ -728,8 +728,8 @@ class SimpleHoster(Hoster):
elif traffic == -1:
return True
else:
- size = self.pyfile.size / 1024
- self.logInfo(_("Filesize: %i KiB, Traffic left for user %s: %i KiB") % (size, self.user, traffic))
+ size = self.pyfile.size
+ self.logInfo(_("Filesize: %i KiB, Traffic left for user %s: %i KiB") % (size / 1024, self.user, traffic / 1024))
return size <= traffic
@@ -751,8 +751,6 @@ class SimpleHoster(Hoster):
self.retries = 0
raise Retry(_("Fallback to free download"))
- #@TODO: Remove in 0.4.10
-
def wait(self, seconds=0, reconnect=None):
return _wait(self, seconds, reconnect)
diff --git a/pyload/plugin/internal/XFSHoster.py b/pyload/plugin/internal/XFSHoster.py
index 92ec020a6..7b8149bc3 100644
--- a/pyload/plugin/internal/XFSHoster.py
+++ b/pyload/plugin/internal/XFSHoster.py
@@ -113,7 +113,7 @@ class XFSHoster(SimpleHoster):
self.logError(data['op'] if 'op' in data else _("UNKNOWN"))
return ""
- self.link = m.group(1).strip() #@TODO: Remove .strip() in 0.4.10
+ self.link = m.group(1)
def handlePremium(self, pyfile):
diff --git a/pyload/plugin/ocr/NetloadIn.py b/pyload/plugin/ocr/NetloadIn.py
index 9e31d18d5..57651428b 100644
--- a/pyload/plugin/ocr/NetloadIn.py
+++ b/pyload/plugin/ocr/NetloadIn.py
@@ -24,6 +24,6 @@ class NetloadIn(OCR):
self.clean(3)
self.run_tesser(True, True, False, False)
- self.result_captcha = self.result_captcha.replace(" ", "")[:4] # cut to 4 numbers
+ self.result_captcha = self.result_captcha.replace(" ", "")[:4] #: cut to 4 numbers
return self.result_captcha