# -*- coding: utf-8 -*- import re import urlparse from pyload.network.RequestFactory import getURL from pyload.plugin.internal.SimpleHoster import SimpleHoster, parseFileInfo def getInfo(urls): for url in urls: h = getURL(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 parseFileInfo(FilefactoryCom, url, getURL(url)) class FilefactoryCom(SimpleHoster): __name = "FilefactoryCom" __type = "hoster" __version = "0.54" __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'