# -*- coding: utf-8 -*- import re import time from module.common.json_layer import json_loads from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo def convertDecimalPrefix(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.04" __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(?:live/)?(?P\w+/[^/?]*)' __description__ = """Uloz.to hoster plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] INFO_PATTERN = r'

File (?P[^<]+) is password protected

' NAME_PATTERN = r'(?P<N>[^<]+) \| Uloz\.to' SIZE_PATTERN = r'.*?(?P[\d.,]+\s[kMG]?B)' OFFLINE_PATTERN = r'404 - Page not found|

File (has been deleted|was banned)

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