summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-27 13:48:03 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-27 13:48:03 +0100
commitb6a2bd53628bd2824bac1dafc7b4eafdf3c815dd (patch)
tree64df88ec33ffeb34d635e66785853a4a33b3cafc /module
parent[SimpleHoster] Improve _isDirectLink + move here secondsToMidnight routine + ... (diff)
downloadpyload-b6a2bd53628bd2824bac1dafc7b4eafdf3c815dd.tar.xz
Update plugins after SimpleHoster changes
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/ExtabitCom.py5
-rw-r--r--module/plugins/hoster/FileserveCom.py6
-rw-r--r--module/plugins/hoster/FreakshareCom.py4
-rw-r--r--module/plugins/hoster/LetitbitNet.py7
-rw-r--r--module/plugins/hoster/RapidgatorNet.py5
-rw-r--r--module/plugins/hoster/UnrestrictLi.py21
-rw-r--r--module/plugins/internal/SimpleCrypter.py15
-rw-r--r--module/plugins/internal/XFSHoster.py17
8 files changed, 31 insertions, 49 deletions
diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py
index fc38a79a9..7609954d3 100644
--- a/module/plugins/hoster/ExtabitCom.py
+++ b/module/plugins/hoster/ExtabitCom.py
@@ -4,15 +4,14 @@ import re
from module.common.json_layer import json_loads
-from module.plugins.hoster.UnrestrictLi import secondsToMidnight
from module.plugins.internal.CaptchaService import ReCaptcha
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, secondsToMidnight
class ExtabitCom(SimpleHoster):
__name__ = "ExtabitCom"
__type__ = "hoster"
- __version__ = "0.62"
+ __version__ = "0.63"
__pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P<ID>\w+)'
diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py
index 2d4478e63..52a071b52 100644
--- a/module/plugins/hoster/FileserveCom.py
+++ b/module/plugins/hoster/FileserveCom.py
@@ -6,8 +6,8 @@ from module.common.json_layer import json_loads
from module.network.RequestFactory import getURL
from module.plugins.Hoster import Hoster
from module.plugins.Plugin import chunks
-from module.plugins.hoster.UnrestrictLi import secondsToMidnight
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import secondsToMidnight
from module.utils import parseFileSize
@@ -33,9 +33,9 @@ def checkFile(plugin, urls):
class FileserveCom(Hoster):
__name__ = "FileserveCom"
__type__ = "hoster"
- __version__ = "0.52"
+ __version__ = "0.53"
- __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P<ID>[^/]+).*'
+ __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P<ID>[^/]+)'
__description__ = """Fileserve.com hoster plugin"""
__license__ = "GPLv3"
diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py
index 00c31c528..2238f07ef 100644
--- a/module/plugins/hoster/FreakshareCom.py
+++ b/module/plugins/hoster/FreakshareCom.py
@@ -3,14 +3,14 @@
import re
from module.plugins.Hoster import Hoster
-from module.plugins.hoster.UnrestrictLi import secondsToMidnight
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import secondsToMidnight
class FreakshareCom(Hoster):
__name__ = "FreakshareCom"
__type__ = "hoster"
- __version__ = "0.39"
+ __version__ = "0.40"
__pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/'
diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py
index 5fcb5e08b..a7b11047f 100644
--- a/module/plugins/hoster/LetitbitNet.py
+++ b/module/plugins/hoster/LetitbitNet.py
@@ -12,9 +12,8 @@ from urllib import urlencode, urlopen
from urlparse import urljoin
from module.common.json_layer import json_loads, json_dumps
-from module.plugins.hoster.UnrestrictLi import secondsToMidnight
from module.plugins.internal.CaptchaService import ReCaptcha
-from module.plugins.internal.SimpleHoster import SimpleHoster
+from module.plugins.internal.SimpleHoster import SimpleHoster, secondsToMidnight
def api_download_info(url):
@@ -37,9 +36,9 @@ def getInfo(urls):
class LetitbitNet(SimpleHoster):
__name__ = "LetitbitNet"
__type__ = "hoster"
- __version__ = "0.26"
+ __version__ = "0.27"
- __pattern__ = r'https?://(?:www\.)?(letitbit|shareflare)\.net/download/.*'
+ __pattern__ = r'https?://(?:www\.)?(letitbit|shareflare)\.net/download/.+'
__description__ = """Letitbit.net hoster plugin"""
__license__ = "GPLv3"
diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py
index cc11fa7c7..ba6cfcd5c 100644
--- a/module/plugins/hoster/RapidgatorNet.py
+++ b/module/plugins/hoster/RapidgatorNet.py
@@ -6,15 +6,14 @@ from pycurl import HTTPHEADER
from module.common.json_layer import json_loads
from module.network.HTTPRequest import BadHeader
-from module.plugins.hoster.UnrestrictLi import secondsToMidnight
from module.plugins.internal.CaptchaService import AdsCaptcha, ReCaptcha, SolveMedia
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, secondsToMidnight
class RapidgatorNet(SimpleHoster):
__name__ = "RapidgatorNet"
__type__ = "hoster"
- __version__ = "0.26"
+ __version__ = "0.27"
__pattern__ = r'http://(?:www\.)?(rapidgator\.net|rg\.to)/file/\w+'
diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py
index 1476efa96..6e16cace7 100644
--- a/module/plugins/hoster/UnrestrictLi.py
+++ b/module/plugins/hoster/UnrestrictLi.py
@@ -6,30 +6,13 @@ from datetime import datetime, timedelta
from module.common.json_layer import json_loads
from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
-
-
-def secondsToMidnight(gmt=0):
- now = datetime.utcnow() + timedelta(hours=gmt)
-
- if now.hour is 0 and now.minute < 10:
- midnight = now
- else:
- midnight = now + timedelta(days=1)
-
- td = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - now
-
- if hasattr(td, 'total_seconds'):
- res = td.total_seconds()
- else: #@NOTE: work-around for python 2.5 and 2.6 missing timedelta.total_seconds
- res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
-
- return int(res)
+from module.plugins.internal.SimpleHoster import secondsToMidnight
class UnrestrictLi(MultiHoster):
__name__ = "UnrestrictLi"
__type__ = "hoster"
- __version__ = "0.18"
+ __version__ = "0.19"
__pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li'
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
index 6596828b3..428826456 100644
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -12,7 +12,7 @@ from module.utils import fixup
class SimpleCrypter(Crypter, SimpleHoster):
__name__ = "SimpleCrypter"
__type__ = "crypter"
- __version__ = "0.34"
+ __version__ = "0.35"
__pattern__ = r'^unmatchable$'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True), #: Overrides core.config['general']['folder_per_package']
@@ -28,16 +28,16 @@ class SimpleCrypter(Crypter, SimpleHoster):
"""
Following patterns should be defined by each crypter:
- LINK_PATTERN: group(1) must be a download link or a regex to catch more links
+ LINK_PATTERN: Download link or regex to catch links in group(1)
example: LINK_PATTERN = r'<div class="link"><a href="(.+?)"'
- NAME_PATTERN: (optional) folder name or webpage title
+ NAME_PATTERN: (optional) folder name or page title
example: NAME_PATTERN = r'<title>Files of: (?P<N>[^<]+) folder</title>'
- OFFLINE_PATTERN: (optional) Checks if the file is yet available online
+ OFFLINE_PATTERN: (optional) Checks if the page is unreachable
example: OFFLINE_PATTERN = r'File (deleted|not found)'
- TEMP_OFFLINE_PATTERN: (optional) Checks if the file is temporarily offline
+ TEMP_OFFLINE_PATTERN: (optional) Checks if the page is temporarily unreachable
example: TEMP_OFFLINE_PATTERN = r'Server maintainance'
@@ -120,7 +120,10 @@ class SimpleCrypter(Crypter, SimpleHoster):
self.packages = [(self.info['name'], self.links, self.info['folder'])]
- def checkNameSize(self):
+ def checkNameSize(self, getinfo=True):
+ if getinfo:
+ self.updateInfo(self.getInfo(self.pyfile.url, self.html))
+
name = self.info['name']
url = self.info['url']
diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py
index 7c6ae5725..f2168d0c7 100644
--- a/module/plugins/internal/XFSHoster.py
+++ b/module/plugins/internal/XFSHoster.py
@@ -7,16 +7,15 @@ from time import sleep
from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME
-from module.plugins.hoster.UnrestrictLi import secondsToMidnight
from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, secondsToMidnight
from module.utils import html_unescape
class XFSHoster(SimpleHoster):
__name__ = "XFSHoster"
__type__ = "hoster"
- __version__ = "0.32"
+ __version__ = "0.33"
__pattern__ = r'^unmatchable$'
@@ -30,10 +29,10 @@ class XFSHoster(SimpleHoster):
HOSTER_DOMAIN = None
HOSTER_NAME = None
- TEXT_ENCODING = False
- COOKIES = [(HOSTER_DOMAIN, "lang", "english")]
- DIRECT_LINK = None
- MULTI_HOSTER = True #@NOTE: Should be default to False for safe, but I'm lazy...
+ TEXT_ENCODING = False
+ COOKIES = [(HOSTER_DOMAIN, "lang", "english")]
+ DIRECT_LINK = None
+ MULTI_HOSTER = True #@NOTE: Should be default to False for safe, but I'm lazy...
NAME_PATTERN = r'(Filename[ ]*:[ ]*</b>(</td><td nowrap>)?|name="fname"[ ]+value="|<[\w^_]+ class="(file)?name">)\s*(?P<N>.+?)(\s*<|")'
SIZE_PATTERN = r'(Size[ ]*:[ ]*</b>(</td><td>)?|File:.*>|</font>\s*\(|<[\w^_]+ class="size">)\s*(?P<S>[\d.,]+)\s*(?P<U>[\w^_]+)'
@@ -226,10 +225,10 @@ class XFSHoster(SimpleHoster):
elif 'limit' in self.errmsg:
if 'days' in self.errmsg:
- delay = secondsToMidnight(gmt=2)
+ delay = secondsToMidnight(gmt=2)
retries = 3
else:
- delay = 1 * 60 * 60
+ delay = 1 * 60 * 60
retries = 24
self.wantReconnect = True