# -*- coding: utf-8 -*- import re from urlparse import urljoin 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.52" __pattern__ = r'https?://(?:www\.)?filefactory\.com/(file|trafficshare/\w+)/\w+' __description__ = """Filefactory.com hoster plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it"), ("Walter Purcaro", "vuolter@gmail.com")] INFO_PATTERN = r'