From 142aee553f077798295656ac597945abdecb4e40 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 23 Dec 2014 13:57:57 +0100 Subject: [CloudzillaTo] Fixup --- module/plugins/hoster/CloudzillaTo.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/CloudzillaTo.py b/module/plugins/hoster/CloudzillaTo.py index 2e98842a6..62391e5c7 100644 --- a/module/plugins/hoster/CloudzillaTo.py +++ b/module/plugins/hoster/CloudzillaTo.py @@ -1,13 +1,14 @@ # -*- coding: utf-8 -*- +import re + from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.common.json_layer import json_loads class CloudzillaTo(SimpleHoster): __name__ = "CloudzillaTo" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'http://(?:www\.)?cloudzilla\.to/share/file/(?P[\w^_]+)' @@ -16,24 +17,27 @@ class CloudzillaTo(SimpleHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - INFO_PATTERN = r'>(?P.+?) \((?P[\d.]+) (?P[\w^_]+)' + INFO_PATTERN = r'title="(?P.+?)">\1 \((?P[\d.]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'>File not found...<' def handleFree(self): - ticket = json_loads(self.load("http://www.cloudzilla.to/generateticket/", - post={'file_id': self.info['pattern']['ID'], 'key': ""}))['result'] + self.html = self.load("http://www.cloudzilla.to/generateticket/", + post={'file_id': self.info['pattern']['ID'], 'key': self.getPassword()}) + + ticket = dict(re.findall(r'<(.+?)>([^<>]+?) 5) + self.wait(int(ticket['wait']), int(ticket['wait']) > 5) - self.download("http://%(server)s/download/%(file_id)s/%(ticket_id)s" % {'server' : ticket['server'], - 'file_id' : self.info['pattern']['ID'], - 'ticket_id': ticket['ticket_id']}) + self.link = "http://%(server)s/download/%(file_id)s/%(ticket_id)s" % {'server' : ticket['server'], + 'file_id' : self.info['pattern']['ID'], + 'ticket_id': ticket['ticket_id']}) def handlePremium(self): -- cgit v1.2.3