From 7d78210720ed3bde25ca240f8bd061cc6210e3fb Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 26 Jun 2014 22:02:55 +0200 Subject: [SimplyPremium] Fix #649 --- module/plugins/hoster/SimplyPremiumCom.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py index c9fbf2ff1..17060e00d 100644 --- a/module/plugins/hoster/SimplyPremiumCom.py +++ b/module/plugins/hoster/SimplyPremiumCom.py @@ -34,12 +34,12 @@ def secondsToMidnight(): class SimplyPremiumCom(Hoster): __name__ = "SimplyPremiumCom" - __version__ = "0.01" + __version__ = "0.02" __type__ = "hoster" __pattern__ = r"https?://.*(simply-premium)\.com" __description__ = """Simply-Premium.Com hoster plugin""" - __author_name__ = ("EvolutionClip") - __author_mail__ = ("evolutionclip@live.de") + __author_name__ = "EvolutionClip" + __author_mail__ = "evolutionclip@live.de" def setup(self): self.chunkLimit = 16 @@ -82,20 +82,19 @@ class SimplyPremiumCom(Hoster): #self.api_data = page[new_url] try: - start = page.index('') + len('') - end = page.index('', start) - self.pyfile.name = page[start:end] - except ValueError: + self.pyfile.name = re.search(r'([^<]+)', page).group(1) + except AttributeError: self.pyfile.name = "" try: - start = page.index('') + len('') - end = page.index('', start) - self.pyfile.size = int(float(page[start:end])) - except ValueError: + self.pyfile.size = re.search(r'(\d+)', page).group(1) + except AttributeError: self.pyfile.size = 0 - new_url = 'http://www.simply-premium.com/premium.php?link=' + pyfile.url + try: + new_url = re.search(r'([^<]+)', page).group(1) + except AttributeError: + new_url = 'http://www.simply-premium.com/premium.php?link=' + pyfile.url if new_url != pyfile.url: self.logDebug("New URL: " + new_url) -- cgit v1.2.3