summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/SimplyPremiumCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/SimplyPremiumCom.py')
-rw-r--r--module/plugins/hoster/SimplyPremiumCom.py45
1 files changed, 12 insertions, 33 deletions
diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py
index 17060e00d..5db9f5daa 100644
--- a/module/plugins/hoster/SimplyPremiumCom.py
+++ b/module/plugins/hoster/SimplyPremiumCom.py
@@ -1,46 +1,25 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero General Public License as #
-# published by the Free Software Foundation, either version 3 of the #
-# License, or (at your option) any later version. #
-# #
-# This program is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
import re
+
from datetime import datetime, timedelta
from module.plugins.Hoster import Hoster
-
-
-def secondsToMidnight():
- # Seconds until 00:10 GMT+2
- now = datetime.utcnow() + timedelta(hours=2)
- if now.hour is 0 and now.minute < 10:
- midnight = now
- else:
- midnight = now + timedelta(days=1)
- midnight = midnight.replace(hour=0, minute=10, second=0, microsecond=0)
- return int((midnight - now).total_seconds())
+from module.plugins.hoster.UnrestrictLi import secondsToMidnight
class SimplyPremiumCom(Hoster):
__name__ = "SimplyPremiumCom"
- __version__ = "0.02"
__type__ = "hoster"
- __pattern__ = r"https?://.*(simply-premium)\.com"
- __description__ = """Simply-Premium.Com hoster plugin"""
+ __version__ = "0.03"
+
+ __pattern__ = r'https?://.*(simply-premium)\.com'
+
+ __description__ = """Simply-Premium.com hoster plugin"""
__author_name__ = "EvolutionClip"
__author_mail__ = "evolutionclip@live.de"
+
def setup(self):
self.chunkLimit = 16
self.resumeDownload = False
@@ -69,13 +48,13 @@ class SimplyPremiumCom(Hoster):
elif "NOTFOUND" in page:
self.offline()
elif "downloadlimit" in page:
- self.logInfo("Reached maximum connctions")
+ self.logWarning("Reached maximum connctions")
self.retry(5, 60, "Reached maximum connctions")
elif "trafficlimit" in page:
- self.logInfo("Reached daily limit for this host. Waiting until 00:10 GMT+2")
- self.retry(5, secondsToMidnight(), "Daily limit for this host reached")
+ self.logWarning("Reached daily limit for this host")
+ self.retry(1, secondsToMidnight(gmt=2), "Daily limit for this host reached")
elif "hostererror" in page:
- self.logInfo("Hoster temporarily unavailable, waiting 1 minute and retry")
+ self.logWarning("Hoster temporarily unavailable, waiting 1 minute and retry")
self.retry(5, 60, "Hoster is temporarily unavailable")
#page = json_loads(page)
#new_url = page.keys()[0]