From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/RealdebridCom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/RealdebridCom.py') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 36fcd194c..17cd86ccd 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -54,16 +54,16 @@ class RealdebridCom(Hoster): self.logDebug("Returned Data: %s" % data) - if data["error"] != 0: - if data["message"] == "Your file is unavailable on the hoster.": + if data['error'] != 0: + if data['message'] == "Your file is unavailable on the hoster.": self.offline() else: - self.logWarning(data["message"]) + self.logWarning(data['message']) self.tempOffline() else: - if pyfile.name is not None and pyfile.name.endswith('.tmp') and data["file_name"]: - pyfile.name = data["file_name"] - pyfile.size = parseFileSize(data["file_size"]) + if pyfile.name is not None and pyfile.name.endswith('.tmp') and data['file_name']: + pyfile.name = data['file_name'] + pyfile.size = parseFileSize(data['file_size']) new_url = data['generated_links'][0][-1] if self.getConfig("https"): -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/RealdebridCom.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/RealdebridCom.py') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 17cd86ccd..de7540628 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -1,25 +1,28 @@ # -*- coding: utf-8 -*- import re -from time import time -from urllib import quote, unquote + from random import randrange +from urllib import quote, unquote +from time import time -from module.utils import parseFileSize from module.common.json_layer import json_loads from module.plugins.Hoster import Hoster +from module.utils import parseFileSize class RealdebridCom(Hoster): __name__ = "RealdebridCom" - __version__ = "0.53" __type__ = "hoster" + __version__ = "0.53" __pattern__ = r'https?://(?:[^/]*\.)?real-debrid\..*' + __description__ = """Real-Debrid.com hoster plugin""" __author_name__ = "Devirex Hazzard" __author_mail__ = "naibaf_11@yahoo.de" + def getFilename(self, url): try: name = unquote(url.rsplit("/", 1)[1]) -- cgit v1.2.3