From 2f763ffd0c6f87c25ba814db3ed12e3504531efd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Apr 2015 19:22:11 +0200 Subject: [SimpleDereferer][SimpleHoster] Update user-agent (3) --- module/plugins/internal/SimpleDereferer.py | 3 ++- module/plugins/internal/SimpleHoster.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/plugins/internal/SimpleDereferer.py b/module/plugins/internal/SimpleDereferer.py index bdb2d773c..99077bfc3 100644 --- a/module/plugins/internal/SimpleDereferer.py +++ b/module/plugins/internal/SimpleDereferer.py @@ -71,7 +71,8 @@ class SimpleDereferer(Crypter): self.html = "" self.req.setOption("timeout", 120) - self.req.http.c.setopt(pycurl.USERAGENT, "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0") #@NOTE: Work-around to old user-agent bug; remove in 0.4.10 + self.req.http.c.setopt(pycurl.USERAGENT, + "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0") #@NOTE: Work-around to old user-agent bug; remove in 0.4.10 if isinstance(self.COOKIES, list): set_cookies(self.req.cj, self.COOKIES) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 0474a5af5..87e136f08 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -434,7 +434,8 @@ class SimpleHoster(Hoster): self.fail(_("Required account not found")) self.req.setOption("timeout", 120) - self.req.http.c.setopt(pycurl.USERAGENT, "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0") #@NOTE: Work-around to old user-agent bug; remove in 0.4.10 + self.req.http.c.setopt(pycurl.USERAGENT, + "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0") #@NOTE: Work-around to old user-agent bug; remove in 0.4.10 if isinstance(self.COOKIES, list): set_cookies(self.req.cj, self.COOKIES) -- cgit v1.2.3 From e948054ea4eb6bbba8091482cca52fd2454322a5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Apr 2015 19:30:29 +0200 Subject: New plugin: UserAgentSwitcher Fix https://github.com/pyload/pyload/issues/1305 --- module/plugins/hooks/UserAgentSwitcher.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 module/plugins/hooks/UserAgentSwitcher.py diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py new file mode 100644 index 000000000..56c605bac --- /dev/null +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +import pycurl + +from module.plugins.Hook import Hook + + +class UserAgentSwitcher(Hook): + __name__ = "UserAgentSwitcher" + __type__ = "hook" + __version__ = "0.01" + + __config__ = [("ua", "str", "Custom user-agent string", "")] + + __description__ = """Custom user-agent""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + interval = 0 #@TODO: Remove in 0.4.10 + + + def setup(self): + self.info = {} #@TODO: Remove in 0.4.10 + + + def downloadPreparing(self, pyfile): + ua = self.getConfig('ua') + if ua: + self.logDebug("Use custom user-agent string: " + ua) + pyfile.plugin.req.http.c.setopt(pycurl.USERAGENT, ua) -- cgit v1.2.3 From 0d2ae48fae0abb4274e477f54235d4f389b5e6b2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Apr 2015 19:36:10 +0200 Subject: [AntiVirus] Recycle bin support --- module/plugins/hooks/AntiVirus.py | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index cc3c5c754..f94d8d205 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -11,15 +11,16 @@ from module.utils import fs_encode, save_join class AntiVirus(Hook): __name__ = "AntiVirus" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" #@TODO: add trash option (use Send2Trash lib) - __config__ = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), - ("quardir" , "folder" , "Quarantine folder" , "" ), - ("scanfailed", "bool" , "Scan incompleted files (failed downloads)", False ), - ("cmdfile" , "file" , "Antivirus executable" , "" ), - ("cmdargs" , "str" , "Scan options" , "" ), - ("ignore-err", "bool" , "Ignore scan errors" , False )] + __config__ = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), + ("quardir" , "folder" , "Quarantine folder" , "" ), + ("deltotrash", "bool" , "Move to trash (recycle bin) instead delete", True ), + ("scanfailed", "bool" , "Scan incompleted files (failed downloads)" , False ), + ("cmdfile" , "file" , "Antivirus executable" , "" ), + ("cmdargs" , "str" , "Scan options" , "" ), + ("ignore-err", "bool" , "Ignore scan errors" , False )] __description__ = """Scan downloaded files with antivirus program""" __license__ = "GPLv3" @@ -32,6 +33,16 @@ class AntiVirus(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 + try: + import send2trash + + except ImportError: + self.logDebug(name, _("Send2Trash lib not found")) + self.trashable = False + + else: + self.trashable = True + @Expose @threaded @@ -46,6 +57,7 @@ class AntiVirus(Hook): thread.addActive(pyfile) pyfile.setCustomStatus(_("virus scanning")) + pyfile.setProgress(0) try: p = subprocess.Popen([cmdfile, cmdargs, file], bufsize=-1, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -66,11 +78,19 @@ class AntiVirus(Hook): action = self.getConfig('action') try: if action == "Delete": - os.remove(file) + if not self.getConfig('deltotrash'): + os.remove(file) + + elif self.trashable: + send2trash.send2trash(file) + + else: + self.logWarning("Unable to move file to trash, move to quarantine instead") + pyfile.setCustomStatus(_("file moving")) + shutil.move(file, self.getConfig('quardir')) elif action == "Quarantine": pyfile.setCustomStatus(_("file moving")) - pyfile.setProgress(0) shutil.move(file, self.getConfig('quardir')) except (IOError, shutil.Error), e: -- cgit v1.2.3 From a01a2dcb91bb2020aa4c7548a52ba98dbe43ceef Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Apr 2015 21:12:09 +0200 Subject: [ExtractArchive] Improve send2trash feature --- module/plugins/hooks/ExtractArchive.py | 81 ++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 8c40667c2..8b6a140cd 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -106,24 +106,25 @@ class ArchiveQueue(object): class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.38" - - __config__ = [("activated" , "bool" , "Activated" , True ), - ("fullpath" , "bool" , "Extract with full paths" , True ), - ("overwrite" , "bool" , "Overwrite files" , False ), - ("keepbroken" , "bool" , "Try to extract broken archives" , False ), - ("repair" , "bool" , "Repair broken archives (RAR required)" , False ), - ("test" , "bool" , "Test archive before extracting" , False ), - ("usepasswordfile", "bool" , "Use password file" , True ), - ("passwordfile" , "file" , "Password file" , "archive_password.txt" ), - ("delete" , "No;Permanent;Trash", "Delete archive after extraction" , "No" ), - ("subfolder" , "bool" , "Create subfolder for each package" , False ), - ("destination" , "folder" , "Extract files to folder" , "" ), - ("extensions" , "str" , "Extract archives ending with extension", "7z,bz2,bzip2,gz,gzip,lha,lzh,lzma,rar,tar,taz,tbz,tbz2,tgz,xar,xz,z,zip"), - ("excludefiles" , "str" , "Don't extract the following files" , "*.nfo,*.DS_Store,index.dat,thumb.db" ), - ("recursive" , "bool" , "Extract archives in archives" , True ), - ("waitall" , "bool" , "Run after all downloads was processed" , False ), - ("renice" , "int" , "CPU priority" , 0 )] + __version__ = "1.39" + + __config__ = [("activated" , "bool" , "Activated" , True ), + ("fullpath" , "bool" , "Extract with full paths" , True ), + ("overwrite" , "bool" , "Overwrite files" , False ), + ("keepbroken" , "bool" , "Try to extract broken archives" , False ), + ("repair" , "bool" , "Repair broken archives (RAR required)" , False ), + ("test" , "bool" , "Test archive before extracting" , False ), + ("usepasswordfile", "bool" , "Use password file" , True ), + ("passwordfile" , "file" , "Password file" , "archive_password.txt" ), + ("delete" , "bool" , "Delete archive after extraction" , True ), + ("deltotrash" , "bool" , "Move to trash (recycle bin) instead delete", True ), + ("subfolder" , "bool" , "Create subfolder for each package" , False ), + ("destination" , "folder" , "Extract files to folder" , "" ), + ("extensions" , "str" , "Extract archives ending with extension" , "7z,bz2,bzip2,gz,gzip,lha,lzh,lzma,rar,tar,taz,tbz,tbz2,tgz,xar,xz,z,zip"), + ("excludefiles" , "str" , "Don't extract the following files" , "*.nfo,*.DS_Store,index.dat,thumb.db" ), + ("recursive" , "bool" , "Extract archives in archives" , True ), + ("waitall" , "bool" , "Run after all downloads was processed" , False ), + ("renice" , "int" , "CPU priority" , 0 )] __description__ = """Extract different kind of archives""" __license__ = "GPLv3" @@ -148,7 +149,16 @@ class ExtractArchive(Hook): self.extractors = [] self.passwords = [] self.repair = False - self.trash = False + + try: + import send2trash + + except ImportError: + self.logDebug(name, _("Send2Trash lib not found")) + self.trashable = False + + else: + self.trashable = True def coreReady(self): @@ -321,6 +331,7 @@ class ExtractArchive(Hook): new_files = self._extract(pyfile, archive, pypack.password) finally: + pyfile.setProgress(100) thread.finishFile(pyfile) except Exception, e: @@ -449,31 +460,25 @@ class ExtractArchive(Hook): pyfile.setStatus("processing") delfiles = archive.getDeleteFiles() - if self.core.debug: - self.logDebug("Would delete: %s" % ", ".join(delfiles)) + self.logDebug("Would delete: " + ", ".join(delfiles)) - if self.getConfig('delete') != 'No': - try: - from send2trash import send2trash - if self.getConfig('delete') == "Trash": - self.trash = True - self.logInfo(_("Sending %s files to trash") % len(delfiles)) - except ImportError: - self.logError(name, _("Send2Trash not installed, no files deleted")) - self.trash = False - - if self.getConfig('delete') == "Permanent": - self.trash = False - self.logInfo(_("Deleting %s files") % len(delfiles)) + if self.getConfig('delete'): + self.logInfo(_("Deleting %s files") % len(delfiles)) + deltotrash = self.getConfig('deltotrash') for f in delfiles: file = fs_encode(f) - if os.path.exists(file) and self.trash: - send2trash(file) - elif os.path.exists(file): + if not os.path.exists(file) + continue + + if not deltotrash: os.remove(file) + + elif self.trashable: + send2trash.send2trash(file) + else: - self.logDebug("%s does not exists" % f) + self.logWarning("Unable to move %s to trash" % os.path.basename(f)) self.logInfo(name, _("Extracting finished")) extracted_files = archive.files or archive.list() -- cgit v1.2.3 From 034d87c836f9fba82142a06b5f666c84ca10bd50 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Apr 2015 21:26:23 +0200 Subject: [YadiSk] Fix https://github.com/pyload/pyload/issues/1321 --- module/plugins/hooks/AntiVirus.py | 2 +- module/plugins/hooks/ExtractArchive.py | 2 +- module/plugins/hoster/YadiSk.py | 45 +++++++++++++++++----------------- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index f94d8d205..78f5aaa23 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -85,7 +85,7 @@ class AntiVirus(Hook): send2trash.send2trash(file) else: - self.logWarning("Unable to move file to trash, move to quarantine instead") + self.logWarning(_("Unable to move file to trash, move to quarantine instead")) pyfile.setCustomStatus(_("file moving")) shutil.move(file, self.getConfig('quardir')) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 8b6a140cd..2f981d06b 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -478,7 +478,7 @@ class ExtractArchive(Hook): send2trash.send2trash(file) else: - self.logWarning("Unable to move %s to trash" % os.path.basename(f)) + self.logWarning(_("Unable to move %s to trash") % os.path.basename(f)) self.logInfo(name, _("Extracting finished")) extracted_files = archive.files or archive.list() diff --git a/module/plugins/hoster/YadiSk.py b/module/plugins/hoster/YadiSk.py index 57d8ae786..c3749d30d 100644 --- a/module/plugins/hoster/YadiSk.py +++ b/module/plugins/hoster/YadiSk.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import re -import pycurl import random from module.common.json_layer import json_loads @@ -11,13 +10,13 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class YadiSk(SimpleHoster): __name__ = "YadiSk" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'https?://yadi\.sk/d/\w+' __description__ = """Yadi.sk hoster plugin""" __license__ = "GPLv3" - __authors__ = [("GammaC0de", "nomail@fakemailbox.com")] + __authors__ = [("GammaC0de", None)] OFFLINE_PATTERN = r'Nothing found' @@ -32,7 +31,7 @@ class YadiSk(SimpleHoster): def handleFree(self, pyfile): m = re.search(r'', self.html) if m is None: - self.fail(_("could not find required json data")) + self.error(_("could not find required json data")) res = json_loads(m.group(1)) @@ -41,45 +40,45 @@ class YadiSk(SimpleHoster): yadisk_id = None yadisk_size = None yadisk_name = None - yadisk_hash = None - try: #@TODO: Copy to apiInfo method + + try: #@TODO: Copy to apiInfo for sect in res: if 'model' in sect: - if sect['model'] == 'config': + if sect['model'] == "config": yadisk_ver = sect['data']['version'] yadisk_sk = sect['data']['sk'] - elif sect['model'] == 'resource': + elif sect['model'] == "resource": yadisk_id = sect['data']['id'] yadisk_size = sect['data']['meta']['size'] yadisk_name = sect['data']['name'] - except Exception: - self.fail(_("Unexpected server response")) + except Exception, e: + self.fail(_("Unexpected server response"), e) - if None is in (yadisk_id, yadisk_sk, yadisk_id, yadisk_size, yadisk_name): - self.fail(_("json data is missing important information, cannot continue")) + if None in (yadisk_id, yadisk_sk, yadisk_id, yadisk_size, yadisk_name): + self.error(_("Missing JSON data")) self.pyfile.size = yadisk_size self.pyfile.name = yadisk_name yadisk_idclient = "" - for _i in range(1, 32): + for _i in range(32): yadisk_idclient += random.choice('0123456abcdef') - result_json = self.load("https://yadi.sk/models/?_m=do-get-resource-url", - post={'idClient': yadisk_idclient, - 'version' : yadisk_ver, - '_model.0': "do-get-resource-url", - 'sk' : yadisk_sk, - 'id.0' : yadisk_id}) - - res = json_loads(result_json) try: - self.link = res['models'][0]['data']['file'] + self.html = self.load("https://yadi.sk/models/", + get={'_m': "do-get-resource-url"}, + post={'idClient': yadisk_idclient, + 'version' : yadisk_ver, + '_model.0': "do-get-resource-url", + 'sk' : yadisk_sk, + 'id.0' : yadisk_id}) + + self.link = json_loads(self.html)['models'][0]['data']['file'] except Exception: - self.fail(_("faild to retrieve the download url")) + pass getInfo = create_getInfo(YadiSk) -- cgit v1.2.3 From c99421d6385e0f6b8bd9095c705becbc35f873a0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Apr 2015 22:08:58 +0200 Subject: Traceback code cosmetics --- module/plugins/hooks/ExtractArchive.py | 8 ++++---- module/plugins/hooks/IRCInterface.py | 4 ++-- module/plugins/hooks/MergeFiles.py | 5 ++--- module/plugins/internal/MultiHook.py | 5 +++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 2f981d06b..595512c12 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -4,9 +4,9 @@ from __future__ import with_statement import os import sys +import traceback from copy import copy -from traceback import print_exc # monkey patch bug in python 2.6 and lower # http://bugs.python.org/issue6122 , http://bugs.python.org/issue1236 , http://bugs.python.org/issue1731717 @@ -177,12 +177,12 @@ class ExtractArchive(Hook): else: self.logWarning(_("Could not activate: %s") % p, e) if self.core.debug: - print_exc() + traceback.print_exc() except Exception, e: self.logWarning(_("Could not activate: %s") % p, e) if self.core.debug: - print_exc() + traceback.print_exc() if self.extractors: self.logInfo(_("Activated") + " " + "|".join("%s %s" % (Extractor.__name__, Extractor.VERSION) for Extractor in self.extractors)) @@ -497,7 +497,7 @@ class ExtractArchive(Hook): except Exception, e: self.logError(name, _("Unknown error"), e) if self.core.debug: - print_exc() + traceback.print_exc() self.manager.dispatchEvent("archive_extract_failed", pyfile, archive) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index d76b9cb85..9e2f670e6 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -4,11 +4,11 @@ import re import socket import ssl import time +import traceback from pycurl import FORM_FILE from select import select from threading import Thread -from traceback import print_exc from module.Api import PackageDoesNotExists, FileDoesNotExists from module.network.RequestFactory import getURL @@ -106,7 +106,7 @@ class IRCInterface(Thread, Hook): except IRCError, ex: self.sock.send("QUIT :byebye\r\n") - print_exc() + traceback.print_exc() self.sock.close() diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 2900b0d29..941938920 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -4,8 +4,7 @@ from __future__ import with_statement import os import re - -from traceback import print_exc +import traceback from module.plugins.Hook import Hook, threaded from module.utils import save_join @@ -75,7 +74,7 @@ class MergeFiles(Hook): self.logDebug("Finished merging part", splitted_file) except Exception, e: - print_exc() + traceback.print_exc() finally: pyfile.setProgress(100) diff --git a/module/plugins/internal/MultiHook.py b/module/plugins/internal/MultiHook.py index 291063268..942c044c2 100644 --- a/module/plugins/internal/MultiHook.py +++ b/module/plugins/internal/MultiHook.py @@ -2,6 +2,7 @@ import re import time +import traceback from module.plugins.Hook import Hook from module.utils import decode, remove_chars @@ -10,7 +11,7 @@ from module.utils import decode, remove_chars class MultiHook(Hook): __name__ = "MultiHook" __type__ = "hook" - __version__ = "0.41" + __version__ = "0.42" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -188,7 +189,7 @@ class MultiHook(Hook): except Exception, e: self.core.log.error(_("Error executing hooks: %s") % str(e)) if self.core.debug: - print_exc() + traceback.print_exc() self.cb = self.core.scheduler.addJob(self.interval, self._periodical) -- cgit v1.2.3 From 48abd898139b3f40d52b17680c9d5b8a674545c6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Apr 2015 00:10:43 +0200 Subject: [UserAgentSwitcher] Default activated set to True --- module/plugins/hooks/UserAgentSwitcher.py | 5 +++-- module/plugins/internal/SimpleDereferer.py | 5 +---- module/plugins/internal/SimpleHoster.py | 5 +---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index 56c605bac..31eac9820 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -8,9 +8,10 @@ from module.plugins.Hook import Hook class UserAgentSwitcher(Hook): __name__ = "UserAgentSwitcher" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" - __config__ = [("ua", "str", "Custom user-agent string", "")] + __config__ = [("activated", "bool", "Activated" , True ), + ("ua" , "str" , "Custom user-agent string", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0")] __description__ = """Custom user-agent""" __license__ = "GPLv3" diff --git a/module/plugins/internal/SimpleDereferer.py b/module/plugins/internal/SimpleDereferer.py index 99077bfc3..743a98721 100644 --- a/module/plugins/internal/SimpleDereferer.py +++ b/module/plugins/internal/SimpleDereferer.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import pycurl import re from urllib import unquote @@ -12,7 +11,7 @@ from module.plugins.internal.SimpleHoster import getFileURL, set_cookies class SimpleDereferer(Crypter): __name__ = "SimpleDereferer" __type__ = "crypter" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), @@ -71,8 +70,6 @@ class SimpleDereferer(Crypter): self.html = "" self.req.setOption("timeout", 120) - self.req.http.c.setopt(pycurl.USERAGENT, - "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0") #@NOTE: Work-around to old user-agent bug; remove in 0.4.10 if isinstance(self.COOKIES, list): set_cookies(self.req.cj, self.COOKIES) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 87e136f08..79b7c0534 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -3,7 +3,6 @@ import datetime import mimetypes import os -import pycurl import re import time import urllib2 @@ -248,7 +247,7 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.34" + __version__ = "1.35" __pattern__ = r'^unmatchable$' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -434,8 +433,6 @@ class SimpleHoster(Hoster): self.fail(_("Required account not found")) self.req.setOption("timeout", 120) - self.req.http.c.setopt(pycurl.USERAGENT, - "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0") #@NOTE: Work-around to old user-agent bug; remove in 0.4.10 if isinstance(self.COOKIES, list): set_cookies(self.req.cj, self.COOKIES) -- cgit v1.2.3 From 41a9fc39c201f663ee308840b8443f760b3678da Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Apr 2015 00:30:57 +0200 Subject: [ExtractArchive] Fix https://github.com/pyload/pyload/issues/1322 --- module/plugins/hooks/ExtractArchive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 595512c12..b418f802f 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -106,7 +106,7 @@ class ArchiveQueue(object): class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.39" + __version__ = "1.40" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), @@ -468,7 +468,7 @@ class ExtractArchive(Hook): deltotrash = self.getConfig('deltotrash') for f in delfiles: file = fs_encode(f) - if not os.path.exists(file) + if not os.path.exists(file): continue if not deltotrash: -- cgit v1.2.3