From aa4c4955b1b4c98b437006db545a5399ecdb25c5 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Thu, 19 Jan 2012 23:56:56 +0100 Subject: undelete DlFreeFr --- module/plugins/hoster/DlFreeFr.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 module/plugins/hoster/DlFreeFr.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py new file mode 100644 index 000000000..138d0e056 --- /dev/null +++ b/module/plugins/hoster/DlFreeFr.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + +class DlFreeFr(SimpleHoster): + __name__ = "DlFreeFr" + __type__ = "hoster" + __pattern__ = r"http://dl\.free\.fr/([a-zA-Z0-9]+|getfile\.pl\?file=/[a-zA-Z0-9]+)$" + __version__ = "0.2" + __description__ = """dl.free.fr download hoster""" + __author_name__ = ("the-razer", "zoidberg") + __author_mail__ = ("daniel_ AT gmx DOT net", "zoidberg@mujmail.cz") + + FILE_NAME_PATTERN = r"Fichier:\s*]*>(?P[^>]*)" + FILE_SIZE_PATTERN = r"Taille:\s*]*>(?P[\d.]+[KMG])" + FILE_OFFLINE_PATTERN = r"Erreur 404 - Document non trouv|Fichier inexistant|Le fichier demandé n'a pas été trouvé" + FILE_URL_PATTERN = r'href="(?Phttp://.*?)">Télécharger ce fichier' + + def setup(self): + self.multiDL = True + self.limitDL = 5 + self.resumeDownload = True + self.chunkLimit = 1 + + def handleFree(self): + if "Trop de slots utilisés" in self.html: + self.retry(300) + + m = re.search(self.FILE_URL_PATTERN, self.html) + if not m: self.parseError('URL') + + url = m.group('url') + self.logDebug("File URL [%s]" % url) + self.download(url) + +getInfo = create_getInfo(DlFreeFr) \ No newline at end of file -- cgit v1.2.3