summaryrefslogtreecommitdiffstats
path: root/pyload/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-08 01:08:03 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 11:03:20 +0200
commit91115fd577f20704ef7f2e74c4527ffbb0730a09 (patch)
tree198fc68f1eb6f42e220d0f1c68499f48ae70543c /pyload/plugins
parentProject __init__ with info (diff)
downloadpyload-91115fd577f20704ef7f2e74c4527ffbb0730a09.tar.xz
Restructure pyload file tree (1)
Diffstat (limited to 'pyload/plugins')
-rw-r--r--pyload/plugins/AccountManager.py173
-rw-r--r--pyload/plugins/PluginManager.py356
-rw-r--r--pyload/plugins/accounts/BayfilesCom.py2
-rw-r--r--pyload/plugins/accounts/FastixRu.py2
-rw-r--r--pyload/plugins/accounts/FilecloudIo.py2
-rw-r--r--pyload/plugins/accounts/FileserveCom.py2
-rw-r--r--pyload/plugins/accounts/FourSharedCom.py2
-rw-r--r--pyload/plugins/accounts/FreeWayMe.py2
-rw-r--r--pyload/plugins/accounts/LetitbitNet.py2
-rw-r--r--pyload/plugins/accounts/LinksnappyCom.py2
-rw-r--r--pyload/plugins/accounts/MegaDebridEu.py2
-rw-r--r--pyload/plugins/accounts/MultiDebridCom.py2
-rw-r--r--pyload/plugins/accounts/OboomCom.py2
-rw-r--r--pyload/plugins/accounts/OverLoadMe.py2
-rw-r--r--pyload/plugins/accounts/PremiumizeMe.py2
-rw-r--r--pyload/plugins/accounts/RPNetBiz.py2
-rw-r--r--pyload/plugins/accounts/RapidgatorNet.py2
-rw-r--r--pyload/plugins/accounts/SimplyPremiumCom.py2
-rw-r--r--pyload/plugins/accounts/UnrestrictLi.py2
-rw-r--r--pyload/plugins/crypter/DailymotionBatch.py2
-rw-r--r--pyload/plugins/crypter/GooGl.py2
-rw-r--r--pyload/plugins/crypter/LinkSaveIn.py6
-rw-r--r--pyload/plugins/crypter/MediafireComFolder.py2
-rw-r--r--pyload/plugins/crypter/MultiuploadCom.py2
-rw-r--r--pyload/plugins/crypter/OneKhDe.py4
-rw-r--r--pyload/plugins/crypter/SafelinkingNet.py2
-rw-r--r--pyload/plugins/crypter/SerienjunkiesOrg.py12
-rw-r--r--pyload/plugins/crypter/TurbobitNetFolder.py2
-rw-r--r--pyload/plugins/crypter/YoutubeBatch.py2
-rw-r--r--pyload/plugins/hooks/DeathByCaptcha.py2
-rw-r--r--pyload/plugins/hooks/FastixRu.py2
-rw-r--r--pyload/plugins/hooks/IRCInterface.py2
-rw-r--r--pyload/plugins/hooks/LinksnappyCom.py2
-rw-r--r--pyload/plugins/hooks/MegaDebridEu.py2
-rw-r--r--pyload/plugins/hooks/MultiDebridCom.py2
-rw-r--r--pyload/plugins/hooks/PremiumizeMe.py2
-rw-r--r--pyload/plugins/hooks/RPNetBiz.py2
-rw-r--r--pyload/plugins/hooks/SimplyPremiumCom.py2
-rw-r--r--pyload/plugins/hooks/UnSkipOnFail.py2
-rw-r--r--pyload/plugins/hooks/UnrestrictLi.py2
-rw-r--r--pyload/plugins/hoster/AlldebridCom.py2
-rw-r--r--pyload/plugins/hoster/BayfilesCom.py2
-rw-r--r--pyload/plugins/hoster/DailymotionCom.py4
-rw-r--r--pyload/plugins/hoster/DlFreeFr.py2
-rw-r--r--pyload/plugins/hoster/ExtabitCom.py2
-rw-r--r--pyload/plugins/hoster/FastixRu.py2
-rw-r--r--pyload/plugins/hoster/FilecloudIo.py2
-rw-r--r--pyload/plugins/hoster/FilepostCom.py2
-rw-r--r--pyload/plugins/hoster/FileserveCom.py2
-rw-r--r--pyload/plugins/hoster/IfileIt.py2
-rw-r--r--pyload/plugins/hoster/LetitbitNet.py2
-rw-r--r--pyload/plugins/hoster/LinksnappyCom.py2
-rw-r--r--pyload/plugins/hoster/MegaDebridEu.py2
-rw-r--r--pyload/plugins/hoster/MegaNz.py2
-rw-r--r--pyload/plugins/hoster/MegacrypterCom.py2
-rw-r--r--pyload/plugins/hoster/MultiDebridCom.py2
-rw-r--r--pyload/plugins/hoster/MyvideoDe.py4
-rw-r--r--pyload/plugins/hoster/OboomCom.py2
-rw-r--r--pyload/plugins/hoster/OverLoadMe.py2
-rw-r--r--pyload/plugins/hoster/PremiumizeMe.py2
-rw-r--r--pyload/plugins/hoster/RPNetBiz.py2
-rw-r--r--pyload/plugins/hoster/RapidgatorNet.py2
-rw-r--r--pyload/plugins/hoster/RealdebridCom.py2
-rw-r--r--pyload/plugins/hoster/RedtubeCom.py4
-rw-r--r--pyload/plugins/hoster/UlozTo.py2
-rw-r--r--pyload/plugins/hoster/UnrestrictLi.py2
-rw-r--r--pyload/plugins/hoster/UploadingCom.py2
-rw-r--r--pyload/plugins/hoster/XHamsterCom.py2
-rw-r--r--pyload/plugins/hoster/YibaishiwuCom.py2
69 files changed, 78 insertions, 607 deletions
diff --git a/pyload/plugins/AccountManager.py b/pyload/plugins/AccountManager.py
deleted file mode 100644
index 67909072f..000000000
--- a/pyload/plugins/AccountManager.py
+++ /dev/null
@@ -1,173 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from os.path import exists
-from shutil import copy
-
-from threading import Lock
-
-from pyload.PullEvents import AccountUpdateEvent
-from pyload.utils import chmod, lock
-
-ACC_VERSION = 1
-
-
-class AccountManager:
- """manages all accounts"""
-
- #--------------------------------------------------------------------------
- def __init__(self, core):
- """Constructor"""
-
- self.core = core
- self.lock = Lock()
-
- self.initPlugins()
- self.saveAccounts() # save to add categories to conf
-
- def initPlugins(self):
- self.accounts = {} # key = ( plugin )
- self.plugins = {}
-
- self.initAccountPlugins()
- self.loadAccounts()
-
- def getAccountPlugin(self, plugin):
- """get account instance for plugin or None if anonymous"""
- if plugin in self.accounts:
- if plugin not in self.plugins:
- try:
- self.plugins[plugin] = self.core.pluginManager.loadClass("accounts", plugin)(self, self.accounts[plugin])
- except TypeError: # The account class no longer exists (blacklisted plugin). Skipping the account to avoid crash
- return None
-
- return self.plugins[plugin]
- else:
- return None
-
- def getAccountPlugins(self):
- """ get all account instances"""
-
- plugins = []
- for plugin in self.accounts.keys():
- plugins.append(self.getAccountPlugin(plugin))
-
- return plugins
-
- #--------------------------------------------------------------------------
- def loadAccounts(self):
- """loads all accounts available"""
-
- if not exists("accounts.conf"):
- f = open("accounts.conf", "wb")
- f.write("version: " + str(ACC_VERSION))
- f.close()
-
- f = open("accounts.conf", "rb")
- content = f.readlines()
- version = content[0].split(":")[1].strip() if content else ""
- f.close()
-
- if not version or int(version) < ACC_VERSION:
- copy("accounts.conf", "accounts.backup")
- f = open("accounts.conf", "wb")
- f.write("version: " + str(ACC_VERSION))
- f.close()
- self.core.log.warning(_("Account settings deleted, due to new config format."))
- return
-
- plugin = ""
- name = ""
-
- for line in content[1:]:
- line = line.strip()
-
- if not line: continue
- if line.startswith("#"): continue
- if line.startswith("version"): continue
-
- if line.endswith(":") and line.count(":") == 1:
- plugin = line[:-1]
- self.accounts[plugin] = {}
-
- elif line.startswith("@"):
- try:
- option = line[1:].split()
- self.accounts[plugin][name]['options'][option[0]] = [] if len(option) < 2 else ([option[1]] if len(option) < 3 else option[1:])
- except:
- pass
-
- elif ":" in line:
- name, sep, pw = line.partition(":")
- self.accounts[plugin][name] = {"password": pw, "options": {}, "valid": True}
-
- #--------------------------------------------------------------------------
- def saveAccounts(self):
- """save all account information"""
-
- f = open("accounts.conf", "wb")
- f.write("version: " + str(ACC_VERSION) + "\n")
-
- for plugin, accounts in self.accounts.iteritems():
- f.write("\n")
- f.write(plugin+":\n")
-
- for name,data in accounts.iteritems():
- f.write("\n\t%s:%s\n" % (name,data['password']) )
- if data['options']:
- for option, values in data['options'].iteritems():
- f.write("\t@%s %s\n" % (option, " ".join(values)))
-
- f.close()
- chmod(f.name, 0600)
-
- #--------------------------------------------------------------------------
- def initAccountPlugins(self):
- """init names"""
- for name in self.core.pluginManager.getAccountPlugins():
- self.accounts[name] = {}
-
- @lock
- def updateAccount(self, plugin , user, password=None, options={}):
- """add or update account"""
- if plugin in self.accounts:
- p = self.getAccountPlugin(plugin)
- updated = p.updateAccounts(user, password, options)
- #since accounts is a ref in plugin self.accounts doesnt need to be updated here
-
- self.saveAccounts()
- if updated: p.scheduleRefresh(user, force=False)
-
- @lock
- def removeAccount(self, plugin, user):
- """remove account"""
-
- if plugin in self.accounts:
- p = self.getAccountPlugin(plugin)
- p.removeAccount(user)
-
- self.saveAccounts()
-
- @lock
- def getAccountInfos(self, force=True, refresh=False):
- data = {}
-
- if refresh:
- self.core.scheduler.addJob(0, self.core.accountManager.getAccountInfos)
- force = False
-
- for p in self.accounts.keys():
- if self.accounts[p]:
- p = self.getAccountPlugin(p)
- if p:
- data[p.__name__] = p.getAllAccounts(force)
- else: # When an account has been skipped, p is None
- data[p] = []
- else:
- data[p] = []
- e = AccountUpdateEvent()
- self.core.pullManager.addEvent(e)
- return data
-
- def sendChange(self):
- e = AccountUpdateEvent()
- self.core.pullManager.addEvent(e)
diff --git a/pyload/plugins/PluginManager.py b/pyload/plugins/PluginManager.py
deleted file mode 100644
index be467b41a..000000000
--- a/pyload/plugins/PluginManager.py
+++ /dev/null
@@ -1,356 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import re
-import sys
-
-from itertools import chain
-from os import listdir, makedirs
-from os.path import isfile, join, exists, abspath
-from sys import version_info
-from traceback import print_exc
-
-from SafeEval import const_eval as literal_eval
-
-from pyload.ConfigParser import IGNORE
-
-
-class PluginManager:
- ROOT = "pyload.plugins."
- USERROOT = "userplugins."
- TYPES = ("accounts", "container", "crypter", "hooks", "hoster", "internal", "ocr")
-
- PATTERN = re.compile(r'__pattern__.*=.*r("|\')([^"\']+)')
- VERSION = re.compile(r'__version__.*=.*("|\')([0-9.]+)')
- CONFIG = re.compile(r'__config__.*=.*\[([^\]]+)', re.MULTILINE)
- DESC = re.compile(r'__description__.?=.?("|"""|\')([^"\']+)')
-
-
- def __init__(self, core):
- self.core = core
-
- self.config = core.config
- self.log = core.log
-
- self.plugins = {}
- self.createIndex()
-
- #register for import hook
- sys.meta_path.append(self)
-
-
- def createIndex(self):
- """create information for all plugins available"""
-
- sys.path.append(abspath(""))
-
- if not exists("userplugins"):
- makedirs("userplugins")
- if not exists(join("userplugins", "__init__.py")):
- f = open(join("userplugins", "__init__.py"), "wb")
- f.close()
-
- self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True)
- self.plugins['container'] = self.containerPlugins = self.parse("container", pattern=True)
- self.plugins['hoster'] = self.hosterPlugins = self.parse("hoster", pattern=True)
-
- self.plugins['ocr'] = self.captchaPlugins = self.parse("ocr")
- self.plugins['accounts'] = self.accountPlugins = self.parse("accounts")
- self.plugins['hooks'] = self.hookPlugins = self.parse("hooks")
- self.plugins['internal'] = self.internalPlugins = self.parse("internal")
-
- self.log.debug("created index of plugins")
-
- def parse(self, folder, pattern=False, home={}):
- """
- returns dict with information
- home contains parsed plugins from pyload.
-
- {
- name : {path, version, config, (pattern, re), (plugin, class)}
- }
-
- """
- plugins = {}
- if home:
- pfolder = join("userplugins", folder)
- if not exists(pfolder):
- makedirs(pfolder)
- if not exists(join(pfolder, "__init__.py")):
- f = open(join(pfolder, "__init__.py"), "wb")
- f.close()
-
- else:
- pfolder = join(pypath, "pyload", "plugins", folder)
-
- for f in listdir(pfolder):
- if (isfile(join(pfolder, f)) and f.endswith(".py") or f.endswith("_25.pyc") or f.endswith(
- "_26.pyc") or f.endswith("_27.pyc")) and not f.startswith("_"):
- data = open(join(pfolder, f))
- content = data.read()
- data.close()
-
- if f.endswith("_25.pyc") and version_info[0:2] != (2, 5):
- continue
- elif f.endswith("_26.pyc") and version_info[0:2] != (2, 6):
- continue
- elif f.endswith("_27.pyc") and version_info[0:2] != (2, 7):
- continue
-
- name = f[:-3]
- if name[-1] == ".": name = name[:-4]
-
- version = self.VERSION.findall(content)
- if version:
- version = float(version[0][1])
- else:
- version = 0
-
- # home contains plugins from pyload root
- if home and name in home:
- if home[name]['v'] >= version:
- continue
-
- if name in IGNORE or (folder, name) in IGNORE:
- continue
-
- plugins[name] = {}
- plugins[name]['v'] = version
-
- module = f.replace(".pyc", "").replace(".py", "")
-
- # the plugin is loaded from user directory
- plugins[name]['user'] = True if home else False
- plugins[name]['name'] = module
-
- if pattern:
- pattern = self.PATTERN.findall(content)
-
- if pattern:
- pattern = pattern[0][1]
- else:
- pattern = "^unmachtable$"
-
- plugins[name]['pattern'] = pattern
-
- try:
- plugins[name]['re'] = re.compile(pattern)
- except:
- self.log.error(_("%s has a invalid pattern.") % name)
-
-
- # internals have no config
- if folder == "internal":
- self.config.deleteConfig(name)
- continue
-
- config = self.CONFIG.findall(content)
- if config:
- config = literal_eval(config[0].strip().replace("\n", "").replace("\r", ""))
- desc = self.DESC.findall(content)
- desc = desc[0][1] if desc else ""
-
- if type(config[0]) == tuple:
- config = [list(x) for x in config]
- else:
- config = [list(config)]
-
- if folder == "hooks":
- append = True
- for item in config:
- if item[0] == "activated": append = False
-
- # activated flag missing
- if append: config.append(["activated", "bool", "Activated", False])
-
- try:
- self.config.addPluginConfig(name, config, desc)
- except:
- self.log.error("Invalid config in %s: %s" % (name, config))
-
- elif folder == "hooks": #force config creation
- desc = self.DESC.findall(content)
- desc = desc[0][1] if desc else ""
- config = (["activated", "bool", "Activated", False],)
-
- try:
- self.config.addPluginConfig(name, config, desc)
- except:
- self.log.error("Invalid config in %s: %s" % (name, config))
-
- if not home:
- temp = self.parse(folder, pattern, plugins)
- plugins.update(temp)
-
- return plugins
-
-
- def parseUrls(self, urls):
- """parse plugins for given list of urls"""
-
- last = None
- res = [] # tupels of (url, plugin)
-
- for url in urls:
- if type(url) not in (str, unicode, buffer): continue
- found = False
-
- if last and last[1]['re'].match(url):
- res.append((url, last[0]))
- continue
-
- for name, value in chain(self.crypterPlugins.iteritems(), self.hosterPlugins.iteritems(),
- self.containerPlugins.iteritems()):
- if value['re'].match(url):
- res.append((url, name))
- last = (name, value)
- found = True
- break
-
- if not found:
- res.append((url, "BasePlugin"))
-
- return res
-
- def findPlugin(self, name, pluginlist=("hoster", "crypter", "container")):
- for ptype in pluginlist:
- if name in self.plugins[ptype]:
- return self.plugins[ptype][name], ptype
- return None, None
-
- def getPlugin(self, name, original=False):
- """return plugin module from hoster|decrypter|container"""
- plugin, type = self.findPlugin(name)
-
- if not plugin:
- self.log.warning("Plugin %s not found." % name)
- plugin = self.hosterPlugins['BasePlugin']
-
- if "new_module" in plugin and not original:
- return plugin['new_module']
-
- return self.loadModule(type, name)
-
- def getPluginName(self, name):
- """ used to obtain new name if other plugin was injected"""
- plugin, type = self.findPlugin(name)
-
- if "new_name" in plugin:
- return plugin['new_name']
-
- return name
-
- def loadModule(self, type, name):
- """ Returns loaded module for plugin
-
- :param type: plugin type, subfolder of pyload.plugins
- :param name:
- """
- plugins = self.plugins[type]
- if name in plugins:
- if "module" in plugins[name]: return plugins[name]['module']
- try:
- module = __import__(self.ROOT + "%s.%s" % (type, plugins[name]['name']), globals(), locals(),
- plugins[name]['name'])
- plugins[name]['module'] = module #cache import, maybe unneeded
- return module
- except Exception, e:
- self.log.error(_("Error importing %(name)s: %(msg)s") % {"name": name, "msg": str(e)})
- if self.core.debug:
- print_exc()
-
- def loadClass(self, type, name):
- """Returns the class of a plugin with the same name"""
- module = self.loadModule(type, name)
- if module: return getattr(module, name)
-
- def getAccountPlugins(self):
- """return list of account plugin names"""
- return self.accountPlugins.keys()
-
- def find_module(self, fullname, path=None):
- #redirecting imports if necesarry
- if fullname.startswith(self.ROOT) or fullname.startswith(self.USERROOT): #seperate pyload plugins
- if fullname.startswith(self.USERROOT): user = 1
- else: user = 0 #used as bool and int
-
- split = fullname.split(".")
- if len(split) != 4 - user: return
- type, name = split[2 - user:4 - user]
-
- if type in self.plugins and name in self.plugins[type]:
- #userplugin is a newer version
- if not user and self.plugins[type][name]['user']:
- return self
- #imported from userdir, but pyloads is newer
- if user and not self.plugins[type][name]['user']:
- return self
-
-
- def load_module(self, name, replace=True):
- if name not in sys.modules: #could be already in modules
- if replace:
- if self.ROOT in name:
- newname = name.replace(self.ROOT, self.USERROOT)
- else:
- newname = name.replace(self.USERROOT, self.ROOT)
- else: newname = name
-
- base, plugin = newname.rsplit(".", 1)
-
- self.log.debug("Redirected import %s -> %s" % (name, newname))
-
- module = __import__(newname, globals(), locals(), [plugin])
- #inject under new an old name
- sys.modules[name] = module
- sys.modules[newname] = module
-
- return sys.modules[name]
-
-
- def reloadPlugins(self, type_plugins):
- """ reload and reindex plugins """
- if not type_plugins:
- return None
-
- self.log.debug("Request reload of plugins: %s" % type_plugins)
-
- reloaded = []
-
- as_dict = {}
- for t,n in type_plugins:
- if t in ("hooks", "internal"): #: do not reload hooks or internals, because would cause to much side effects
- continue
- elif t in as_dict:
- as_dict[t].append(n)
- else:
- as_dict[t] = [n]
-
- for type in as_dict.iterkeys():
- for plugin in as_dict[type]:
- if plugin in self.plugins[type] and "module" in self.plugins[type][plugin]:
- self.log.debug("Reloading %s" % plugin)
- id = (type, plugin)
- try:
- reload(self.plugins[type][plugin]['module'])
- except Exception, e:
- self.log.error("Error when reloading %s" % id, str(e))
- continue
- else:
- reloaded.append(id)
-
- #index creation
- self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True)
- self.plugins['container'] = self.containerPlugins = self.parse("container", pattern=True)
- self.plugins['hoster'] = self.hosterPlugins = self.parse("hoster", pattern=True)
- self.plugins['ocr'] = self.captchaPlugins = self.parse("ocr")
- self.plugins['accounts'] = self.accountPlugins = self.parse("accounts")
-
- if "accounts" in as_dict: #: accounts needs to be reloaded
- self.core.accountManager.initPlugins()
- self.core.scheduler.addJob(0, self.core.accountManager.getAccountInfos)
-
- return reloaded #: return a list of the plugins successfully reloaded
-
- def reloadPlugin(self, type_plugin):
- """ reload and reindex ONE plugin """
- return True if self.reloadPlugins(type_plugin) else False
diff --git a/pyload/plugins/accounts/BayfilesCom.py b/pyload/plugins/accounts/BayfilesCom.py
index a42ac6457..38537da0e 100644
--- a/pyload/plugins/accounts/BayfilesCom.py
+++ b/pyload/plugins/accounts/BayfilesCom.py
@@ -3,7 +3,7 @@
from time import time
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class BayfilesCom(Account):
diff --git a/pyload/plugins/accounts/FastixRu.py b/pyload/plugins/accounts/FastixRu.py
index a7b939a2c..69840fa2c 100644
--- a/pyload/plugins/accounts/FastixRu.py
+++ b/pyload/plugins/accounts/FastixRu.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class FastixRu(Account):
diff --git a/pyload/plugins/accounts/FilecloudIo.py b/pyload/plugins/accounts/FilecloudIo.py
index 5e6b001e8..dc764d218 100644
--- a/pyload/plugins/accounts/FilecloudIo.py
+++ b/pyload/plugins/accounts/FilecloudIo.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class FilecloudIo(Account):
diff --git a/pyload/plugins/accounts/FileserveCom.py b/pyload/plugins/accounts/FileserveCom.py
index 211023991..99f4430c2 100644
--- a/pyload/plugins/accounts/FileserveCom.py
+++ b/pyload/plugins/accounts/FileserveCom.py
@@ -3,7 +3,7 @@
from time import mktime, strptime
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class FileserveCom(Account):
diff --git a/pyload/plugins/accounts/FourSharedCom.py b/pyload/plugins/accounts/FourSharedCom.py
index a62749c43..217bd2874 100644
--- a/pyload/plugins/accounts/FourSharedCom.py
+++ b/pyload/plugins/accounts/FourSharedCom.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class FourSharedCom(Account):
diff --git a/pyload/plugins/accounts/FreeWayMe.py b/pyload/plugins/accounts/FreeWayMe.py
index baca53cd4..5106067a9 100644
--- a/pyload/plugins/accounts/FreeWayMe.py
+++ b/pyload/plugins/accounts/FreeWayMe.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class FreeWayMe(Account):
diff --git a/pyload/plugins/accounts/LetitbitNet.py b/pyload/plugins/accounts/LetitbitNet.py
index 88e679f8e..bce97d378 100644
--- a/pyload/plugins/accounts/LetitbitNet.py
+++ b/pyload/plugins/accounts/LetitbitNet.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Account import Account
-# from pyload.common.json_layer import json_loads, json_dumps
+# from pyload.utils import json_loads, json_dumps
class LetitbitNet(Account):
diff --git a/pyload/plugins/accounts/LinksnappyCom.py b/pyload/plugins/accounts/LinksnappyCom.py
index 4ac046988..35fc881b0 100644
--- a/pyload/plugins/accounts/LinksnappyCom.py
+++ b/pyload/plugins/accounts/LinksnappyCom.py
@@ -3,7 +3,7 @@
from hashlib import md5
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class LinksnappyCom(Account):
diff --git a/pyload/plugins/accounts/MegaDebridEu.py b/pyload/plugins/accounts/MegaDebridEu.py
index b449d7246..5ba8d3577 100644
--- a/pyload/plugins/accounts/MegaDebridEu.py
+++ b/pyload/plugins/accounts/MegaDebridEu.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class MegaDebridEu(Account):
diff --git a/pyload/plugins/accounts/MultiDebridCom.py b/pyload/plugins/accounts/MultiDebridCom.py
index fa10c92cc..cca6a9849 100644
--- a/pyload/plugins/accounts/MultiDebridCom.py
+++ b/pyload/plugins/accounts/MultiDebridCom.py
@@ -3,7 +3,7 @@
from time import time
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class MultiDebridCom(Account):
diff --git a/pyload/plugins/accounts/OboomCom.py b/pyload/plugins/accounts/OboomCom.py
index 3ef6f9d58..b281a289a 100644
--- a/pyload/plugins/accounts/OboomCom.py
+++ b/pyload/plugins/accounts/OboomCom.py
@@ -4,7 +4,7 @@ import time
from beaker.crypto.pbkdf2 import PBKDF2
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Account import Account
diff --git a/pyload/plugins/accounts/OverLoadMe.py b/pyload/plugins/accounts/OverLoadMe.py
index ba5a58158..18a3db645 100644
--- a/pyload/plugins/accounts/OverLoadMe.py
+++ b/pyload/plugins/accounts/OverLoadMe.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class OverLoadMe(Account):
diff --git a/pyload/plugins/accounts/PremiumizeMe.py b/pyload/plugins/accounts/PremiumizeMe.py
index 822ca8db9..ecb03afda 100644
--- a/pyload/plugins/accounts/PremiumizeMe.py
+++ b/pyload/plugins/accounts/PremiumizeMe.py
@@ -2,7 +2,7 @@
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class PremiumizeMe(Account):
diff --git a/pyload/plugins/accounts/RPNetBiz.py b/pyload/plugins/accounts/RPNetBiz.py
index 0e600b4e3..c2b7cad21 100644
--- a/pyload/plugins/accounts/RPNetBiz.py
+++ b/pyload/plugins/accounts/RPNetBiz.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class RPNetBiz(Account):
diff --git a/pyload/plugins/accounts/RapidgatorNet.py b/pyload/plugins/accounts/RapidgatorNet.py
index 391d7ffcb..c8f129c5b 100644
--- a/pyload/plugins/accounts/RapidgatorNet.py
+++ b/pyload/plugins/accounts/RapidgatorNet.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class RapidgatorNet(Account):
diff --git a/pyload/plugins/accounts/SimplyPremiumCom.py b/pyload/plugins/accounts/SimplyPremiumCom.py
index 5958c1f34..3a385c477 100644
--- a/pyload/plugins/accounts/SimplyPremiumCom.py
+++ b/pyload/plugins/accounts/SimplyPremiumCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Account import Account
diff --git a/pyload/plugins/accounts/UnrestrictLi.py b/pyload/plugins/accounts/UnrestrictLi.py
index 39a75f959..6e878b556 100644
--- a/pyload/plugins/accounts/UnrestrictLi.py
+++ b/pyload/plugins/accounts/UnrestrictLi.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Account import Account
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class UnrestrictLi(Account):
diff --git a/pyload/plugins/crypter/DailymotionBatch.py b/pyload/plugins/crypter/DailymotionBatch.py
index d44350c6b..2c818d8bc 100644
--- a/pyload/plugins/crypter/DailymotionBatch.py
+++ b/pyload/plugins/crypter/DailymotionBatch.py
@@ -4,7 +4,7 @@ import re
from urlparse import urljoin
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Crypter import Crypter
from pyload.utils import safe_join
diff --git a/pyload/plugins/crypter/GooGl.py b/pyload/plugins/crypter/GooGl.py
index ae48c61b5..93f3456cc 100644
--- a/pyload/plugins/crypter/GooGl.py
+++ b/pyload/plugins/crypter/GooGl.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from pyload.plugins.Crypter import Crypter
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class GooGl(Crypter):
diff --git a/pyload/plugins/crypter/LinkSaveIn.py b/pyload/plugins/crypter/LinkSaveIn.py
index 84dd8172e..4a56606c8 100644
--- a/pyload/plugins/crypter/LinkSaveIn.py
+++ b/pyload/plugins/crypter/LinkSaveIn.py
@@ -9,7 +9,7 @@ import re
from Crypto.Cipher import AES
from pyload.plugins.Crypter import Crypter
-from pyload.unescape import unescape
+from pyload.utils import html_unescape
class LinkSaveIn(Crypter):
@@ -153,7 +153,7 @@ class LinkSaveIn(Crypter):
dlLink = re.search(r'http://linksave\.in/dl-\w+', jseval).group(0)
self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink)
response = self.load(dlLink)
- link = unescape(re.search(r'<iframe src="(.+?)"', response).group(1))
+ link = html_unescape(re.search(r'<iframe src="(.+?)"', response).group(1))
package_links.append(link)
except Exception, detail:
self.logDebug("Error decrypting Web link %s, %s" % (webLink, detail))
@@ -169,7 +169,7 @@ class LinkSaveIn(Crypter):
containersLinks = re.findall(pattern, self.html)
self.logDebug("Found %d %s Container links" % (len(containersLinks), type_.upper()))
for containerLink in containersLinks:
- link = "http://linksave.in/%s" % unescape(containerLink)
+ link = "http://linksave.in/%s" % html_unescape(containerLink)
package_links.append(link)
return package_links
diff --git a/pyload/plugins/crypter/MediafireComFolder.py b/pyload/plugins/crypter/MediafireComFolder.py
index 4ea904e89..98c05f450 100644
--- a/pyload/plugins/crypter/MediafireComFolder.py
+++ b/pyload/plugins/crypter/MediafireComFolder.py
@@ -3,7 +3,7 @@
import re
from pyload.plugins.Crypter import Crypter
from pyload.plugins.hoster.MediafireCom import checkHTMLHeader
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class MediafireComFolder(Crypter):
diff --git a/pyload/plugins/crypter/MultiuploadCom.py b/pyload/plugins/crypter/MultiuploadCom.py
index 5aa77e5f5..b1650b647 100644
--- a/pyload/plugins/crypter/MultiuploadCom.py
+++ b/pyload/plugins/crypter/MultiuploadCom.py
@@ -4,7 +4,7 @@ import re
from time import time
from pyload.plugins.Crypter import Crypter
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class MultiuploadCom(Crypter):
diff --git a/pyload/plugins/crypter/OneKhDe.py b/pyload/plugins/crypter/OneKhDe.py
index 320eaf6c6..4f3ab2a20 100644
--- a/pyload/plugins/crypter/OneKhDe.py
+++ b/pyload/plugins/crypter/OneKhDe.py
@@ -2,7 +2,7 @@
import re
-from pyload.unescape import unescape
+from pyload.utils import html_unescape
from pyload.plugins.Crypter import Crypter
@@ -33,6 +33,6 @@ class OneKhDe(Crypter):
self.html = self.req.load(url)
link_ids = re.findall(r"<a id=\"DownloadLink_(\d*)\" href=\"http://1kh.de/", self.html)
for id in link_ids:
- new_link = unescape(
+ new_link = html_unescape(
re.search("width=\"100%\" src=\"(.*)\"></iframe>", self.req.load("http://1kh.de/l/" + id)).group(1))
self.urls.append(new_link)
diff --git a/pyload/plugins/crypter/SafelinkingNet.py b/pyload/plugins/crypter/SafelinkingNet.py
index 543fb32fb..9c68ba915 100644
--- a/pyload/plugins/crypter/SafelinkingNet.py
+++ b/pyload/plugins/crypter/SafelinkingNet.py
@@ -6,7 +6,7 @@ from pycurl import FOLLOWLOCATION
from BeautifulSoup import BeautifulSoup
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Crypter import Crypter
from pyload.plugins.internal.CaptchaService import SolveMedia
diff --git a/pyload/plugins/crypter/SerienjunkiesOrg.py b/pyload/plugins/crypter/SerienjunkiesOrg.py
index a1745c6c9..713086cb9 100644
--- a/pyload/plugins/crypter/SerienjunkiesOrg.py
+++ b/pyload/plugins/crypter/SerienjunkiesOrg.py
@@ -8,7 +8,7 @@ from time import sleep
from BeautifulSoup import BeautifulSoup
from pyload.plugins.Crypter import Crypter
-from pyload.unescape import unescape
+from pyload.utils import html_unescape
class SerienjunkiesOrg(Crypter):
@@ -48,7 +48,7 @@ class SerienjunkiesOrg(Crypter):
soup = BeautifulSoup(src)
packageName = self.pyfile.package().name
if self.getConfig("changeNameSJ") == "Show":
- found = unescape(soup.find("h2").find("a").string.split(' &#8211;')[0])
+ found = html_unescape(soup.find("h2").find("a").string.split(' &#8211;')[0])
if found:
packageName = found
@@ -71,7 +71,7 @@ class SerienjunkiesOrg(Crypter):
post = soup.find("div", attrs={"class": "post-content"})
ps = post.findAll("p")
- seasonName = unescape(soup.find("a", attrs={"rel": "bookmark"}).string).replace("&#8211;", "-")
+ seasonName = html_unescape(soup.find("a", attrs={"rel": "bookmark"}).string).replace("&#8211;", "-")
groups = {}
gid = -1
for p in ps:
@@ -79,7 +79,7 @@ class SerienjunkiesOrg(Crypter):
var = p.findAll("strong")
opts = {"Sprache": "", "Format": ""}
for v in var:
- n = unescape(v.string).strip()
+ n = html_unescape(v.string).strip()
n = re.sub(r"^([:]?)(.*?)([:]?)$", r'\2', n)
if n.strip() not in opts:
continue
@@ -198,7 +198,7 @@ class SerienjunkiesOrg(Crypter):
soup = BeautifulSoup(src)
post = soup.find("div", attrs={"id": "page_post"})
ps = post.findAll("p")
- found = unescape(soup.find("h2").find("a").string.split(' &#8211;')[0])
+ found = html_unescape(soup.find("h2").find("a").string.split(' &#8211;')[0])
if found:
seasonName = found
@@ -209,7 +209,7 @@ class SerienjunkiesOrg(Crypter):
var = p.findAll("strong")
opts = {"Sprache": "", "Format": ""}
for v in var:
- n = unescape(v.string).strip()
+ n = html_unescape(v.string).strip()
n = re.sub(r"^([:]?)(.*?)([:]?)$", r'\2', n)
if n.strip() not in opts:
continue
diff --git a/pyload/plugins/crypter/TurbobitNetFolder.py b/pyload/plugins/crypter/TurbobitNetFolder.py
index 48b28c28a..c7786b7be 100644
--- a/pyload/plugins/crypter/TurbobitNetFolder.py
+++ b/pyload/plugins/crypter/TurbobitNetFolder.py
@@ -3,7 +3,7 @@
import re
from pyload.plugins.internal.SimpleCrypter import SimpleCrypter
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class TurbobitNetFolder(SimpleCrypter):
diff --git a/pyload/plugins/crypter/YoutubeBatch.py b/pyload/plugins/crypter/YoutubeBatch.py
index 5b7cb6530..bc72e04ea 100644
--- a/pyload/plugins/crypter/YoutubeBatch.py
+++ b/pyload/plugins/crypter/YoutubeBatch.py
@@ -4,7 +4,7 @@ import re
from urlparse import urljoin
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Crypter import Crypter
from pyload.utils import safe_join
diff --git a/pyload/plugins/hooks/DeathByCaptcha.py b/pyload/plugins/hooks/DeathByCaptcha.py
index 57bf9031f..6db91b8c1 100644
--- a/pyload/plugins/hooks/DeathByCaptcha.py
+++ b/pyload/plugins/hooks/DeathByCaptcha.py
@@ -9,7 +9,7 @@ from pycurl import FORM_FILE, HTTPHEADER
from thread import start_new_thread
from time import sleep
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.HTTPRequest import BadHeader
from pyload.network.RequestFactory import getRequest
from pyload.plugins.Hook import Hook
diff --git a/pyload/plugins/hooks/FastixRu.py b/pyload/plugins/hooks/FastixRu.py
index 966bc6bd3..9e2abd92a 100644
--- a/pyload/plugins/hooks/FastixRu.py
+++ b/pyload/plugins/hooks/FastixRu.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.RequestFactory import getURL
from pyload.plugins.internal.MultiHoster import MultiHoster
diff --git a/pyload/plugins/hooks/IRCInterface.py b/pyload/plugins/hooks/IRCInterface.py
index af8d8fa69..ef1fa2a09 100644
--- a/pyload/plugins/hooks/IRCInterface.py
+++ b/pyload/plugins/hooks/IRCInterface.py
@@ -10,7 +10,7 @@ from threading import Thread
from time import sleep
from traceback import print_exc
-from pyload.Api import PackageDoesNotExists, FileDoesNotExists
+from pyload.api import PackageDoesNotExists, FileDoesNotExists
from pyload.network.RequestFactory import getURL
from pyload.plugins.Hook import Hook
from pyload.utils import formatSize
diff --git a/pyload/plugins/hooks/LinksnappyCom.py b/pyload/plugins/hooks/LinksnappyCom.py
index f662ae4e9..9086e3c2a 100644
--- a/pyload/plugins/hooks/LinksnappyCom.py
+++ b/pyload/plugins/hooks/LinksnappyCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.RequestFactory import getURL
from pyload.plugins.internal.MultiHoster import MultiHoster
diff --git a/pyload/plugins/hooks/MegaDebridEu.py b/pyload/plugins/hooks/MegaDebridEu.py
index da151f9aa..8c8894c9b 100644
--- a/pyload/plugins/hooks/MegaDebridEu.py
+++ b/pyload/plugins/hooks/MegaDebridEu.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.RequestFactory import getURL
from pyload.plugins.internal.MultiHoster import MultiHoster
diff --git a/pyload/plugins/hooks/MultiDebridCom.py b/pyload/plugins/hooks/MultiDebridCom.py
index 7d9b6526a..6aa5ba3eb 100644
--- a/pyload/plugins/hooks/MultiDebridCom.py
+++ b/pyload/plugins/hooks/MultiDebridCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.RequestFactory import getURL
from pyload.plugins.internal.MultiHoster import MultiHoster
diff --git a/pyload/plugins/hooks/PremiumizeMe.py b/pyload/plugins/hooks/PremiumizeMe.py
index 70bc4a0f2..b6d89adb6 100644
--- a/pyload/plugins/hooks/PremiumizeMe.py
+++ b/pyload/plugins/hooks/PremiumizeMe.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.RequestFactory import getURL
from pyload.plugins.internal.MultiHoster import MultiHoster
diff --git a/pyload/plugins/hooks/RPNetBiz.py b/pyload/plugins/hooks/RPNetBiz.py
index e119e6451..b46e326e6 100644
--- a/pyload/plugins/hooks/RPNetBiz.py
+++ b/pyload/plugins/hooks/RPNetBiz.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.RequestFactory import getURL
from pyload.plugins.internal.MultiHoster import MultiHoster
diff --git a/pyload/plugins/hooks/SimplyPremiumCom.py b/pyload/plugins/hooks/SimplyPremiumCom.py
index 8e9bc5e1e..f0df36b22 100644
--- a/pyload/plugins/hooks/SimplyPremiumCom.py
+++ b/pyload/plugins/hooks/SimplyPremiumCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.RequestFactory import getURL
from pyload.plugins.internal.MultiHoster import MultiHoster
diff --git a/pyload/plugins/hooks/UnSkipOnFail.py b/pyload/plugins/hooks/UnSkipOnFail.py
index fd3b35a0a..941ce4fc7 100644
--- a/pyload/plugins/hooks/UnSkipOnFail.py
+++ b/pyload/plugins/hooks/UnSkipOnFail.py
@@ -2,7 +2,7 @@
from os.path import basename
-from pyload.PyFile import PyFile
+from pyload.datatypes.PyFile import PyFile
from pyload.plugins.Hook import Hook
from pyload.utils import fs_encode
diff --git a/pyload/plugins/hooks/UnrestrictLi.py b/pyload/plugins/hooks/UnrestrictLi.py
index 1562bdf24..2ca5ad907 100644
--- a/pyload/plugins/hooks/UnrestrictLi.py
+++ b/pyload/plugins/hooks/UnrestrictLi.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.RequestFactory import getURL
from pyload.plugins.internal.MultiHoster import MultiHoster
diff --git a/pyload/plugins/hoster/AlldebridCom.py b/pyload/plugins/hoster/AlldebridCom.py
index 1b115f19e..bdb5b1599 100644
--- a/pyload/plugins/hoster/AlldebridCom.py
+++ b/pyload/plugins/hoster/AlldebridCom.py
@@ -5,7 +5,7 @@ import re
from random import randrange
from urllib import unquote
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Hoster import Hoster
from pyload.utils import parseFileSize
diff --git a/pyload/plugins/hoster/BayfilesCom.py b/pyload/plugins/hoster/BayfilesCom.py
index ea4bd3ca5..5906ade75 100644
--- a/pyload/plugins/hoster/BayfilesCom.py
+++ b/pyload/plugins/hoster/BayfilesCom.py
@@ -4,7 +4,7 @@ import re
from time import time
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
diff --git a/pyload/plugins/hoster/DailymotionCom.py b/pyload/plugins/hoster/DailymotionCom.py
index 0ae4c697b..5692fa652 100644
--- a/pyload/plugins/hoster/DailymotionCom.py
+++ b/pyload/plugins/hoster/DailymotionCom.py
@@ -2,8 +2,8 @@
import re
-from pyload.PyFile import statusMap
-from pyload.common.json_layer import json_loads
+from pyload.datatypes.PyFile import statusMap
+from pyload.utils import json_loads
from pyload.network.RequestFactory import getURL
from pyload.plugins.Hoster import Hoster
diff --git a/pyload/plugins/hoster/DlFreeFr.py b/pyload/plugins/hoster/DlFreeFr.py
index 387e11efc..0365754bc 100644
--- a/pyload/plugins/hoster/DlFreeFr.py
+++ b/pyload/plugins/hoster/DlFreeFr.py
@@ -3,7 +3,7 @@
import pycurl
import re
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.Browser import Browser
from pyload.network.CookieJar import CookieJar
from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns
diff --git a/pyload/plugins/hoster/ExtabitCom.py b/pyload/plugins/hoster/ExtabitCom.py
index 38479410e..78172ef02 100644
--- a/pyload/plugins/hoster/ExtabitCom.py
+++ b/pyload/plugins/hoster/ExtabitCom.py
@@ -2,7 +2,7 @@
import re
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.hoster.UnrestrictLi import secondsToMidnight
from pyload.plugins.internal.CaptchaService import ReCaptcha
diff --git a/pyload/plugins/hoster/FastixRu.py b/pyload/plugins/hoster/FastixRu.py
index e031e3e55..aa1794047 100644
--- a/pyload/plugins/hoster/FastixRu.py
+++ b/pyload/plugins/hoster/FastixRu.py
@@ -5,7 +5,7 @@ import re
from random import randrange
from urllib import unquote
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Hoster import Hoster
diff --git a/pyload/plugins/hoster/FilecloudIo.py b/pyload/plugins/hoster/FilecloudIo.py
index 05753a67e..9cf9306d1 100644
--- a/pyload/plugins/hoster/FilecloudIo.py
+++ b/pyload/plugins/hoster/FilecloudIo.py
@@ -2,7 +2,7 @@
import re
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.internal.CaptchaService import ReCaptcha
from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
diff --git a/pyload/plugins/hoster/FilepostCom.py b/pyload/plugins/hoster/FilepostCom.py
index ac2ae4845..382971c61 100644
--- a/pyload/plugins/hoster/FilepostCom.py
+++ b/pyload/plugins/hoster/FilepostCom.py
@@ -4,7 +4,7 @@ import re
from time import time
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.internal.CaptchaService import ReCaptcha
from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
diff --git a/pyload/plugins/hoster/FileserveCom.py b/pyload/plugins/hoster/FileserveCom.py
index 15830b759..5892cd96a 100644
--- a/pyload/plugins/hoster/FileserveCom.py
+++ b/pyload/plugins/hoster/FileserveCom.py
@@ -2,7 +2,7 @@
import re
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.RequestFactory import getURL
from pyload.plugins.Hoster import Hoster
from pyload.plugins.Plugin import chunks
diff --git a/pyload/plugins/hoster/IfileIt.py b/pyload/plugins/hoster/IfileIt.py
index 2707edd5a..fc26e2f23 100644
--- a/pyload/plugins/hoster/IfileIt.py
+++ b/pyload/plugins/hoster/IfileIt.py
@@ -2,7 +2,7 @@
import re
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.internal.CaptchaService import ReCaptcha
from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
diff --git a/pyload/plugins/hoster/LetitbitNet.py b/pyload/plugins/hoster/LetitbitNet.py
index 3a8e28a90..a28f06571 100644
--- a/pyload/plugins/hoster/LetitbitNet.py
+++ b/pyload/plugins/hoster/LetitbitNet.py
@@ -10,7 +10,7 @@ import re
from urllib import urlencode, urlopen
-from pyload.common.json_layer import json_loads, json_dumps
+from pyload.utils import json_loads, json_dumps
from pyload.plugins.hoster.UnrestrictLi import secondsToMidnight
from pyload.plugins.internal.CaptchaService import ReCaptcha
from pyload.plugins.internal.SimpleHoster import SimpleHoster
diff --git a/pyload/plugins/hoster/LinksnappyCom.py b/pyload/plugins/hoster/LinksnappyCom.py
index aed74d09b..e7cc61391 100644
--- a/pyload/plugins/hoster/LinksnappyCom.py
+++ b/pyload/plugins/hoster/LinksnappyCom.py
@@ -4,7 +4,7 @@ import re
from urlparse import urlsplit
-from pyload.common.json_layer import json_loads, json_dumps
+from pyload.utils import json_loads, json_dumps
from pyload.plugins.Hoster import Hoster
diff --git a/pyload/plugins/hoster/MegaDebridEu.py b/pyload/plugins/hoster/MegaDebridEu.py
index 6c980009e..ed3747aed 100644
--- a/pyload/plugins/hoster/MegaDebridEu.py
+++ b/pyload/plugins/hoster/MegaDebridEu.py
@@ -4,7 +4,7 @@ import re
from urllib import unquote_plus
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Hoster import Hoster
diff --git a/pyload/plugins/hoster/MegaNz.py b/pyload/plugins/hoster/MegaNz.py
index 801df9c9d..2e70b5dc6 100644
--- a/pyload/plugins/hoster/MegaNz.py
+++ b/pyload/plugins/hoster/MegaNz.py
@@ -9,7 +9,7 @@ from array import array
from base64 import standard_b64decode
from os import remove
-from pyload.common.json_layer import json_loads, json_dumps
+from pyload.utils import json_loads, json_dumps
from pyload.plugins.Hoster import Hoster
diff --git a/pyload/plugins/hoster/MegacrypterCom.py b/pyload/plugins/hoster/MegacrypterCom.py
index 0cc17bfe3..cdc019fdf 100644
--- a/pyload/plugins/hoster/MegacrypterCom.py
+++ b/pyload/plugins/hoster/MegacrypterCom.py
@@ -2,7 +2,7 @@
import re
-from pyload.common.json_layer import json_loads, json_dumps
+from pyload.utils import json_loads, json_dumps
from pyload.plugins.hoster.MegaNz import MegaNz
diff --git a/pyload/plugins/hoster/MultiDebridCom.py b/pyload/plugins/hoster/MultiDebridCom.py
index 765022eef..bd7d9460c 100644
--- a/pyload/plugins/hoster/MultiDebridCom.py
+++ b/pyload/plugins/hoster/MultiDebridCom.py
@@ -2,7 +2,7 @@
import re
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Hoster import Hoster
diff --git a/pyload/plugins/hoster/MyvideoDe.py b/pyload/plugins/hoster/MyvideoDe.py
index 4ce75b4a2..06cfb9c63 100644
--- a/pyload/plugins/hoster/MyvideoDe.py
+++ b/pyload/plugins/hoster/MyvideoDe.py
@@ -3,7 +3,7 @@
import re
from pyload.plugins.Hoster import Hoster
-from pyload.unescape import unescape
+from pyload.utils import html_unescape
class MyvideoDe(Hoster):
@@ -35,7 +35,7 @@ class MyvideoDe(Hoster):
def get_file_name(self):
file_name_pattern = r"<h1 class='globalHd'>(.*)</h1>"
- return unescape(re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv')
+ return html_unescape(re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv')
def file_exists(self):
self.download_html()
diff --git a/pyload/plugins/hoster/OboomCom.py b/pyload/plugins/hoster/OboomCom.py
index 04efa31b7..8c0d9d760 100644
--- a/pyload/plugins/hoster/OboomCom.py
+++ b/pyload/plugins/hoster/OboomCom.py
@@ -5,7 +5,7 @@
import re
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Hoster import Hoster
from pyload.plugins.internal.CaptchaService import ReCaptcha
diff --git a/pyload/plugins/hoster/OverLoadMe.py b/pyload/plugins/hoster/OverLoadMe.py
index 8061b2e1d..e27972fc2 100644
--- a/pyload/plugins/hoster/OverLoadMe.py
+++ b/pyload/plugins/hoster/OverLoadMe.py
@@ -5,7 +5,7 @@ import re
from random import randrange
from urllib import unquote
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Hoster import Hoster
from pyload.utils import parseFileSize
diff --git a/pyload/plugins/hoster/PremiumizeMe.py b/pyload/plugins/hoster/PremiumizeMe.py
index 16649f492..45c011084 100644
--- a/pyload/plugins/hoster/PremiumizeMe.py
+++ b/pyload/plugins/hoster/PremiumizeMe.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Hoster import Hoster
diff --git a/pyload/plugins/hoster/RPNetBiz.py b/pyload/plugins/hoster/RPNetBiz.py
index e305c35ce..8a7bec097 100644
--- a/pyload/plugins/hoster/RPNetBiz.py
+++ b/pyload/plugins/hoster/RPNetBiz.py
@@ -3,7 +3,7 @@
import re
from pyload.plugins.Hoster import Hoster
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
class RPNetBiz(Hoster):
diff --git a/pyload/plugins/hoster/RapidgatorNet.py b/pyload/plugins/hoster/RapidgatorNet.py
index 46fe285b7..cc13f7097 100644
--- a/pyload/plugins/hoster/RapidgatorNet.py
+++ b/pyload/plugins/hoster/RapidgatorNet.py
@@ -4,7 +4,7 @@ import re
from pycurl import HTTPHEADER
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.network.HTTPRequest import BadHeader
from pyload.plugins.hoster.UnrestrictLi import secondsToMidnight
from pyload.plugins.internal.CaptchaService import AdsCaptcha, ReCaptcha, SolveMedia
diff --git a/pyload/plugins/hoster/RealdebridCom.py b/pyload/plugins/hoster/RealdebridCom.py
index a458cc5d0..08f7b9329 100644
--- a/pyload/plugins/hoster/RealdebridCom.py
+++ b/pyload/plugins/hoster/RealdebridCom.py
@@ -6,7 +6,7 @@ from random import randrange
from urllib import quote, unquote
from time import time
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Hoster import Hoster
from pyload.utils import parseFileSize
diff --git a/pyload/plugins/hoster/RedtubeCom.py b/pyload/plugins/hoster/RedtubeCom.py
index 42c24628e..9f5d2d0d9 100644
--- a/pyload/plugins/hoster/RedtubeCom.py
+++ b/pyload/plugins/hoster/RedtubeCom.py
@@ -3,7 +3,7 @@
import re
from pyload.plugins.Hoster import Hoster
-from pyload.unescape import unescape
+from pyload.utils import html_unescape
class RedtubeCom(Hoster):
@@ -36,7 +36,7 @@ class RedtubeCom(Hoster):
if not self.html:
self.download_html()
- file_url = unescape(re.search(r'hashlink=(http.*?)"', self.html).group(1))
+ file_url = html_unescape(re.search(r'hashlink=(http.*?)"', self.html).group(1))
return file_url
diff --git a/pyload/plugins/hoster/UlozTo.py b/pyload/plugins/hoster/UlozTo.py
index 2f1fdc595..c3957aaa0 100644
--- a/pyload/plugins/hoster/UlozTo.py
+++ b/pyload/plugins/hoster/UlozTo.py
@@ -3,7 +3,7 @@
import re
import time
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
diff --git a/pyload/plugins/hoster/UnrestrictLi.py b/pyload/plugins/hoster/UnrestrictLi.py
index 2cad6616f..c0c1e3965 100644
--- a/pyload/plugins/hoster/UnrestrictLi.py
+++ b/pyload/plugins/hoster/UnrestrictLi.py
@@ -4,7 +4,7 @@ import re
from datetime import datetime, timedelta
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Hoster import Hoster
diff --git a/pyload/plugins/hoster/UploadingCom.py b/pyload/plugins/hoster/UploadingCom.py
index a7c328eec..882cb863f 100644
--- a/pyload/plugins/hoster/UploadingCom.py
+++ b/pyload/plugins/hoster/UploadingCom.py
@@ -4,7 +4,7 @@ import re
from pycurl import HTTPHEADER
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp
diff --git a/pyload/plugins/hoster/XHamsterCom.py b/pyload/plugins/hoster/XHamsterCom.py
index 0afb94b74..aa406cc45 100644
--- a/pyload/plugins/hoster/XHamsterCom.py
+++ b/pyload/plugins/hoster/XHamsterCom.py
@@ -4,7 +4,7 @@ import re
from urllib import unquote
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.Hoster import Hoster
diff --git a/pyload/plugins/hoster/YibaishiwuCom.py b/pyload/plugins/hoster/YibaishiwuCom.py
index b6d06d234..24cd0e9fc 100644
--- a/pyload/plugins/hoster/YibaishiwuCom.py
+++ b/pyload/plugins/hoster/YibaishiwuCom.py
@@ -2,7 +2,7 @@
import re
-from pyload.common.json_layer import json_loads
+from pyload.utils import json_loads
from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo