summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/SimpleHoster.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/internal/SimpleHoster.py')
-rw-r--r--module/plugins/internal/SimpleHoster.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index b54d4dc98..4d7697d57 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -10,14 +10,13 @@ from module.network.RequestFactory import getURL as get_url
from module.plugins.internal.Hoster import Hoster, create_getInfo, parse_fileInfo
from module.plugins.internal.Plugin import Fail
from module.plugins.internal.utils import (encode, parse_name, parse_size,
- parse_time, replace_patterns, seconds_to_midnight,
- set_cookie, set_cookies)
+ parse_time, replace_patterns)
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "2.06"
+ __version__ = "2.14"
__status__ = "stable"
__pattern__ = r'^unmatchable$'
@@ -278,6 +277,9 @@ class SimpleHoster(Hoster):
self.log_info(_("Processing as free download..."))
self.handle_free(pyfile)
+ if not self.link and not self.last_download:
+ self.error(_("%s download link not found") % ("Premium" if self.premium else "Free"))
+
if not self.last_download:
self.log_info(_("Downloading file..."))
self.download(self.link, disposition=self.DISPOSITION)
@@ -420,7 +422,7 @@ class SimpleHoster(Hoster):
def handle_direct(self, pyfile):
- self.link = self.isdownload(pyfile.url)
+ self.link = pyfile.url if self.isdownload(pyfile.url) else None
def handle_multi(self, pyfile): #: Multi-hoster handler
@@ -429,12 +431,10 @@ class SimpleHoster(Hoster):
def handle_free(self, pyfile):
if not self.LINK_FREE_PATTERN:
- self.log_warning(_("Free download not implemented"))
+ self.error(_("Free download not implemented"))
m = re.search(self.LINK_FREE_PATTERN, self.data)
- if m is None:
- self.error(_("Free download link not found"))
- else:
+ if m is not None:
self.link = m.group(1)
@@ -444,7 +444,5 @@ class SimpleHoster(Hoster):
self.restart(premium=False)
m = re.search(self.LINK_PREMIUM_PATTERN, self.data)
- if m is None:
- self.error(_("Premium download link not found"))
- else:
+ if m is not None:
self.link = m.group(1)