diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-05 20:37:10 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-05 20:37:10 +0100 |
commit | b1e4436c6aa875a72054adfa2a7fede1b1ad585d (patch) | |
tree | 83f7e84be0a70a105c9d88ccf8fad4b9245b6c37 /module | |
parent | Initial DodanePl plugin (diff) | |
download | pyload-b1e4436c6aa875a72054adfa2a7fede1b1ad585d.tar.xz |
[DodanePl] Mark dead XD
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hoster/DodanePl.py | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/module/plugins/hoster/DodanePl.py b/module/plugins/hoster/DodanePl.py index f8e5a22e4..7ce8d44af 100644 --- a/module/plugins/hoster/DodanePl.py +++ b/module/plugins/hoster/DodanePl.py @@ -1,40 +1,18 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo -from module.network.RequestFactory import getURL -from random import randrange -from module.common.json_layer import json_loads +from module.plugins.internal.DeadHoster import DeadHoster, parseFileInfo -def getInfo(urls): - for url in urls: - headers = getURL(url, just_header=True) - if 'HTTP/1.1 404 Not Found' in headers: - file_info = (url, 0, 1, url) - else: - file_info = parseFileInfo(DodanePl, url, getURL(url)) - print(file_info) - yield file_info +class DodanePl(DeadHoster): + __name__ = "DodanePl" + __type__ = "hoster" + __version__ = "0.02" - -class DodanePl(SimpleHoster): - __name__ = "DodanePl" - __type__ = "hoster" - __version__ = "0.01" - - __pattern__ = r'http://(www\.)?dodane\.pl/file/(?P<ID>\d+)/\S+' + __pattern__ = r'http://(?:www\.)?dodane\.pl/file/\d+' __description__ = """Dodane.pl hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("z00nx", "z00nx0@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("z00nx", "z00nx0@gmail.com")] - FILE_NAME_PATTERN = r'<div\sclass="filetitle">\s+<h1>\s+(?P<N>[^<]+)</h1>\s+</div>' - FILE_SIZE_PATTERN = r'Wielkość: <span>(?P<S>[^<]+)</span>' - OFFLINE_PATTERN = r'Plik o podanym adresie nie został odnaleziony' - def handleFree(self): - # NOTE: Adapted from http://dodane.pl/static/js/Download.js's downloadFile function - rand_str = '%030x' % randrange(16 ** 30) - json = self.load('http://dodane.pl/transfer/create_session/%s/%s' % (self.file_info['ID'], rand_str)) - json = json_loads(json) - self.download('http://%s/download/%s/%s/%s' % (json['downloadServerAddr'], self.file_info['ID'], json['id'], json['sessionToken'])) +getInfo = create_getInfo(DeadHoster) |