# -*- coding: utf-8 -*- import re import time from module.plugins.internal.utils import json from module.plugins.internal.Plugin import timestamp from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo def convert_decimal_prefix(m): #: Decimal prefixes used in filesize and traffic return ("%%.%df" % {'k': 3, 'M': 6, 'G': 9}[m.group(2)] % float(m.group(1))).replace('.', '') class UlozTo(SimpleHoster): __name__ = "UlozTo" __type__ = "hoster" __version__ = "1.16" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(?:live/)?(?P\w+/[^/?]*)' __config__ = [("activated", "bool", "Activated", True), ("use_premium", "bool", "Use premium account if available", True)] __description__ = """Uloz.to hoster plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] NAME_PATTERN = r'(

File |)(?P<N>.+?)(<| \|)' SIZE_PATTERN = r'<span id="fileSize">.*?(?P<S>[\d.,]+\s[kMG]?B)</span>' OFFLINE_PATTERN = r'<title>404 - Page not found|

File (has been deleted|was banned)

' URL_REPLACEMENTS = [(r'(?<=http://)([^/]+)', "www.ulozto.net")] SIZE_REPLACEMENTS = [(r'([\d.]+)\s([kMG])B', convert_decimal_prefix)] CHECK_TRAFFIC = True ADULT_PATTERN = r'
' PASSWD_PATTERN = r'