# -*- coding: utf-8 -*- import re from module.network.RequestFactory import getURL as get_url from module.plugins.internal.SimpleHoster import SimpleHoster, parse_fileInfo def get_info(urls): for url in urls: h = get_url(url, just_header=True) m = re.search(r'Location: (.+)\r\n', h) if m and not re.match(m.group(1), FilefactoryCom.__pattern__): #: It's a direct link! Skipping yield (url, 0, 3, url) else: #: It's a standard html page yield parse_fileInfo(FilefactoryCom, url, get_url(url)) class FilefactoryCom(SimpleHoster): __name__ = "FilefactoryCom" __type__ = "hoster" __version__ = "0.59" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?filefactory\.com/(file|trafficshare/\w+)/\w+' __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """Filefactory.com hoster plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it"), ("Walter Purcaro", "vuolter@gmail.com")] INFO_PATTERN = r'