summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/AlldebridCom.py21
-rw-r--r--module/plugins/hoster/BayfilesCom.py4
-rw-r--r--module/plugins/hoster/DebridItaliaCom.py16
-rw-r--r--module/plugins/hoster/FastixRu.py16
-rw-r--r--module/plugins/hoster/FastshareCz.py35
-rw-r--r--module/plugins/hoster/MultiDebridCom.py16
-rw-r--r--module/plugins/hoster/PutlockerCom.py46
-rw-r--r--module/plugins/hoster/RealdebridCom.py17
-rw-r--r--module/plugins/hoster/UnrestrictLi.py16
-rw-r--r--module/plugins/hoster/ZippyshareCom.py11
10 files changed, 101 insertions, 97 deletions
diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py
index cdb5ccc08..82f4531a6 100644
--- a/module/plugins/hoster/AlldebridCom.py
+++ b/module/plugins/hoster/AlldebridCom.py
@@ -10,7 +10,7 @@ from module.utils import parseFileSize
class AlldebridCom(Hoster):
__name__ = "AlldebridCom"
- __version__ = "0.33"
+ __version__ = "0.34"
__type__ = "hoster"
__pattern__ = r"https?://.*alldebrid\..*"
@@ -23,24 +23,22 @@ class AlldebridCom(Hoster):
name = unquote(url.rsplit("/", 1)[1])
except IndexError:
name = "Unknown_Filename..."
- if name.endswith("..."): #incomplete filename, append random stuff
+ if name.endswith("..."): # incomplete filename, append random stuff
name += "%s.tmp" % randrange(100, 999)
return name
- def init(self):
- self.tries = 0
- self.chunkLimit = 3
+ def setup(self):
+ self.chunkLimit = 16
self.resumeDownload = True
def process(self, pyfile):
- if not self.account:
- self.logError(_("Please enter your %s account or deactivate this plugin") % "AllDebrid")
- self.fail("No AllDebrid account provided")
-
- self.logDebug("AllDebrid: Old URL: %s" % pyfile.url)
if re.match(self.__pattern__, pyfile.url):
new_url = pyfile.url
+ elif not self.account:
+ self.logError(_("Please enter your %s account or deactivate this plugin") % "AllDebrid")
+ self.fail("No AllDebrid account provided")
else:
+ self.logDebug("Old URL: %s" % pyfile.url)
password = self.getPassword().splitlines()
password = "" if not password else password[0]
@@ -67,7 +65,8 @@ class AlldebridCom(Hoster):
else:
new_url = new_url.replace("https://", "http://")
- self.logDebug("AllDebrid: New URL: %s" % new_url)
+ if new_url != pyfile.url:
+ self.logDebug("New URL: %s" % new_url)
if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"):
#only use when name wasnt already set
diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py
index bb1e78bb3..a696bac26 100644
--- a/module/plugins/hoster/BayfilesCom.py
+++ b/module/plugins/hoster/BayfilesCom.py
@@ -26,8 +26,8 @@ from module.common.json_layer import json_loads
class BayfilesCom(SimpleHoster):
__name__ = "BayfilesCom"
__type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?bayfiles\.com/file/\w+/\w+/.*"
- __version__ = "0.04"
+ __pattern__ = r"http://(?:www\.)?bayfiles\.(?:com|net)/file/\w+/\w+/.*"
+ __version__ = "0.05"
__description__ = """Bayfiles.com plugin - free only"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py
index 1c2f4246b..08470b984 100644
--- a/module/plugins/hoster/DebridItaliaCom.py
+++ b/module/plugins/hoster/DebridItaliaCom.py
@@ -22,26 +22,25 @@ from module.plugins.Hoster import Hoster
class DebridItaliaCom(Hoster):
__name__ = "DebridItaliaCom"
- __version__ = "0.04"
+ __version__ = "0.05"
__type__ = "hoster"
__pattern__ = r"https?://.*debriditalia\.com"
__description__ = """Debriditalia.com hoster plugin"""
__author_name__ = ("stickell")
__author_mail__ = ("l.stickell@yahoo.it")
- def init(self):
+ def setup(self):
self.chunkLimit = -1
self.resumeDownload = True
def process(self, pyfile):
- if not self.account:
- self.logError(_("Please enter your %s account or deactivate this plugin") % "DebridItalia")
- self.fail("No DebridItalia account provided")
-
- self.logDebug("Old URL: %s" % pyfile.url)
if re.match(self.__pattern__, pyfile.url):
new_url = pyfile.url
+ elif not self.account:
+ self.logError(_("Please enter your %s account or deactivate this plugin") % "DebridItalia")
+ self.fail("No DebridItalia account provided")
else:
+ self.logDebug("Old URL: %s" % pyfile.url)
url = "http://debriditalia.com/linkgen2.php?xjxfun=convertiLink&xjxargs[]=S<![CDATA[%s]]>" % pyfile.url
page = self.load(url)
self.logDebug("XML data: %s" % page)
@@ -51,7 +50,8 @@ class DebridItaliaCom(Hoster):
else:
new_url = re.search(r'<a href="(?:[^"]+)">(?P<direct>[^<]+)</a>', page).group('direct')
- self.logDebug("New URL: %s" % new_url)
+ if new_url != pyfile.url:
+ self.logDebug("New URL: %s" % new_url)
self.download(new_url, disposition=True)
diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py
index 4d3e7b93d..c2791c5d2 100644
--- a/module/plugins/hoster/FastixRu.py
+++ b/module/plugins/hoster/FastixRu.py
@@ -9,7 +9,7 @@ from module.common.json_layer import json_loads
class FastixRu(Hoster):
__name__ = "FastixRu"
- __version__ = "0.02"
+ __version__ = "0.03"
__type__ = "hoster"
__pattern__ = r"http?://.*fastix.ru\..*"
__description__ = """Fastix hoster plugin"""
@@ -25,19 +25,18 @@ class FastixRu(Hoster):
name += "%s.tmp" % randrange(100, 999)
return name
- def init(self):
+ def setup(self):
self.chunkLimit = 3
self.resumeDownload = True
def process(self, pyfile):
- if not self.account:
- self.logError(_("Please enter your %s account or deactivate this plugin") % "Fastix")
- self.fail("No Fastix account provided")
-
- self.logDebug("Old URL: %s" % pyfile.url)
if re.match(self.__pattern__, pyfile.url):
new_url = pyfile.url
+ elif not self.account:
+ self.logError(_("Please enter your %s account or deactivate this plugin") % "Fastix")
+ self.fail("No Fastix account provided")
else:
+ self.logDebug("Old URL: %s" % pyfile.url)
api_key = self.account.getAccountData(self.user)
api_key = api_key["api"]
url = "http://fastix.ru/api_v2/?apikey=%s&sub=getdirectlink&link=%s" % (api_key, pyfile.url)
@@ -49,7 +48,8 @@ class FastixRu(Hoster):
else:
new_url = data["downloadlink"]
- self.logDebug("New URL: %s" % new_url)
+ if new_url != pyfile.url:
+ self.logDebug("New URL: %s" % new_url)
if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"):
#only use when name wasnt already set
diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py
index 844b8cd59..1597d21e5 100644
--- a/module/plugins/hoster/FastshareCz.py
+++ b/module/plugins/hoster/FastshareCz.py
@@ -20,58 +20,47 @@
# http://www.fastshare.cz/2141189/random.bin
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FastshareCz(SimpleHoster):
__name__ = "FastshareCz"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?fastshare.cz/\d+/.+"
- __version__ = "0.17"
+ __version__ = "0.19"
__description__ = """FastShare.cz"""
__author_name__ = ("zoidberg", "stickell")
FILE_INFO_PATTERN = r'<h1 class="dwp">(?P<N>[^<]+)</h1>\s*<div class="fileinfo">\s*(?:Velikost|Size)\s*: (?P<S>[^,]+),'
FILE_OFFLINE_PATTERN = ur'<td align=center>Tento soubor byl smazán'
FILE_URL_REPLACEMENTS = [('#.*', '')]
+ SH_COOKIES = [('fastshare.cz', 'lang', 'en')]
FREE_URL_PATTERN = r'action=(/free/.*?)>\s*<img src="([^"]*)"><br'
PREMIUM_URL_PATTERN = r'(http://data\d+\.fastshare\.cz/download\.php\?id=\d+\&[^\s\"\'<>]+)'
NOT_ENOUGH_CREDIC_PATTERN = "Nem.te dostate.n. kredit pro sta.en. tohoto souboru"
- def process(self, pyfile):
- pyfile.url = replace_patterns(pyfile.url, self.FILE_URL_REPLACEMENTS)
- self.req.setOption("timeout", 120)
- if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()):
- self.handlePremium()
- else:
- self.html = self.load(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES)
- self.getFileInfo()
- self.handleFree()
-
def handleFree(self):
- if u">100% FREE slotů je plných.<" in self.html:
- self.setWait(60, False)
- self.wait()
- self.retry(120, "No free slots")
+ if '100% of FREE slots are full' in self.html:
+ self.retry(120, 60, "No free slots")
found = re.search(self.FREE_URL_PATTERN, self.html)
if not found:
self.parseError("Free URL")
action, captcha_src = found.groups()
- captcha = self.decryptCaptcha("http://www.fastshare.cz/" + captcha_src)
- self.download("http://www.fastshare.cz/" + action, post={"code": captcha, "submit": u"stáhnout"})
+ captcha = self.decryptCaptcha("http://www.fastshare.cz" + captcha_src)
+ self.download("http://www.fastshare.cz" + action, post={"code": captcha, "btn.x": 77, "btn.y": 18})
check = self.checkDownload({
"paralell_dl":
- "<title>FastShare.cz</title>|<script>alert\('Pres FREE muzete stahovat jen jeden soubor najednou.'\)"
+ "<title>FastShare.cz</title>|<script>alert\('Pres FREE muzete stahovat jen jeden soubor najednou.'\)",
+ "wrong_captcha": "Download for FREE"
})
- self.logDebug(self.req.lastEffectiveURL, self.req.lastURL, self.req.code)
if check == "paralell_dl":
- self.setWait(600, True)
- self.wait()
- self.retry(6, "Paralell download")
+ self.retry(6, 600, "Paralell download")
+ elif check == "wrong_captcha":
+ self.retry(5, 1, "Wrong captcha")
def handlePremium(self):
header = self.load(self.pyfile.url, just_header=True)
diff --git a/module/plugins/hoster/MultiDebridCom.py b/module/plugins/hoster/MultiDebridCom.py
index 7280504cb..83f477f34 100644
--- a/module/plugins/hoster/MultiDebridCom.py
+++ b/module/plugins/hoster/MultiDebridCom.py
@@ -23,26 +23,25 @@ from module.common.json_layer import json_loads
class MultiDebridCom(Hoster):
__name__ = "MultiDebridCom"
- __version__ = "0.02"
+ __version__ = "0.03"
__type__ = "hoster"
__pattern__ = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/"
__description__ = """Multi-debrid.com hoster plugin"""
__author_name__ = ("stickell")
__author_mail__ = ("l.stickell@yahoo.it")
- def init(self):
+ def setup(self):
self.chunkLimit = -1
self.resumeDownload = True
def process(self, pyfile):
- if not self.account:
- self.logError(_("Please enter your %s account or deactivate this plugin") % "Multi-debrid.com")
- self.fail("No Multi-debrid.com account provided")
-
- self.logDebug("Original URL: %s" % pyfile.url)
if re.match(self.__pattern__, pyfile.url):
new_url = pyfile.url
+ elif not self.account:
+ self.logError(_("Please enter your %s account or deactivate this plugin") % "Multi-debrid.com")
+ self.fail("No Multi-debrid.com account provided")
else:
+ self.logDebug("Original URL: %s" % pyfile.url)
page = self.req.load('http://multi-debrid.com/api.php',
get={'user': self.user, 'pass': self.account.getAccountData(self.user)['password'],
'link': pyfile.url})
@@ -52,6 +51,7 @@ class MultiDebridCom(Hoster):
self.fail('Unable to unrestrict link')
new_url = page['link']
- self.logDebug("Unrestricted URL: " + new_url)
+ if new_url != pyfile.url:
+ self.logDebug("Unrestricted URL: " + new_url)
self.download(new_url, disposition=True)
diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py
index 02205f9cc..0b049b28d 100644
--- a/module/plugins/hoster/PutlockerCom.py
+++ b/module/plugins/hoster/PutlockerCom.py
@@ -17,9 +17,8 @@
@author: jeix
"""
-# http://www.putlocker.com/file/83C174C844583CF7
-
import re
+from os import rename
from module.plugins.internal.SimpleHoster import SimpleHoster
@@ -28,25 +27,26 @@ class PutlockerCom(SimpleHoster):
__name__ = "PutlockerCom"
__type__ = "hoster"
__pattern__ = r'http://(www\.)?putlocker\.com/(file|embed)/[A-Z0-9]+'
- __version__ = "0.27"
+ __version__ = "0.29"
__description__ = """Putlocker.Com"""
- __author_name__ = ("jeix", "stickell")
- __author_mail__ = ("l.stickell@yahoo.it")
+ __author_name__ = ("jeix", "stickell", "Walter Purcaro")
+ __author_mail__ = ("", "l.stickell@yahoo.it", "vuolter@gmail.com")
FILE_OFFLINE_PATTERN = r"This file doesn't exist, or has been removed."
FILE_INFO_PATTERN = r'site-content">\s*<h1>(?P<N>.+)<strong>\( (?P<S>[^)]+) \)</strong></h1>'
- def handleFree(self):
+ FILE_URL_REPLACEMENTS = [(r'http://putlocker\.com', r'http://www.putlocker.com')]
+
+ def setup(self):
self.multiDL = self.resumeDownload = True
self.chunkLimit = -1
- self.pyfile.url = re.sub(r'http://putlocker\.com', r'http://www.putlocker.com', self.pyfile.url)
-
- self.html = self.load(self.pyfile.url, decode=True)
+ def handleFree(self):
+ name = self.pyfile.name
link = self._getLink()
- if not link.startswith('http://'):
- link = "http://www.putlocker.com" + link
+ self.logDebug("Direct link: " + link)
self.download(link, disposition=True)
+ self.processName(name)
def _getLink(self):
hash_data = re.search(r'<input type="hidden" value="([a-z0-9]+)" name="hash">', self.html)
@@ -56,12 +56,12 @@ class PutlockerCom(SimpleHoster):
post_data = {"hash": hash_data.group(1), "confirm": "Continue+as+Free+User"}
self.html = self.load(self.pyfile.url, post=post_data)
if ">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html or \
- "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html:
- self.retry(wait_time=2 * 60 * 60, reason="Download limit exceeded or server disabled")
+ "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html:
+ self.retry(wait_time=7200, reason="Download limit exceeded or server disabled") # 2 hours wait
patterns = (r'(/get_file\.php\?id=[A-Z0-9]+&key=[A-Za-z0-9=]+&original=1)',
- r"(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+)",
- r"(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+&original=1)",
+ r'(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+)',
+ r'(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+&original=1)',
r'<a href="/gopro\.php">Tired of ads and waiting\? Go Pro!</a>[\t\n\rn ]+</div>[\t\n\rn ]+<a href="(/.*?)"')
for pattern in patterns:
link = re.search(pattern, self.html)
@@ -77,4 +77,18 @@ class PutlockerCom(SimpleHoster):
else:
self.parseError('Unable to detect a download link')
- return link.group(1).replace("&amp;", "&")
+ link = link.group(1).replace("&amp;", "&")
+ if link.startswith("http://"):
+ return link
+ else:
+ return "http://www.putlocker.com" + link
+
+ def processName(self, name_old):
+ name = self.pyfile.name
+ if name <= name_old:
+ return
+ name_new = re.sub(r'\.[^.]+$', "", name_old) + name[len(name_old):]
+ file = self.lastDownload
+ self.pyfile.name = name_new
+ rename(file, file.rsplit(name)[0] + name_new)
+ self.logInfo("%(name)s renamed to %(newname)s" % {"name": name, "newname": name_new})
diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py
index fd91b89b7..59997ee7c 100644
--- a/module/plugins/hoster/RealdebridCom.py
+++ b/module/plugins/hoster/RealdebridCom.py
@@ -13,7 +13,7 @@ from module.plugins.Hoster import Hoster
class RealdebridCom(Hoster):
__name__ = "RealdebridCom"
- __version__ = "0.51"
+ __version__ = "0.52"
__type__ = "hoster"
__pattern__ = r"https?://.*real-debrid\..*"
@@ -30,20 +30,18 @@ class RealdebridCom(Hoster):
name += "%s.tmp" % randrange(100, 999)
return name
- def init(self):
- self.tries = 0
+ def setup(self):
self.chunkLimit = 3
self.resumeDownload = True
def process(self, pyfile):
- if not self.account:
- self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid")
- self.fail("No Real-debrid account provided")
-
- self.logDebug("Real-Debrid: Old URL: %s" % pyfile.url)
if re.match(self.__pattern__, pyfile.url):
new_url = pyfile.url
+ elif not self.account:
+ self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid")
+ self.fail("No Real-debrid account provided")
else:
+ self.logDebug("Old URL: %s" % pyfile.url)
password = self.getPassword().splitlines()
if not password:
password = ""
@@ -74,7 +72,8 @@ class RealdebridCom(Hoster):
else:
new_url = new_url.replace("https://", "http://")
- self.logDebug("Real-Debrid: New URL: %s" % new_url)
+ if new_url != pyfile.url:
+ self.logDebug("New URL: %s" % new_url)
if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown") or pyfile.name.endswith('..'):
#only use when name wasnt already set
diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py
index bdafca63d..a3fe5ff5d 100644
--- a/module/plugins/hoster/UnrestrictLi.py
+++ b/module/plugins/hoster/UnrestrictLi.py
@@ -35,26 +35,25 @@ def secondsToMidnight():
class UnrestrictLi(Hoster):
__name__ = "UnrestrictLi"
- __version__ = "0.10"
+ __version__ = "0.11"
__type__ = "hoster"
__pattern__ = r"https?://.*(unrestrict|unr)\.li"
__description__ = """Unrestrict.li hoster plugin"""
__author_name__ = ("stickell")
__author_mail__ = ("l.stickell@yahoo.it")
- def init(self):
+ def setup(self):
self.chunkLimit = 16
self.resumeDownload = True
def process(self, pyfile):
- if not self.account:
- self.logError(_("Please enter your %s account or deactivate this plugin") % "Unrestrict.li")
- self.fail("No Unrestrict.li account provided")
-
- self.logDebug("Old URL: %s" % pyfile.url)
if re.match(self.__pattern__, pyfile.url):
new_url = pyfile.url
+ elif not self.account:
+ self.logError(_("Please enter your %s account or deactivate this plugin") % "Unrestrict.li")
+ self.fail("No Unrestrict.li account provided")
else:
+ self.logDebug("Old URL: %s" % pyfile.url)
for i in xrange(5):
page = self.req.load('https://unrestrict.li/unrestrict.php',
post={'link': pyfile.url, 'domain': 'long'})
@@ -83,7 +82,8 @@ class UnrestrictLi(Hoster):
new_url = page.keys()[0]
self.api_data = page[new_url]
- self.logDebug("New URL: " + new_url)
+ if new_url != pyfile.url:
+ self.logDebug("New URL: " + new_url)
if hasattr(self, 'api_data'):
self.setNameSize()
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index a3b1cf783..c98679a22 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -1,6 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+# Test links (random.bin):
+# http://www29.zippyshare.com/v/55578602/file.html
+
import re
import subprocess
import tempfile
@@ -26,6 +29,8 @@ class ZippyshareCom(SimpleHoster):
FILE_INFO_PATTERN = r'document\.getElementById\(\'dlbutton\'\)\.href = "[^;]*/(?P<N>[^"]+)";'
FILE_OFFLINE_PATTERN = r'>File does not exist on this server</div>'
+ SH_COOKIES = [('zippyshare.com', 'ziplocale', 'en')]
+
DOWNLOAD_URL_PATTERN = r"<script type=\"text/javascript\">([^<]*?)(document\.getElementById\('dlbutton'\).href = [^;]+;)"
SEED_PATTERN = r'swfobject.embedSWF\("([^"]+)".*?seed: (\d+)'
CAPTCHA_KEY_PATTERN = r'Recaptcha.create\("([^"]+)"'
@@ -35,16 +40,14 @@ class ZippyshareCom(SimpleHoster):
LAST_KNOWN_VALUES = (9, 2374755) # time = (seed * multiply) % modulo
def setup(self):
- self.html = None
- self.wantReconnect = False
self.multiDL = True
def handleFree(self):
url = self.get_file_url()
if not url:
self.fail("Download URL not found.")
- self.logDebug("Download URL %s" % url)
- self.download(url, cookies=True)
+ self.logDebug("Download URL: %s" % url)
+ self.download(url)
check = self.checkDownload({
"swf_values": re.compile(self.SEED_PATTERN)