# Path: module/plugins/internal/misc.py
# class misc(object):
# class Config(object):
# class DB(object):
# class Expose(object):
# class Periodical(object):
# class SimpleQueue(object):
#     def __init__(self, plugin):
#     def set(self, option, value, plugin=None):
#     def get(self, option, default=None, plugin=None):
#     def __init__(self, plugin):
#     def store(self, key, value):
#     def retrieve(self, key=None, default=None):
#     def delete(self, key):
#     def __new__(cls, fn, *args, **kwargs):
#     def __init__(self, plugin, task=lambda x: x, interval=None):
#     def set_interval(self, value):
#     def start(self, interval=None, threaded=False, delay=0):
#     def restart(self, *args, **kwargs):
#     def stop(self):
#     def _task(self, threaded):
#     def __init__(self, plugin, storage="queue"):
#     def get(self):
#     def set(self, value):
#     def delete(self):
#     def add(self, item):
#     def remove(self, item):
# def lock(fn):
#     def new(*args, **kwargs):
# def threaded(fn):
#     def run(*args, **kwargs):
# def format_time(value):
# def format_size(value):
# def compare_time(start, end):
# def free_space(folder):
# def fsbsize(path):
# def uniqify(seq):
# def has_method(obj, name):
# def html_unescape(text):
# def isiterable(obj):
# def get_console_encoding(enc):
# def normalize(value):
# def decode(value, encoding=None, errors='strict'):
# def transcode(value, decoding, encoding):
# def encode(value, encoding='utf-8', errors='backslashreplace'):
# def exists(path):
# def remove(path, trash=True):
# def fsjoin(*args):
# def remove_chars(value, repl):
# def fixurl(url, unquote=None):
# def truncate(name, length):
# def safepath(value):
# def safejoin(*args):
# def safename(value):
# def parse_name(value, safechar=True):
# def parse_size(value, unit=""):  #: returns bytes
# def str2int(value):
# def parse_time(value):
# def timestamp():
# def check_module(module):
# def check_prog(command):
# def isexecutable(filename):
# def which(filename):
# def format_exc(frame=None):
# def seconds_to_nexthour(strict=False):
# def seconds_to_midnight(utc=None, strict=False):
# def replace_patterns(value, rules):
# def set_cookie(cj, domain, name, value, path='/',
#                exp=time.time() + 180 * 24 * 3600):
# def set_cookies(cj, cookies):
# def parse_html_header(header):
# def parse_html_tag_attr_value(attr_name, tag):
# def parse_html_form(attr_str, html, input_names={}):
# def chunks(iterable, size):
# def renice(pid, value):
# def forward(source, destination):
# def compute_checksum(filename, hashtype):
# def copy_tree(src, dst, overwrite=False, preserve_metadata=False):
# def move_tree(src, dst, overwrite=False):


import pycurl
from module.network.HTTPRequest import BadHeader
from ..internal.misc import encode, json, reduce
from ..internal.MultiAccount import MultiAccount

        if hosters['response_code'] == "ok":
            return reduce((lambda x, y: x + y), hosters['hosters'])

        else:
            self.log_error(_("Unable to retrieve hoster list"))
            return []

    def grab_info(self, user, password, data):
        validuntil = None
        trafficleft = None
        premium = False

        res = self.api_response(
            "connectUser", args(
                login=user, password=password))

        if res['response_code'] == "ok":
            validuntil = float(res['vip_end'])
            premium = validuntil > 0
            trafficleft = -1

        else:
            self.log_error(res['response_text'])

        data['token'] = res['token']

        return {'validuntil': validuntil,
                'trafficleft': trafficleft, 'premium': premium}


# Path: module/plugins/internal/misc.py
# class misc(object):
# class Config(object):
# class DB(object):
# class Expose(object):
# class Periodical(object):
# class SimpleQueue(object):
#     def __init__(self, plugin):
#     def set(self, option, value, plugin=None):
#     def get(self, option, default=None, plugin=None):
#     def __init__(self, plugin):
#     def store(self, key, value):
#     def retrieve(self, key=None, default=None):
#     def delete(self, key):
#     def __new__(cls, fn, *args, **kwargs):
#     def __init__(self, plugin, task=lambda x: x, interval=None):
#     def set_interval(self, value):
#     def start(self, interval=None, threaded=False, delay=0):
#     def restart(self, *args, **kwargs):
#     def stop(self):
#     def _task(self, threaded):
#     def __init__(self, plugin, storage="queue"):
#     def get(self):
#     def set(self, value):
#     def delete(self):
#     def add(self, item):
#     def remove(self, item):
# def lock(fn):
#     def new(*args, **kwargs):
# def threaded(fn):
#     def run(*args, **kwargs):
# def format_time(value):
# def format_size(value):
# def compare_time(start, end):
# def free_space(folder):
# def fsbsize(path):
# def uniqify(seq):
# def has_method(obj, name):
# def html_unescape(text):
# def isiterable(obj):
# def get_console_encoding(enc):
# def normalize(value):
# def decode(value, encoding=None, errors='strict'):
# def transcode(value, decoding, encoding):
# def encode(value, encoding='utf-8', errors='backslashreplace'):
# def exists(path):
# def remove(path, trash=True):
# def fsjoin(*args):
# def remove_chars(value, repl):
# def fixurl(url, unquote=None):
# def truncate(name, length):
# def safepath(value):
# def safejoin(*args):
# def safename(value):
# def parse_name(value, safechar=True):
# def parse_size(value, unit=""):  #: returns bytes
# def str2int(value):
# def parse_time(value):
# def timestamp():
# def check_module(module):
# def check_prog(command):
# def isexecutable(filename):
# def which(filename):
# def format_exc(frame=None):
# def seconds_to_nexthour(strict=False):
# def seconds_to_midnight(utc=None, strict=False):
# def replace_patterns(value, rules):
# def set_cookie(cj, domain, name, value, path='/',
#                exp=time.time() + 180 * 24 * 3600):
# def set_cookies(cj, cookies):
# def parse_html_header(header):
# def parse_html_tag_attr_value(attr_name, tag):
# def parse_html_form(attr_str, html, input_names={}):
# def chunks(iterable, size):
# def renice(pid, value):
# def forward(source, destination):
# def compute_checksum(filename, hashtype):
# def copy_tree(src, dst, overwrite=False, preserve_metadata=False):
# def move_tree(src, dst, overwrite=False):


# Path: module/plugins/accounts/MegaDebridEu.py
import pycurl
from module.network.HTTPRequest import BadHeader
from ..internal.misc import encode, json, reduce
from ..internal.MultiAccount import MultiAccount


        if hosters['response_code'] == "ok":
            return reduce((lambda x, y: x + y), hosters['hosters'])

        else:
            self.log_error(_("Unable to retrieve hoster list"))
            return []

    def grab_info(self, user, password, data):
        validuntil = None
        trafficleft = None
        premium = False

        res = self.api_response(
            "connectUser", args(
                login=user, password=password))

        if res['response_code'] == "ok":
            validuntil = float(res['vip_end'])
            premium = validuntil > 0
            trafficleft = -1

        else:
            self.log_error(res['response_text'])

        data['token'] = res['token']

        return {'validuntil': validuntil,
                'trafficleft': trafficleft, 'premium': premium}


    def signin(self, user, password, data):