From df0e93c878c2f6cf1c914516a7c754edfea7d3ce Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 7 Oct 2010 18:47:34 +0200 Subject: files.mail.ru closed #101 --- module/plugins/hoster/FilesMailRu.py | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 module/plugins/hoster/FilesMailRu.py (limited to 'module/plugins/hoster/FilesMailRu.py') diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py new file mode 100644 index 000000000..028fcc465 --- /dev/null +++ b/module/plugins/hoster/FilesMailRu.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.plugins.Hoster import Hoster + +class FilesMailRu(Hoster): + __name__ = "FilesMailRu" + __type__ = "hoster" + __pattern__ = r"http://files\.mail\.ru/.*" + __version__ = "0.1" + __description__ = """Files.Mail.Ru One-Klick Hoster""" + __author_name__ = ("oZiRiz") + __author_mail__ = ("ich@oziriz.de") + + def process(self, pyfile): + self.html = self.load(pyfile.url) + self.url_pattern = '(.+?)' + + #marks the file as "offline" when the pattern was found on the html-page''' + if re.search(r'
', self.html) is not None: + self.offline() + + + #the filename that will be showed in the list (e.g. test.part1.rar)''' + pyfile.name = self.getFileName() + + #prepare and download''' + self.prepare() + self.download(self.getFileUrl()) + + + + + def prepare(self): + '''You have to wait some seconds. Otherwise you will get a 40Byte HTML Page instead of the file you expected''' + self.setWait(10) + self.wait() + return True + + def getFileUrl(self): + '''gives you the URL to the file. Extracted from the Files.mail.ru HTML-page stored in self.html''' + file_url = re.search(self.url_pattern, self.html).group(0).split('')[1].split('')[0] + return file_name -- cgit v1.2.3