diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-08-01 19:35:59 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-08-01 19:35:59 +0200 |
commit | ba916633f2bedb04c7358000b91aed69f52e8e43 (patch) | |
tree | 5b0e323417bf2ac9f3d88b4234c7e8da98d30f5c /module/plugins/hooks | |
parent | [DepositfilesCom] Fix missing declaration (thx hmlinaric) (diff) | |
download | pyload-ba916633f2bedb04c7358000b91aed69f52e8e43.tar.xz |
Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics
Diffstat (limited to 'module/plugins/hooks')
43 files changed, 126 insertions, 518 deletions
diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index 1ef9b252a..906875a69 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -1,15 +1,13 @@ # -*- coding: utf-8 -*- -# should be working - from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster class AlldebridCom(MultiHoster): __name__ = "AlldebridCom" - __version__ = "0.13" __type__ = "hook" + __version__ = "0.13" __config__ = [("activated", "bool", "Activated", False), ("https", "bool", "Enable HTTPS", False), diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 5ac117818..d62de24a7 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -1,30 +1,12 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - -from thread import start_new_thread from pycurl import FORM_FILE, LOW_SPEED_TIME +from thread import start_new_thread -from module.network.RequestFactory import getURL, getRequest from module.network.HTTPRequest import BadHeader - +from module.network.RequestFactory import getURL, getRequest from module.plugins.Hook import Hook -PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" - class BypassCaptchaException(Exception): @@ -43,8 +25,8 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" - __version__ = "0.04" __type__ = "hook" + __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force BC even if client is connected", False), @@ -54,6 +36,8 @@ class BypassCaptcha(Hook): __author_name__ = ("RaNaN", "Godofdream", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "soilfcition@gmail.com", "zoidberg@mujmail.cz") + PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" + SUBMIT_URL = "http://bypasscaptcha.com/upload.php" RESPOND_URL = "http://bypasscaptcha.com/check_value.php" GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php" @@ -76,7 +60,7 @@ class BypassCaptcha(Hook): try: response = req.load(self.SUBMIT_URL, - post={"vendor_key": PYLOAD_KEY, + post={"vendor_key": self.PYLOAD_KEY, "key": self.getConfig("passkey"), "gen_task_id": "1", "file": (FORM_FILE, captcha)}, diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index b4e3ad34b..1b7406edd 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -1,35 +1,21 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" from __future__ import with_statement -from thread import start_new_thread -from base64 import b64encode import time -from module.network.RequestFactory import getURL -from module.network.HTTPRequest import BadHeader +from base64 import b64encode +from thread import start_new_thread +from module.network.HTTPRequest import BadHeader +from module.network.RequestFactory import getURL from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" - __version__ = "0.09" __type__ = "hook" + __version__ = "0.09" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 54dfbe4d6..e240cbbc0 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -1,28 +1,14 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" from __future__ import with_statement -from thread import start_new_thread - -import pycurl import StringIO -from urllib import urlencode -from time import sleep +import pycurl + from PIL import Image +from thread import start_new_thread +from time import sleep +from urllib import urlencode from module.network.RequestFactory import getURL, getRequest from module.plugins.Hook import Hook @@ -45,8 +31,8 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" - __version__ = "0.05" __type__ = "hook" + __version__ = "0.05" __config__ = [("activated", "bool", "Activated", False), ("username", "str", "Username", ""), diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index a51eb4b47..0fe2ae88c 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -1,29 +1,16 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - from __future__ import with_statement + import hashlib +import re import zlib + from os import remove from os.path import getsize, isfile, splitext -import re -from module.utils import save_join, fs_encode from module.plugins.Hook import Hook +from module.utils import save_join, fs_encode def computeChecksum(local_file, algorithm): @@ -52,8 +39,8 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): __name__ = "Checksum" - __version__ = "0.12" __type__ = "hook" + __version__ = "0.12" __config__ = [("activated", "bool", "Activated", False), ("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"), diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 3c47d30ce..5c523caf7 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -1,20 +1,5 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - import socket import thread @@ -23,8 +8,8 @@ from module.plugins.Hook import Hook class ClickAndLoad(Hook): __name__ = "ClickAndLoad" - __version__ = "0.22" __type__ = "hook" + __version__ = "0.22" __config__ = [("activated", "bool", "Activated", True), ("extern", "bool", "Allow external link adding", False)] diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 64ed2280f..530395d32 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -1,31 +1,18 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" from __future__ import with_statement -from thread import start_new_thread +import re + +from base64 import b64encode from pycurl import FORM_FILE, HTTPHEADER +from thread import start_new_thread from time import sleep -from base64 import b64encode -import re -from module.network.RequestFactory import getRequest +from module.common.json_layer import json_loads from module.network.HTTPRequest import BadHeader +from module.network.RequestFactory import getRequest from module.plugins.Hook import Hook -from module.common.json_layer import json_loads class DeathByCaptchaException(Exception): @@ -59,8 +46,8 @@ class DeathByCaptchaException(Exception): class DeathByCaptcha(Hook): __name__ = "DeathByCaptcha" - __version__ = "0.03" __type__ = "hook" + __version__ = "0.03" __config__ = [("activated", "bool", "Activated", False), ("username", "str", "Username", ""), @@ -134,7 +121,7 @@ class DeathByCaptcha(Hook): raise DeathByCaptchaException('service-overload') def submit(self, captcha, captchaType="file", match=None): - #workaround multipart-post bug in HTTPRequest.py + #workaround multipart-post bug in HTTPRequest.py if re.match("^[A-Za-z0-9]*$", self.getConfig("passkey")): multipart = True data = (FORM_FILE, captcha) diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index 1a081da7a..88efb6b2a 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -1,26 +1,12 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.internal.MultiHoster import MultiHoster class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" - __version__ = "0.07" __type__ = "hook" + __version__ = "0.07" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 1c80facc9..bc926906f 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -1,28 +1,13 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - from module.database import style from module.plugins.Hook import Hook class DeleteFinished(Hook): __name__ = "DeleteFinished" - __version__ = "1.09" __type__ = "hook" + __version__ = "1.09" __config__ = [('activated', 'bool', 'Activated', 'False'), ('interval', 'int', 'Delete every (hours)', '72'), diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 070c0634e..a3d70b3ab 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. - - Original idea by new.cze -""" - import re + from time import localtime from module.plugins.Hook import Hook @@ -23,8 +9,8 @@ from module.plugins.Hook import Hook class DownloadScheduler(Hook): __name__ = "DownloadScheduler" - __version__ = "0.21" __type__ = "hook" + __version__ = "0.21" __config__ = [("activated", "bool", "Activated", False), ("timetable", "str", "List time periods as hh:mm full or number(kB/s)", diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 1cf5e40ae..da37297d9 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -7,8 +7,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class EasybytezCom(MultiHoster): __name__ = "EasybytezCom" - __version__ = "0.03" __type__ = "hook" + __version__ = "0.03" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index 3a98abbf7..c54c38bc6 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -1,29 +1,16 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" from time import mktime, time from module.lib import feedparser + from module.plugins.Hook import Hook class Ev0InFetcher(Hook): __name__ = "Ev0InFetcher" - __version__ = "0.21" __type__ = "hook" + __version__ = "0.21" __config__ = [("activated", "bool", "Activated", False), ("interval", "int", "Check interval in minutes", 10), diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 9e151f8f6..c7ab80da0 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -1,36 +1,21 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" from __future__ import with_statement -from thread import start_new_thread +from base64 import b64encode from pycurl import LOW_SPEED_TIME +from thread import start_new_thread from uuid import uuid4 -from base64 import b64encode -from module.network.RequestFactory import getURL, getRequest from module.network.HTTPRequest import BadHeader - +from module.network.RequestFactory import getURL, getRequest from module.plugins.Hook import Hook class ExpertDecoders(Hook): __name__ = "ExpertDecoders" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", False), diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 7f76df1cd..8d03d27d4 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - import subprocess + from os import listdir, access, X_OK, makedirs from os.path import join, exists, basename, abspath @@ -25,8 +11,8 @@ from module.utils import save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" - __version__ = "0.23" __type__ = "hook" + __version__ = "0.23" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index c307deb8f..144829459 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -1,19 +1,18 @@ # -*- coding: utf-8 -*- -import sys import os +import sys + +from copy import copy from os import remove, chmod, makedirs -from os.path import exists, basename, isfile, isdir, join +from os.path import exists, basename, isfile, isdir from traceback import print_exc -from copy import copy # monkey patch bug in python 2.6 and lower -# see http://bugs.python.org/issue6122 -# http://bugs.python.org/issue1236 -# http://bugs.python.org/issue1731717 +# http://bugs.python.org/issue6122 , http://bugs.python.org/issue1236 , http://bugs.python.org/issue1731717 if sys.version_info < (2, 7) and os.name != "nt": - from subprocess import Popen import errno + from subprocess import Popen def _eintr_retry_call(func, *args): while True: @@ -44,13 +43,13 @@ if sys.version_info < (2, 7) and os.name != "nt": Popen.wait = wait if os.name != "nt": + from grp import getgrnam from os import chown from pwd import getpwnam - from grp import getgrnam -from module.utils import save_join, fs_encode from module.plugins.Hook import Hook, threaded, Expose from module.plugins.internal.AbstractExtractor import ArchiveError, CRCError, WrongPassword +from module.utils import save_join, fs_encode class ExtractArchive(Hook): @@ -58,8 +57,8 @@ class ExtractArchive(Hook): Provides: unrarFinished (folder, filename) """ __name__ = "ExtractArchive" - __version__ = "0.16" __type__ = "hook" + __version__ = "0.16" __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), @@ -158,7 +157,7 @@ class ExtractArchive(Hook): #relative to package folder if destination is relative, otherwise absolute path overwrites them if self.getConfig("subfolder"): - out = join(out, fs_encode(p.folder)) + out = save_join(out, fs_encode(p.folder)) if not exists(out): makedirs(out) diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index aa020ea37..879dba277 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -1,16 +1,14 @@ # -*- coding: utf-8 -*- -# should be working - +from module.common.json_layer import json_loads from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster -from module.common.json_layer import json_loads class FastixRu(MultiHoster): __name__ = "FastixRu" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 3d2f7fcef..12d58ac8a 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -1,28 +1,13 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster class FreeWayMe(MultiHoster): __name__ = "FreeWayMe" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 08ef93812..4c81292e3 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -1,35 +1,18 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - -from os import makedirs -from os import listdir -from os.path import exists -from os.path import join -from os.path import isfile -from shutil import move import time +from os import listdir, makedirs +from os.path import exists, isfile, join +from shutil import move + from module.plugins.Hook import Hook class HotFolder(Hook): __name__ = "HotFolder" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), ("folder", "str", "Folder to observe", "container"), diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index a29874469..7ebc0275f 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -1,39 +1,25 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" +import re +import socket +import time +from pycurl import FORM_FILE from select import select -import socket from threading import Thread -import time from time import sleep from traceback import print_exc -import re -from pycurl import FORM_FILE -from module.plugins.Hook import Hook +from module.Api import PackageDoesNotExists, FileDoesNotExists from module.network.RequestFactory import getURL +from module.plugins.Hook import Hook from module.utils import formatSize -from module.Api import PackageDoesNotExists, FileDoesNotExists class IRCInterface(Thread, Hook): __name__ = "IRCInterface" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), ("host", "str", "IRC-Server Address", "Enter your server here!"), diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 4d7be96e3..d9d4e547e 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -1,24 +1,12 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" from __future__ import with_statement -from thread import start_new_thread -from pycurl import FORM_FILE, LOW_SPEED_TIME + import re + from base64 import b64encode +from pycurl import FORM_FILE, LOW_SPEED_TIME +from thread import start_new_thread from module.network.RequestFactory import getURL, getRequest from module.plugins.Hook import Hook @@ -41,8 +29,8 @@ class ImageTyperzException(Exception): class ImageTyperz(Hook): __name__ = "ImageTyperz" - __version__ = "0.04" __type__ = "hook" + __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), ("username", "str", "Username", ""), @@ -82,7 +70,7 @@ class ImageTyperz(Hook): req.c.setopt(LOW_SPEED_TIME, 80) try: - #workaround multipart-post bug in HTTPRequest.py + #workaround multipart-post bug in HTTPRequest.py if re.match("^[A-Za-z0-9]*$", self.getConfig("passkey")): multipart = True data = (FORM_FILE, captcha) diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 4e08372fe..1aa8f7ca1 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -1,31 +1,16 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - import re -from module.plugins.Hook import Hook from module.network.RequestFactory import getURL +from module.plugins.Hook import Hook from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" - __version__ = "0.19" __type__ = "hook" + __version__ = "0.19" __config__ = [("activated", "bool", "Activated", False)] diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index a0e5b8d38..20da68632 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -1,14 +1,14 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.MultiHoster import MultiHoster -from module.network.RequestFactory import getURL from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class LinksnappyCom(MultiHoster): __name__ = "LinksnappyCom" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 22945cc0f..605b04f21 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -1,28 +1,14 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ -from module.plugins.internal.MultiHoster import MultiHoster -from module.network.RequestFactory import getURL from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class MegaDebridEu(MultiHoster): __name__ = "MegaDebridEu" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("unloadFailing", "bool", "Revert to standard download if download fails", False)] diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 5d6c208a7..a859092fb 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -1,35 +1,17 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - import os import re import traceback -from os.path import join -from module.utils import save_join, fs_encode from module.plugins.Hook import Hook, threaded - -BUFFER_SIZE = 4096 +from module.utils import save_join, fs_encode class MergeFiles(Hook): __name__ = "MergeFiles" - __version__ = "0.12" __type__ = "hook" + __version__ = "0.12" __config__ = [("activated", "bool", "Activated", False)] @@ -37,6 +19,8 @@ class MergeFiles(Hook): __author_name__ = "and9000" __author_mail__ = "me@has-no-mail.com" + BUFFER_SIZE = 4096 + def setup(self): # nothing to do @@ -61,7 +45,7 @@ class MergeFiles(Hook): for name, file_list in files.iteritems(): self.logInfo("Starting merging of %s" % name) - final_file = open(join(download_folder, fs_encode(name)), "wb") + final_file = open(save_join(download_folder, name), "wb") for splitted_file in file_list: self.logDebug("Merging part %s" % splitted_file) @@ -72,10 +56,10 @@ class MergeFiles(Hook): size_written = 0 s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file))) while True: - f_buffer = s_file.read(BUFFER_SIZE) + f_buffer = s_file.read(self.BUFFER_SIZE) if f_buffer: final_file.write(f_buffer) - size_written += BUFFER_SIZE + size_written += self.BUFFER_SIZE pyfile.setProgress((size_written * 100) / s_file_size) else: break diff --git a/module/plugins/hooks/MultiDebridCom.py b/module/plugins/hooks/MultiDebridCom.py index 3309fb9a8..c5d1464f8 100644 --- a/module/plugins/hooks/MultiDebridCom.py +++ b/module/plugins/hooks/MultiDebridCom.py @@ -1,28 +1,14 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ -from module.plugins.internal.MultiHoster import MultiHoster -from module.network.RequestFactory import getURL from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class MultiDebridCom(MultiHoster): __name__ = "MultiDebridCom" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index b9c663046..e2167b65e 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -1,20 +1,5 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - from time import time from module.plugins.Hook import Hook @@ -22,8 +7,8 @@ from module.plugins.Hook import Hook class MultiHome(Hook): __name__ = "MultiHome" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), ("interfaces", "str", "Interfaces", "None")] diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index 8baa4bb07..9249106d6 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -8,8 +8,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class MultishareCz(MultiHoster): __name__ = "MultishareCz" - __version__ = "0.04" __type__ = "hook" + __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index dcc57aa75..5be0b8482 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class OverLoadMe(MultiHoster): __name__ = "OverLoadMe" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("https", "bool", "Enable HTTPS", True), diff --git a/module/plugins/hooks/Premium4Me.py b/module/plugins/hooks/Premium4Me.py index 242e72f3e..9c6701b06 100644 --- a/module/plugins/hooks/Premium4Me.py +++ b/module/plugins/hooks/Premium4Me.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class Premium4Me(MultiHoster): __name__ = "Premium4Me" - __version__ = "0.03" __type__ = "hook" + __version__ = "0.03" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index 1a35460de..e7291ece9 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -1,15 +1,14 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.MultiHoster import MultiHoster - from module.common.json_layer import json_loads from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class PremiumizeMe(MultiHoster): __name__ = "PremiumizeMe" - __version__ = "0.12" __type__ = "hook" + __version__ = "0.12" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), @@ -40,7 +39,7 @@ class PremiumizeMe(MultiHoster): if data['status'] != 200: return [] - # Extract hosters from json file + # Extract hosters from json file return data['result']['hosterlist'] def coreReady(self): @@ -51,5 +50,5 @@ class PremiumizeMe(MultiHoster): self.logError(_("Please add a valid premiumize.me account first and restart pyLoad.")) return - # Run the overwriten core ready which actually enables the multihoster hook + # Run the overwriten core ready which actually enables the multihoster hook return MultiHoster.coreReady(self) diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 36cf69b4b..9b9b7cda9 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -1,14 +1,14 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.MultiHoster import MultiHoster from module.common.json_layer import json_loads from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class RPNetBiz(MultiHoster): __name__ = "RPNetBiz" - __version__ = "0.1" __type__ = "hook" + __version__ = "0.1" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), @@ -37,7 +37,7 @@ class RPNetBiz(MultiHoster): if 'error' in hoster_list: return [] - # Extract hosters from json file + # Extract hosters from json file return hoster_list['hosters'] def coreReady(self): @@ -48,5 +48,5 @@ class RPNetBiz(MultiHoster): self.logError(_("Please enter your %s account or deactivate this plugin") % "rpnet") return - # Run the overwriten core ready which actually enables the multihoster hook + # Run the overwriten core ready which actually enables the multihoster hook return MultiHoster.coreReady(self) diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index 4477fba4a..87902ac7f 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class RealdebridCom(MultiHoster): __name__ = "RealdebridCom" - __version__ = "0.43" __type__ = "hook" + __version__ = "0.43" __config__ = [("activated", "bool", "Activated", False), ("https", "bool", "Enable HTTPS", False), diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 96e06950e..d504bb83b 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class RehostTo(MultiHoster): __name__ = "RehostTo" - __version__ = "0.43" __type__ = "hook" + __version__ = "0.43" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 2bd0e28db..3aef6f8cd 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -1,26 +1,12 @@ # -*- coding: utf-8 -*- -############################################################################### -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -############################################################################### from module.plugins.Hook import Hook class RestartFailed(Hook): __name__ = "RestartFailed" - __version__ = "1.55" __type__ = "hook" + __version__ = "1.55" __config__ = [("activated", "bool", "Activated", False), ("interval", "int", "Check interval in minutes", 90)] diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index 41268e231..a946d391e 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL @@ -21,8 +7,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class SimplyPremiumCom(MultiHoster): __name__ = "SimplyPremiumCom" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index 345d37e4a..ab13f312e 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class SimplydebridCom(MultiHoster): __name__ = "SimplydebridCom" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index d40854e99..f25c5e2b4 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -1,30 +1,16 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" from os.path import basename -from module.utils import fs_encode -from module.plugins.Hook import Hook from module.PyFile import PyFile +from module.plugins.Hook import Hook +from module.utils import fs_encode class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index 3303c7355..ee5d79269 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -1,28 +1,14 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ -from module.plugins.internal.MultiHoster import MultiHoster -from module.network.RequestFactory import getURL from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class UnrestrictLi(MultiHoster): __name__ = "UnrestrictLi" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 5f71ad6fa..9e01989d9 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -5,7 +5,7 @@ import sys from operator import itemgetter from os import remove, stat -from os.path import isfile +from os.path import isfile, join from time import time from module.network.RequestFactory import getURL @@ -257,7 +257,7 @@ class UpdateManager(Hook): py_file = name + ".py" pyc_file = name + ".pyc" - for root in ("userplugins", save_join(pypath, "module", "plugins")): + for root in ("userplugins", join(pypath, "module", "plugins")): py_filename = save_join(root, type, py_file) pyc_filename = save_join(root, type, pyc_file) diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index 25fa3abe5..01570b966 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -1,28 +1,15 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" -import time import httplib +import time + from module.plugins.Hook import Hook class WindowsPhoneToastNotify(Hook): __name__ = "WindowsPhoneToastNotify" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force even if client is connected", False), diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 37a464b33..eb0376921 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -7,8 +7,8 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", True), ("loadDefault", "bool", "Include default (built-in) hoster list", True), diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index a60d31b89..c4a94a8bc 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -1,33 +1,18 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - from pyxmpp import streamtls from pyxmpp.all import JID, Message -from pyxmpp.jabber.client import JabberClient from pyxmpp.interface import implements from pyxmpp.interfaces import * +from pyxmpp.jabber.client import JabberClient from module.plugins.hooks.IRCInterface import IRCInterface class XMPPInterface(IRCInterface, JabberClient): __name__ = "XMPPInterface" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), ("jid", "str", "Jabber ID", "user@exmaple-jabber-server.org"), diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index 49fc68b30..0d5e23118 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class ZeveraCom(MultiHoster): __name__ = "ZeveraCom" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), |