From e65d19ee3a1e435bf2896ed829e5581eeef92dd2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 14 Mar 2015 11:07:54 +0100 Subject: Import cleanup for datetime and time modules --- module/plugins/hoster/FilepostCom.py | 9 ++++----- module/plugins/hoster/FshareVn.py | 6 +++--- module/plugins/hoster/MegasharesCom.py | 5 ++--- module/plugins/hoster/NetloadIn.py | 10 +++++----- module/plugins/hoster/RapiduNet.py | 6 +++--- module/plugins/hoster/RealdebridCom.py | 4 ++-- module/plugins/hoster/ShareonlineBiz.py | 4 ++-- module/plugins/hoster/SimplyPremiumCom.py | 2 -- module/plugins/hoster/UploadableCh.py | 2 -- module/plugins/hoster/UploadedTo.py | 5 ++--- module/plugins/hoster/Xdcc.py | 16 ++++++++-------- module/plugins/hoster/ZippyshareCom.py | 8 ++++---- 12 files changed, 35 insertions(+), 42 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index 21ebbc55e..f8e4e0dbd 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import time +import time from module.common.json_layer import json_loads from module.plugins.internal.CaptchaService import ReCaptcha @@ -41,7 +40,7 @@ class FilepostCom(SimpleHoster): captcha_key = m.group(1) # Get wait time - get_dict = {'SID': self.req.cj.getCookie('SID'), 'JsHttpRequest': str(int(time() * 10000)) + '-xml'} + get_dict = {'SID': self.req.cj.getCookie('SID'), 'JsHttpRequest': str(int(time.time() * 10000)) + '-xml'} post_dict = {'action': 'set_download', 'token': flp_token, 'code': self.info['pattern']['ID']} wait_time = int(self.getJsonResponse(get_dict, post_dict, 'wait_time')) @@ -57,7 +56,7 @@ class FilepostCom(SimpleHoster): if password: self.logInfo(_("Password protected link, trying ") + file_pass) - get_dict['JsHttpRequest'] = str(int(time() * 10000)) + '-xml' + get_dict['JsHttpRequest'] = str(int(time.time() * 10000)) + '-xml' post_dict['file_pass'] = file_pass self.link = self.getJsonResponse(get_dict, post_dict, 'link') @@ -72,7 +71,7 @@ class FilepostCom(SimpleHoster): recaptcha = ReCaptcha(self) for i in xrange(5): - get_dict['JsHttpRequest'] = str(int(time() * 10000)) + '-xml' + get_dict['JsHttpRequest'] = str(int(time.time() * 10000)) + '-xml' if i: post_dict['recaptcha_response_field'], post_dict['recaptcha_challenge_field'] = recaptcha.challenge( captcha_key) diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 9a2b0c323..77515f191 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- import re +import time -from time import strptime, mktime, gmtime from urlparse import urljoin from module.network.RequestFactory import getURL @@ -99,8 +99,8 @@ class FshareVn(SimpleHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: self.logInfo(_("Wait until %s ICT") % m.group(1)) - wait_until = mktime(strptime(m.group(1), "%d/%m/%Y %H:%M")) - self.wait(wait_until - mktime(gmtime()) - 7 * 60 * 60, True) + wait_until = time.mktime.time(time.strptime.time(m.group(1), "%d/%m/%Y %H:%M")) + self.wait(wait_until - time.mktime.time(time.gmtime.time()) - 7 * 60 * 60, True) self.retry() elif '