summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-24 17:16:34 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-24 17:16:34 +0100
commit3ae2fbb170ad0f2bfe1ebf7f59e76d3645861f0a (patch)
treeb01e2c881aaf744aaab0af613a7a26e7129f2028 /module/plugins/hoster
parententer captchas on webui (diff)
parentRapidgator: fixed bug #47 (diff)
downloadpyload-3ae2fbb170ad0f2bfe1ebf7f59e76d3645861f0a.tar.xz
Merge remote-tracking branch 'origin/stable'
Conflicts: module/plugins/accounts/FilesonicCom.py module/plugins/accounts/OronCom.py module/plugins/accounts/ShareonlineBiz.py module/plugins/addons/UpdateManager.py module/plugins/crypter/FilesonicComFolder.py module/plugins/hoster/BezvadataCz.py module/plugins/hoster/EuroshareEu.py module/plugins/hoster/FilesonicCom.py module/plugins/hoster/MegauploadCom.py module/plugins/hoster/Premium4Me.py module/plugins/hoster/YoutubeCom.py module/plugins/internal/MultiHoster.py module/utils.py
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/AlldebridCom.py4
-rw-r--r--module/plugins/hoster/BasePlugin.py48
-rw-r--r--module/plugins/hoster/BezvadataCz.py69
-rw-r--r--module/plugins/hoster/BillionuploadsCom.py17
-rw-r--r--module/plugins/hoster/BitshareCom.py24
-rw-r--r--module/plugins/hoster/BoltsharingCom.py15
-rw-r--r--module/plugins/hoster/CatShareNet.py38
-rw-r--r--module/plugins/hoster/ChipDe.py24
-rw-r--r--module/plugins/hoster/CloudzerNet.py65
-rw-r--r--module/plugins/hoster/CoolshareCz.py61
-rw-r--r--module/plugins/hoster/CramitIn.py4
-rw-r--r--module/plugins/hoster/CyberlockerCh.py15
-rw-r--r--module/plugins/hoster/CzshareCom.py105
-rw-r--r--module/plugins/hoster/DailymotionCom.py47
-rw-r--r--module/plugins/hoster/DataportCz.py7
-rw-r--r--module/plugins/hoster/DateiTo.py4
-rw-r--r--module/plugins/hoster/DebridItaliaCom.py38
-rw-r--r--module/plugins/hoster/DepositfilesCom.py8
-rw-r--r--module/plugins/hoster/DlFreeFr.py4
-rw-r--r--module/plugins/hoster/EasybytezCom.py3
-rw-r--r--module/plugins/hoster/EgoFilesCom.py75
-rw-r--r--module/plugins/hoster/EnteruploadCom.py82
-rw-r--r--module/plugins/hoster/EuroshareEu.py78
-rw-r--r--module/plugins/hoster/FastshareCz.py37
-rw-r--r--module/plugins/hoster/FilebeerInfo.py15
-rw-r--r--module/plugins/hoster/FiledinoCom.py21
-rw-r--r--module/plugins/hoster/FilefactoryCom.py11
-rw-r--r--module/plugins/hoster/FilerioCom.py12
-rw-r--r--module/plugins/hoster/FilesMailRu.py4
-rw-r--r--module/plugins/hoster/FileshareInUa.py78
-rw-r--r--module/plugins/hoster/FilesonicCom.py217
-rw-r--r--module/plugins/hoster/FlyFilesNet.py41
-rw-r--r--module/plugins/hoster/FourSharedCom.py4
-rw-r--r--module/plugins/hoster/FreevideoCz.py6
-rw-r--r--module/plugins/hoster/FshareVn.py98
-rw-r--r--module/plugins/hoster/Ftp.py73
-rw-r--r--module/plugins/hoster/GamefrontCom.py80
-rw-r--r--module/plugins/hoster/HellshareCz.py94
-rw-r--r--module/plugins/hoster/HellspyCz.py9
-rw-r--r--module/plugins/hoster/HotfileCom.py14
-rw-r--r--module/plugins/hoster/IFileWs.py20
-rw-r--r--module/plugins/hoster/IcyFilesCom.py4
-rw-r--r--module/plugins/hoster/IfolderRu.py10
-rw-r--r--module/plugins/hoster/KickloadCom.py96
-rw-r--r--module/plugins/hoster/LetitbitNet.py93
-rw-r--r--module/plugins/hoster/LoadTo.py7
-rw-r--r--module/plugins/hoster/LuckyShareNet.py72
-rw-r--r--module/plugins/hoster/MediafireCom.py6
-rw-r--r--module/plugins/hoster/MegaNz.py125
-rw-r--r--module/plugins/hoster/MegauploadCom.py171
-rw-r--r--module/plugins/hoster/MegavideoCom.py118
-rw-r--r--module/plugins/hoster/NahrajCz.py54
-rw-r--r--module/plugins/hoster/NetloadIn.py12
-rw-r--r--module/plugins/hoster/NovafileCom.py24
-rw-r--r--module/plugins/hoster/NowDownloadEu.py8
-rw-r--r--module/plugins/hoster/OneFichierCom.py10
-rwxr-xr-xmodule/plugins/hoster/OronCom.py147
-rw-r--r--module/plugins/hoster/PornhubCom.py4
-rw-r--r--module/plugins/hoster/Premium4Me.py7
-rw-r--r--module/plugins/hoster/PrzeklejPl.py47
-rw-r--r--module/plugins/hoster/PutlockerCom.py5
-rw-r--r--module/plugins/hoster/QuickshareCz.py95
-rw-r--r--module/plugins/hoster/RapidgatorNet.py151
-rw-r--r--module/plugins/hoster/RarefileNet.py6
-rw-r--r--module/plugins/hoster/RehostTo.py5
-rw-r--r--module/plugins/hoster/ReloadCc.py103
-rw-r--r--module/plugins/hoster/RyushareCom.py49
-rw-r--r--module/plugins/hoster/SecureUploadEu.py18
-rw-r--r--module/plugins/hoster/SendmywayCom.py18
-rw-r--r--module/plugins/hoster/Share76Com.py19
-rw-r--r--module/plugins/hoster/ShareFilesCo.py24
-rw-r--r--module/plugins/hoster/ShareRapidCom.py10
-rw-r--r--module/plugins/hoster/SharebeesCom.py19
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py15
-rw-r--r--module/plugins/hoster/ShareplaceCom.py84
-rw-r--r--module/plugins/hoster/ShragleCom.py6
-rw-r--r--module/plugins/hoster/SpeedLoadOrg.py21
-rw-r--r--module/plugins/hoster/StahnuTo.py63
-rw-r--r--module/plugins/hoster/TurbobitNet.py7
-rw-r--r--module/plugins/hoster/TusfilesNet.py18
-rw-r--r--module/plugins/hoster/UlozTo.py11
-rw-r--r--module/plugins/hoster/UloziskoSk.py6
-rw-r--r--module/plugins/hoster/UploadboxCom.py95
-rw-r--r--module/plugins/hoster/UploadedTo.py24
-rw-r--r--module/plugins/hoster/UploadhereCom.py34
-rw-r--r--module/plugins/hoster/UploadkingCom.py44
-rw-r--r--module/plugins/hoster/UptoboxCom.py21
-rw-r--r--module/plugins/hoster/VeehdCom.py140
-rw-r--r--module/plugins/hoster/WarserverCz.py44
-rw-r--r--module/plugins/hoster/WebshareCz.py5
-rw-r--r--module/plugins/hoster/X7To.py76
-rw-r--r--module/plugins/hoster/XFileSharingPro.py164
-rw-r--r--module/plugins/hoster/XHamsterCom.py120
-rw-r--r--module/plugins/hoster/XvidstageCom.py105
-rw-r--r--module/plugins/hoster/YibaishiwuCom.py6
-rw-r--r--module/plugins/hoster/YoutubeCom.py154
-rw-r--r--module/plugins/hoster/ZShareNet.py70
97 files changed, 2423 insertions, 2116 deletions
diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py
index e93e7beb9..fe58ff0a7 100644
--- a/module/plugins/hoster/AlldebridCom.py
+++ b/module/plugins/hoster/AlldebridCom.py
@@ -13,7 +13,7 @@ from module.utils import parseFileSize, fs_encode
class AlldebridCom(Hoster):
__name__ = "AlldebridCom"
- __version__ = "0.2"
+ __version__ = "0.3"
__type__ = "hoster"
__pattern__ = r"https?://.*alldebrid\..*"
@@ -57,7 +57,7 @@ class AlldebridCom(Hoster):
if data["error"]:
if data["error"] == "This link isn't available on the hoster website.":
- self.offline()
+ self.offline()
else:
self.logWarning(data["error"])
self.tempOffline()
diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py
index 140d0b136..7070fafde 100644
--- a/module/plugins/hoster/BasePlugin.py
+++ b/module/plugins/hoster/BasePlugin.py
@@ -12,10 +12,10 @@ class BasePlugin(Hoster):
__name__ = "BasePlugin"
__type__ = "hoster"
__pattern__ = r"^unmatchable$"
- __version__ = "0.151"
+ __version__ = "0.17"
__description__ = """Base Plugin when any other didnt fit"""
- __author_name__ = ("RaNaN", 'hagg')
- __author_mail__ = ("RaNaN@pyload.org", '')
+ __author_name__ = ("RaNaN")
+ __author_mail__ = ("RaNaN@pyload.org")
def setup(self):
self.chunkLimit = -1
@@ -47,14 +47,22 @@ class BasePlugin(Hoster):
if e.code in (401, 403):
self.logDebug("Auth required")
- pwd = pyfile.package().password.strip()
- if ":" not in pwd:
- self.fail(_("Authorization required (username:password)"))
+ account = self.core.accountManager.getAccountPlugin('Http')
+ servers = [ x['login'] for x in account.getAllAccounts() ]
+ server = urlparse(pyfile.url).netloc
+
+ if server in servers:
+ self.logDebug("Logging on to %s" % server)
+ self.req.addAuth(account.accounts[server]["password"])
+ else:
+ for pwd in pyfile.package().password.splitlines():
+ if ":" in pwd:
+ self.req.addAuth(pwd.strip())
+ break
+ else:
+ self.fail(_("Authorization required (username:password)"))
- self.req.addAuth(pwd)
self.downloadFile(pyfile)
- elif e.code == 404:
- self.offline()
else:
raise
@@ -63,18 +71,20 @@ class BasePlugin(Hoster):
def downloadFile(self, pyfile):
- header = self.load(pyfile.url, just_header = True)
- #self.logDebug(header)
+ url = pyfile.url
- # self.load does not raise a BadHeader on 404 responses, do it here
- if header.has_key('code') and header['code'] == 404:
- raise BadHeader(404)
+ for i in range(5):
+ header = self.load(url, just_header = True)
- if 'location' in header:
- self.logDebug("Location: " + header['location'])
- url = unquote(header['location'])
- else:
- url = pyfile.url
+ # self.load does not raise a BadHeader on 404 responses, do it here
+ if header.has_key('code') and header['code'] == 404:
+ raise BadHeader(404)
+
+ if 'location' in header:
+ self.logDebug("Location: " + header['location'])
+ url = unquote(header['location'])
+ else:
+ break
name = html_unescape(unquote(urlparse(url).path.split("/")[-1]))
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py
index a0717ad64..49299d463 100644
--- a/module/plugins/hoster/BezvadataCz.py
+++ b/module/plugins/hoster/BezvadataCz.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@ class BezvadataCz(SimpleHoster):
__name__ = "BezvadataCz"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)*bezvadata.cz/stahnout/.*"
- __version__ = "0.23"
+ __version__ = "0.24"
__description__ = """BezvaData.cz"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -31,15 +31,64 @@ class BezvadataCz(SimpleHoster):
FILE_NAME_PATTERN = r'<p><b>Soubor: (?P<N>[^<]+)</b></p>'
FILE_SIZE_PATTERN = r'<li><strong>Velikost:</strong> (?P<S>[^<]+)</li>'
FILE_OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen</title>'
- DOWNLOAD_FORM_PATTERN = r'<form class="download" action="([^"]+)" method="post" id="frm-stahnoutForm">'
+
+ def setup(self):
+ self.multiDL = self.resumeDownload = True
def handleFree(self):
- found = re.search(self.DOWNLOAD_FORM_PATTERN, self.html)
- if found is None: self.parseError("Download form")
- url = "http://bezvadata.cz" + found.group(1)
- self.logDebug("Download form: %s" % url)
-
- self.download(url, post = {"stahnoutSoubor": "St%C3%A1hnout"}, cookies = True)
+ #download button
+ found = re.search(r'<a class="stahnoutSoubor".*?href="(.*?)"', self.html)
+ if not found: self.parseError("page1 URL")
+ url = "http://bezvadata.cz%s" % found.group(1)
+
+ #captcha form
+ self.html = self.load(url)
+ self.checkErrors()
+ for i in range(5):
+ action, inputs = self.parseHtmlForm('frm-stahnoutFreeForm')
+ if not inputs: self.parseError("FreeForm")
+
+ found = re.search(r'<img src="data:image/png;base64,(.*?)"', self.html)
+ if not found: self.parseError("captcha img")
+
+ #captcha image is contained in html page as base64encoded data but decryptCaptcha() expects image url
+ self.load, proper_load = self.loadcaptcha, self.load
+ try:
+ inputs['captcha'] = self.decryptCaptcha(found.group(1), imgtype='png')
+ finally:
+ self.load = proper_load
+
+ if '<img src="data:image/png;base64' in self.html:
+ self.invalidCaptcha()
+ else:
+ self.correctCaptcha()
+ break
+ else:
+ self.fail("No valid captcha code entered")
+
+ #download url
+ self.html = self.load("http://bezvadata.cz%s" % action, post=inputs)
+ self.checkErrors()
+ found = re.search(r'<a class="stahnoutSoubor2" href="(.*?)">', self.html)
+ if not found: self.parseError("page2 URL")
+ url = "http://bezvadata.cz%s" % found.group(1)
+ self.logDebug("DL URL %s" % url)
+
+ #countdown
+ found = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html)
+ wait_time = (int(found.group(1)) * 60 + int(found.group(2)) + 1) if found else 120
+ self.setWait(wait_time, False)
+ self.wait()
+
+ self.download(url)
+
+ def checkErrors(self):
+ if 'images/button-download-disable.png' in self.html:
+ self.longWait(300, 24) #parallel dl limit
+ elif '<div class="infobox' in self.html:
+ self.tempOffline()
+
+ def loadcaptcha(self, data, *args, **kwargs):
+ return data.decode("base64")
getInfo = create_getInfo(BezvadataCz)
- \ No newline at end of file
diff --git a/module/plugins/hoster/BillionuploadsCom.py b/module/plugins/hoster/BillionuploadsCom.py
new file mode 100644
index 000000000..5b053d547
--- /dev/null
+++ b/module/plugins/hoster/BillionuploadsCom.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class BillionuploadsCom(XFileSharingPro):
+ __name__ = "BillionuploadsCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?billionuploads.com/\w{12}"
+ __version__ = "0.01"
+ __description__ = """billionuploads.com hoster plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ FILE_NAME_PATTERN = r'<b>Filename:</b>(?P<N>.*?)<br>'
+ FILE_SIZE_PATTERN = r'<b>Size:</b>(?P<S>.*?)<br>'
+ HOSTER_NAME = "billionuploads.com"
+
+getInfo = create_getInfo(BillionuploadsCom)
diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py
index f5d59d428..644345387 100644
--- a/module/plugins/hoster/BitshareCom.py
+++ b/module/plugins/hoster/BitshareCom.py
@@ -46,7 +46,7 @@ class BitshareCom(Hoster):
__name__ = "BitshareCom"
__type__ = "hoster"
__pattern__ = r"http://(www\.)?bitshare\.com/(files/(?P<id1>[a-zA-Z0-9]+)(/(?P<name>.*?)\.html)?|\?f=(?P<id2>[a-zA-Z0-9]+))"
- __version__ = "0.45"
+ __version__ = "0.47"
__description__ = """Bitshare.Com File Download Hoster"""
__author_name__ = ("paulking", "fragonib")
__author_mail__ = (None, "fragonib[AT]yahoo[DOT]es")
@@ -55,8 +55,9 @@ class BitshareCom(Hoster):
FILE_OFFLINE_PATTERN = r'''(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)'''
FILE_INFO_PATTERN = r'<h1>(Downloading|Streaming)\s(?P<name>.+?)\s-\s(?P<size>[\d.]+)\s(?P<units>..)yte</h1>'
FILE_AJAXID_PATTERN = r'var ajaxdl = "(.*?)";'
- CAPTCHA_KEY_PATTERN = r"http://api\.recaptcha\.net/challenge\?k=(.*?) "
-
+ CAPTCHA_KEY_PATTERN = r"http://api\.recaptcha\.net/challenge\?k=(.*?) "
+ TRAFFIC_USED_UP = r"Your Traffic is used up for today. Upgrade to premium to continue!"
+
def setup(self):
self.multiDL = self.premium
self.chunkLimit = 1
@@ -74,12 +75,21 @@ class BitshareCom(Hoster):
# Load main page
self.req.cj.setCookie(self.HOSTER_DOMAIN, "language_selection", "EN")
- self.html = self.load(self.pyfile.url, ref=False, decode=True, cookies = False)
+ self.html = self.load(self.pyfile.url, ref=False, decode=True)
# Check offline
if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None:
self.offline()
-
+
+ # Check Traffic used up
+ if re.search(BitshareCom.TRAFFIC_USED_UP, self.html) is not None:
+ self.logInfo("Your Traffic is used up for today. Wait 1800 seconds or reconnect!")
+ self.logDebug("Waiting %d seconds." % 1800)
+ self.setWait(1800, True)
+ self.wantReconnect = True
+ self.wait()
+ self.retry()
+
# File name
m = re.search(BitshareCom.__pattern__, self.pyfile.url)
name1 = m.group('name') if m is not None else None
@@ -124,8 +134,8 @@ class BitshareCom(Hoster):
else:
self.setWait(wait - 55, True)
self.wait()
- self.retry()
-
+ self.retry()
+
# Resolve captcha
if captcha == 1:
self.logDebug("File is captcha protected")
diff --git a/module/plugins/hoster/BoltsharingCom.py b/module/plugins/hoster/BoltsharingCom.py
new file mode 100644
index 000000000..2f42c8b23
--- /dev/null
+++ b/module/plugins/hoster/BoltsharingCom.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class BoltsharingCom(XFileSharingPro):
+ __name__ = "BoltsharingCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?boltsharing.com/\w{12}"
+ __version__ = "0.01"
+ __description__ = """Boltsharing.com hoster plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ HOSTER_NAME = "boltsharing.com"
+
+getInfo = create_getInfo(BoltsharingCom)
diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py
new file mode 100644
index 000000000..47063096e
--- /dev/null
+++ b/module/plugins/hoster/CatShareNet.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+import re
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.ReCaptcha import ReCaptcha
+
+
+class CatShareNet(SimpleHoster):
+ __name__ = "CatShareNet"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?catshare.net/\w{16}.*"
+ __version__ = "0.01"
+ __description__ = """CatShare.net Download Hoster"""
+ __author_name__ = ("z00nx")
+ __author_mail__ = ("z00nx0@gmail.com")
+
+ FILE_INFO_PATTERN = r'<h3 class="pull-left"[^>]+>(?P<N>.*)</h3>\s+<h3 class="pull-right"[^>]+>(?P<S>.*)</h3>'
+ FILE_OFFLINE_PATTERN = r'Podany plik zosta'
+ SECONDS_PATTERN = 'var\s+count\s+=\s+(\d+);'
+ RECAPTCHA_KEY = "6Lfln9kSAAAAANZ9JtHSOgxUPB9qfDFeLUI_QMEy"
+
+ def handleFree(self):
+ found = re.search(self.SECONDS_PATTERN, self.html)
+ seconds = int(found.group(1))
+ self.logDebug("Seconds found", seconds)
+ self.setWait(seconds + 1)
+ self.wait()
+ recaptcha = ReCaptcha(self)
+ challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY)
+ post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": code}
+ self.download(self.pyfile.url, post=post_data)
+ check = self.checkDownload({"html": re.compile("\A<!DOCTYPE html PUBLIC")})
+ if check == "html":
+ self.logDebug("Wrong captcha entered")
+ self.invalidCaptcha()
+ self.retry()
+
+getInfo = create_getInfo(CatShareNet)
diff --git a/module/plugins/hoster/ChipDe.py b/module/plugins/hoster/ChipDe.py
new file mode 100644
index 000000000..fcb84a300
--- /dev/null
+++ b/module/plugins/hoster/ChipDe.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+from module.plugins.Crypter import Crypter
+
+class ChipDe(Crypter):
+ __name__ = "ChipDe"
+ __type__ = "container"
+ __pattern__ = r"http://(?:www\.)?chip.de/video/.*\.html"
+ __version__ = "0.1"
+ __description__ = """Chip.de Container Plugin"""
+ __author_name__ = ('4Christopher')
+ __author_mail__ = ('4Christopher@gmx.de')
+
+ def decrypt(self, pyfile):
+ self.html = self.load(pyfile.url)
+ try:
+ url = re.search(r'"(http://video.chip.de/\d+?/.*)"', self.html).group(1)
+ self.logDebug('The file URL is %s' % url)
+ except:
+ self.fail('Failed to find the URL')
+
+ self.packages.append((self.pyfile.package().name, [ url ], self.pyfile.package().folder))
diff --git a/module/plugins/hoster/CloudzerNet.py b/module/plugins/hoster/CloudzerNet.py
new file mode 100644
index 000000000..08a54d509
--- /dev/null
+++ b/module/plugins/hoster/CloudzerNet.py
@@ -0,0 +1,65 @@
+# -*- coding: utf-8 -*-
+import re
+from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
+from module.common.json_layer import json_loads
+from module.plugins.ReCaptcha import ReCaptcha
+from module.network.RequestFactory import getURL
+
+
+def getInfo(urls):
+ for url in urls:
+ header = getURL(url, just_header=True)
+ if 'Location: http://cloudzer.net/404' in header:
+ file_info = (url, 0, 1, url)
+ else:
+ file_info = parseFileInfo(CloudzerNet, url, getURL(url, decode=True))
+ yield file_info
+
+
+class CloudzerNet(SimpleHoster):
+ __name__ = "CloudzerNet"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?(cloudzer\.net/file/|clz\.to/(file/)?)(?P<ID>\w+).*"
+ __version__ = "0.01"
+ __description__ = """Cloudzer.net hoster plugin"""
+ __author_name__ = ("gs", "z00nx")
+ __author_mail__ = ("I-_-I-_-I@web.de", "z00nx0@gmail.com")
+
+ FILE_SIZE_PATTERN = '<span class="size">(?P<S>[^<]+)</span>'
+ WAIT_PATTERN = '<meta name="wait" content="(\d+)">'
+ FILE_OFFLINE_PATTERN = r'Please check the URL for typing errors, respectively'
+ CAPTCHA_KEY = '6Lcqz78SAAAAAPgsTYF3UlGf2QFQCNuPMenuyHF3'
+
+ def handleFree(self):
+ found = re.search(self.WAIT_PATTERN, self.html)
+ seconds = int(found.group(1))
+ self.logDebug("Found wait", seconds)
+ self.setWait(seconds + 1)
+ self.wait()
+ response = self.load('http://cloudzer.net/io/ticket/slot/%s' % self.file_info['ID'], post=' ', cookies=True)
+ self.logDebug("Download slot request response", response)
+ response = json_loads(response)
+ if response["succ"] is not True:
+ self.fail("Unable to get a download slot")
+
+ recaptcha = ReCaptcha(self)
+ challenge, response = recaptcha.challenge(self.CAPTCHA_KEY)
+ post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response}
+ response = json_loads(self.load('http://cloudzer.net/io/ticket/captcha/%s' % self.file_info['ID'], post=post_data, cookies=True))
+ self.logDebug("Captcha check response", response)
+ self.logDebug("First check")
+
+ if "err" in response:
+ if response["err"] == "captcha":
+ self.logDebug("Wrong captcha")
+ self.invalidCaptcha()
+ self.retry()
+ elif "Sie haben die max" in response["err"] or "You have reached the max" in response["err"]:
+ self.logDebug("Download limit reached, waiting an hour")
+ self.setWait(3600)
+ self.wait()
+ if "type" in response:
+ if response["type"] == "download":
+ url = response["url"]
+ self.logDebug("Download link", url)
+ self.download(url, disposition=True)
diff --git a/module/plugins/hoster/CoolshareCz.py b/module/plugins/hoster/CoolshareCz.py
deleted file mode 100644
index 7007b6fcb..000000000
--- a/module/plugins/hoster/CoolshareCz.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
-"""
-
-#shares code with WarserverCz
-
-import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.network.HTTPRequest import BadHeader
-from module.utils import html_unescape
-
-class CoolshareCz(SimpleHoster):
- __name__ = "CoolshareCz"
- __type__ = "hoster"
- __pattern__ = r"http://(?:\w*\.)?coolshare.cz/stahnout/(?P<ID>\d+)/.+"
- __version__ = "0.12"
- __description__ = """CoolShare.cz"""
- __author_name__ = ("zoidberg")
-
- FILE_NAME_PATTERN = ur'<h1.*?>Stáhnout (?P<N>[^<]+)</h1>'
- FILE_SIZE_PATTERN = r'<li>Velikost: <strong>(?P<S>[^<]+)</strong>'
- FILE_OFFLINE_PATTERN = r'<h1>Soubor nenalezen</h1>'
-
- PREMIUM_URL_PATTERN = r'href="(http://[^/]+/dwn-premium.php.*?)"'
- DOMAIN = "http://csd01.coolshare.cz"
-
- SH_CHECK_TRAFFIC = True
-
- def handleFree(self):
- try:
- self.download("%s/dwn-free.php?fid=%s" % (self.DOMAIN, self.file_info['ID']))
- except BadHeader, e:
- if e.code == 403:
- self.setWait(300, True)
- self.wait()
- self.retry(max_tries = 24, reason = "Download limit reached")
- else: raise
-
- def handlePremium(self):
- found = re.search(self.PREMIUM_URL_PATTERN, self.html)
- if not found: self.parseError("Premium URL")
- url = html_unescape(found.group(1))
- self.logDebug("Premium URL: " + url)
- if not url.startswith("http://"): self.resetAccount()
- self.download(url)
-
-getInfo = create_getInfo(CoolshareCz) \ No newline at end of file
diff --git a/module/plugins/hoster/CramitIn.py b/module/plugins/hoster/CramitIn.py
index a7935c744..171fba0ff 100644
--- a/module/plugins/hoster/CramitIn.py
+++ b/module/plugins/hoster/CramitIn.py
@@ -5,7 +5,7 @@ class CramitIn(XFileSharingPro):
__name__ = "CramitIn"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*cramit.in/\w{12}"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """Cramit.in hoster plugin"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -15,6 +15,6 @@ class CramitIn(XFileSharingPro):
HOSTER_NAME = "cramit.in"
def setup(self):
- self.multiDL = self.premium
+ self.resumeDownload = self.multiDL = self.premium
getInfo = create_getInfo(CramitIn) \ No newline at end of file
diff --git a/module/plugins/hoster/CyberlockerCh.py b/module/plugins/hoster/CyberlockerCh.py
new file mode 100644
index 000000000..57dd26787
--- /dev/null
+++ b/module/plugins/hoster/CyberlockerCh.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class CyberlockerCh(XFileSharingPro):
+ __name__ = "CyberlockerCh"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?cyberlocker\.ch/\w{12}"
+ __version__ = "0.01"
+ __description__ = """Cyberlocker.ch hoster plugin"""
+ __author_name__ = ("stickell")
+ __author_mail__ = ("l.stickell@yahoo.it")
+
+ HOSTER_NAME = "cyberlocker.ch"
+
+getInfo = create_getInfo(CyberlockerCh)
diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py
index 538e3ed86..a4a811e82 100644
--- a/module/plugins/hoster/CzshareCom.py
+++ b/module/plugins/hoster/CzshareCom.py
@@ -17,42 +17,24 @@
"""
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
-from module.network.RequestFactory import getURL
-
-def toInfoPage(url):
- if r"/download.php?" in url:
- try:
- id = re.search(r"id=(\d+)", url).group(1)
- code = re.search(r"code=(\w+)", url).group(1)
- except Exception, e:
- return None
- return "http://czshare.com/%s/%s/" % (id, code)
- return url
-
-def getInfo(urls):
- result = []
-
- for url in urls:
- info_url = toInfoPage(url)
- if info_url:
- file_info = parseFileInfo(CzshareCom, url, getURL(info_url, decode=True))
- result.append(file_info)
-
- yield result
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError
+from module.utils import parseFileSize
class CzshareCom(SimpleHoster):
__name__ = "CzshareCom"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)*czshare\.(com|cz)/(\d+/|download.php\?).*"
- __version__ = "0.88"
+ __version__ = "0.92"
__description__ = """CZshare.com"""
__author_name__ = ("zoidberg")
FILE_NAME_PATTERN = r'<div class="tab" id="parameters">\s*<p>\s*Cel. n.zev: <a href=[^>]*>(?P<N>[^<]+)</a>'
FILE_SIZE_PATTERN = r'<div class="tab" id="category">(?:\s*<p>[^\n]*</p>)*\s*Velikost:\s*(?P<S>[0-9., ]+)(?P<U>[kKMG])i?B\s*</div>'
FILE_OFFLINE_PATTERN = r'<div class="header clearfix">\s*<h2 class="red">'
+
FILE_SIZE_REPLACEMENTS = [(' ', '')]
+ FILE_URL_REPLACEMENTS = [(r'http://[^/]*/download.php\?.*?id=(\w+).*', r'http://czshare.com/\1/x/')]
+ SH_CHECK_TRAFFIC = True
FREE_URL_PATTERN = r'<a href="([^"]+)" class="page-download">[^>]*alt="([^"]+)" /></a>'
FREE_FORM_PATTERN = r'<form action="download.php" method="post">\s*<img src="captcha.php" id="captcha" />(.*?)</form>'
@@ -65,20 +47,7 @@ class CzshareCom(SimpleHoster):
self.multiDL = self.resumeDownload = True if self.premium else False
self.chunkLimit = 1
- def process(self, pyfile):
- url = toInfoPage(pyfile.url)
- if not url:
- self.logError(e)
- self.fail("Invalid URL")
-
- self.html = self.load(url, cookies=True, decode=True)
- self.getFileInfo()
-
- if not self.account or not self.handlePremium():
- self.handleFree()
- self.checkDownloadedFile()
-
- def handlePremium(self):
+ def checkTrafficLeft(self):
# check if user logged in
found = re.search(self.USER_CREDIT_PATTERN, self.html)
if not found:
@@ -89,17 +58,19 @@ class CzshareCom(SimpleHoster):
# check user credit
try:
- credit = float(found.group(1).replace(',','.').replace(' ',''))
- credit = credit * 1024 ** {'KB': 0, 'MB': 1, 'GB': 2}[found.group(2)]
+ credit = parseFileSize(found.group(1).replace(' ',''), found.group(2))
self.logInfo("Premium download for %i KiB of Credit" % (self.pyfile.size / 1024))
- self.logInfo("User %s has %i KiB left" % (self.user, credit))
- if credit * 1024 < self.pyfile.size:
+ self.logInfo("User %s has %i KiB left" % (self.user, credit / 1024))
+ if credit < self.pyfile.size:
self.logInfo("Not enough credit to download file %s" % self.pyfile.name)
- self.resetAccount()
+ return False
except Exception, e:
# let's continue and see what happens...
self.logError('Parse error (CREDIT): %s' % e)
-
+
+ return True
+
+ def handlePremium(self):
# parse download link
try:
form = re.search(self.PREMIUM_FORM_PATTERN, self.html, re.DOTALL).group(1)
@@ -110,22 +81,20 @@ class CzshareCom(SimpleHoster):
# download the file, destination is determined by pyLoad
self.download("http://czshare.com/profi_down.php", cookies=True, post=inputs)
- return True
+ self.checkDownloadedFile()
def handleFree(self):
# get free url
found = re.search(self.FREE_URL_PATTERN, self.html)
if found is None:
- raise PluginParseError('Free URL')
+ raise PluginParseError('Free URL')
parsed_url = "http://czshare.com" + found.group(1)
self.logDebug("PARSED_URL:" + parsed_url)
# get download ticket and parse html
- self.html = self.load(parsed_url, cookies=True)
-
- #if not re.search(self.FREE_FORM_PATTERN, self.html):
+ self.html = self.load(parsed_url, cookies=True, decode=True)
if re.search(self.MULTIDL_PATTERN, self.html):
- self.waitForFreeSlot()
+ self.longWait(300, 12)
try:
form = re.search(self.FREE_FORM_PATTERN, self.html, re.DOTALL).group(1)
@@ -135,12 +104,20 @@ class CzshareCom(SimpleHoster):
self.logError(e)
raise PluginParseError('Form')
- # get and decrypt captcha
+ # get and decrypt captcha
captcha_url = 'http://czshare.com/captcha.php'
- inputs['captchastring2'] = self.decryptCaptcha(captcha_url)
- self.logDebug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + inputs['captchastring2'])
-
- self.html = self.load(parsed_url, cookies=True, post=inputs)
+ for i in range(5):
+ inputs['captchastring2'] = self.decryptCaptcha(captcha_url)
+ self.html = self.load(parsed_url, cookies=True, post=inputs, decode=True)
+ if u"<li>Zadaný ověřovací kód nesouhlasí!</li>" in self.html:
+ self.invalidCaptcha()
+ elif re.search(self.MULTIDL_PATTERN, self.html):
+ self.longWait(300, 12)
+ else:
+ self.correctCaptcha()
+ break
+ else:
+ self.fail("No valid captcha code entered")
found = re.search("countdown_number = (\d+);", self.html)
self.setWait(int(found.group(1)) if found else 50)
@@ -155,26 +132,26 @@ class CzshareCom(SimpleHoster):
self.wait()
self.multiDL = True
- self.download(url)
+ self.download(url)
+ self.checkDownloadedFile()
def checkDownloadedFile(self):
# check download
check = self.checkDownload({
- "tempoffline": re.compile(r"^Soubor je do.asn. nedostupn.$"),
+ "tempoffline": re.compile(r"^Soubor je do.*asn.* nedostupn.*$"),
+ "credit": re.compile(r"^Nem.*te dostate.*n.* kredit.$"),
"multi_dl": re.compile(self.MULTIDL_PATTERN),
"captcha_err": "<li>Zadaný ověřovací kód nesouhlasí!</li>"
})
if check == "tempoffline":
self.fail("File not available - try later")
+ if check == "credit":
+ self.resetAccount()
elif check == "multi_dl":
- self.waitForFreeSlot()
+ self.longWait(300, 12)
elif check == "captcha_err":
self.invalidCaptcha()
self.retry()
-
- def waitForFreeSlot(self, wait_time = 300):
- self.multiDL = False
- self.setWait(wait_time, True)
- self.wait()
- self.retry() \ No newline at end of file
+
+getInfo = create_getInfo(CzshareCom)
diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py
new file mode 100644
index 000000000..1b411393d
--- /dev/null
+++ b/module/plugins/hoster/DailymotionCom.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+from urllib import unquote
+from module.plugins.Hoster import Hoster
+
+class DailymotionCom(Hoster):
+ __name__ = 'DailymotionCom'
+ __type__ = 'hoster'
+ __pattern__ = r'http://www.dailymotion.com/.*'
+ __version__ = '0.1'
+ __description__ = """Dailymotion Video Download Hoster"""
+ __author_name__ = ("Peekayy")
+ __author_mail__ = ("peekayy.dev@gmail.com")
+
+ def process(self, pyfile):
+ html = self.load(pyfile.url, decode=True)
+
+ for pattern in (r'name="title" content="Dailymotion \\-(.*?)\\- ein Film',
+ r'class="title" title="(.*?)"',
+ r'<span class="title foreground" title="(.*?)">',
+ r'"(?:vs_videotitle|videoTitle|dm_title|ss_mediaTitle)": "(.*?)"'):
+ filename = re.search(pattern, html)
+ if filename is not None: break
+ else:
+ self.fail("Unable to find file name")
+
+ pyfile.name = filename.group(1)+'.mp4'
+ self.logDebug('Filename='+pyfile.name)
+ allLinksInfo = re.search(r'"sequence":"(.*?)"', html)
+ self.logDebug(allLinksInfo.groups())
+ allLinksInfo = unquote(allLinksInfo.group(1))
+
+ for quality in ('hd720URL', 'hqURL', 'sdURL', 'ldURL', ''):
+ dlLink = self.getQuality(quality, allLinksInfo)
+ if dlLink is not None: break
+ else:
+ self.fail(r'Unable to find video URL')
+
+ self.logDebug(dlLink)
+ self.download(dlLink)
+
+ def getQuality(self, quality, data):
+ link = re.search('"' + quality + '":"(http:[^<>"\']+)"', data)
+ if link is not None:
+ return link.group(1).replace('\\','') \ No newline at end of file
diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py
index cef115941..3dc581bf1 100644
--- a/module/plugins/hoster/DataportCz.py
+++ b/module/plugins/hoster/DataportCz.py
@@ -23,14 +23,15 @@ from pycurl import FOLLOWLOCATION
class DataportCz(SimpleHoster):
__name__ = "DataportCz"
__type__ = "hoster"
- __pattern__ = r"http://.*dataport.cz/file/.*"
- __version__ = "0.35"
+ __pattern__ = r"http://(?:.*?\.)?dataport.cz/file/(.*)"
+ __version__ = "0.37"
__description__ = """Dataport.cz plugin - free only"""
__author_name__ = ("zoidberg")
FILE_NAME_PATTERN = r'<span itemprop="name">(?P<N>[^<]+)</span>'
FILE_SIZE_PATTERN = r'<td class="fil">Velikost</td>\s*<td>(?P<S>[^<]+)</td>'
FILE_OFFLINE_PATTERN = r'<h2>Soubor nebyl nalezen</h2>'
+ FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.dataport.cz/file/\1')]
CAPTCHA_URL_PATTERN = r'<section id="captcha_bg">\s*<img src="(.*?)"'
FREE_SLOTS_PATTERN = ur'Počet volných slotů: <span class="darkblue">(\d+)</span><br />'
@@ -49,7 +50,7 @@ class DataportCz(SimpleHoster):
else:
raise PluginParseError('captcha')
- self.html = self.download("http://dataport.cz%s" % action, post = inputs)
+ self.html = self.download("http://www.dataport.cz%s" % action, post = inputs)
check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");',
"slot": 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'})
diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py
index 529a5a06f..8d994c179 100644
--- a/module/plugins/hoster/DateiTo.py
+++ b/module/plugins/hoster/DateiTo.py
@@ -24,7 +24,7 @@ class DateiTo(SimpleHoster):
__name__ = "DateiTo"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?datei\.to/datei/(?P<ID>\w+)\.html"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """Datei.to plugin - free only"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -77,6 +77,8 @@ class DateiTo(SimpleHoster):
def checkErrors(self):
found = re.search(self.PARALELL_PATTERN, self.html)
if found:
+ found = re.search(self.WAIT_PATTERN, self.html)
+ wait_time = int(found.group(1)) if found else 30
self.setWait(wait_time + 1, False)
self.wait(300)
self.retry()
diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py
new file mode 100644
index 000000000..5142bbdf7
--- /dev/null
+++ b/module/plugins/hoster/DebridItaliaCom.py
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.Hoster import Hoster
+
+
+class DebridItaliaCom(Hoster):
+ __name__ = "DebridItaliaCom"
+ __version__ = "0.01"
+ __type__ = "hoster"
+ __pattern__ = r"https?://.*debriditalia\.com"
+ __description__ = """Debriditalia.com hoster plugin"""
+ __author_name__ = ("stickell")
+ __author_mail__ = ("l.stickell@yahoo.it")
+
+ def init(self):
+ self.chunkLimit = -1
+ self.resumeDownload = True
+
+ def process(self, pyfile):
+ if not self.account:
+ self.logError("Please enter your DebridItalia account or deactivate this plugin")
+ self.fail("No DebridItalia account provided")
+
+ self.logDebug("Old URL: %s" % pyfile.url)
+ if re.match(self.__pattern__, pyfile.url):
+ new_url = pyfile.url
+ else:
+ url = "http://debriditalia.com/linkgen2.php?xjxfun=convertiLink&xjxargs[]=S<![CDATA[%s]]>" % pyfile.url
+ page = self.load(url)
+ self.logDebug("XML data: %s" % page)
+
+ new_url = re.search(r'<a href="(?:[^"]+)">(?P<direct>[^<]+)</a>', page).group('direct')
+
+ self.logDebug("New URL: %s" % new_url)
+
+ self.download(new_url, disposition=True) \ No newline at end of file
diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py
index 9c13a5f3a..eb64ae4de 100644
--- a/module/plugins/hoster/DepositfilesCom.py
+++ b/module/plugins/hoster/DepositfilesCom.py
@@ -10,8 +10,8 @@ from module.plugins.ReCaptcha import ReCaptcha
class DepositfilesCom(SimpleHoster):
__name__ = "DepositfilesCom"
__type__ = "hoster"
- __pattern__ = r"http://[\w\.]*?depositfiles\.com(/\w{1,3})?/files/[\w]+"
- __version__ = "0.42"
+ __pattern__ = r"http://[\w\.]*?(depositfiles\.com|dfiles\.eu)(/\w{1,3})?/files/[\w]+"
+ __version__ = "0.43"
__description__ = """Depositfiles.com Download Hoster"""
__author_name__ = ("spoob", "zoidberg")
__author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz")
@@ -24,7 +24,7 @@ class DepositfilesCom(SimpleHoster):
FILE_NAME_REPLACEMENTS = [(r'\%u([0-9A-Fa-f]{4})', lambda m: unichr(int(m.group(1), 16))), (r'.*<b title="(?P<N>[^"]+).*', "\g<N>" )]
RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'"
- DOWNLOAD_LINK_PATTERN = r'<form action="(http://.+?\.depositfiles.com/.+?)" method="get"'
+ DOWNLOAD_LINK_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"'
def setup(self):
self.multiDL = False
@@ -109,4 +109,4 @@ class DepositfilesCom(SimpleHoster):
self.multiDL = True
self.download(link, disposition = True)
-getInfo = create_getInfo(DepositfilesCom) \ No newline at end of file
+getInfo = create_getInfo(DepositfilesCom)
diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py
index 5b318fd54..67c2d6c17 100644
--- a/module/plugins/hoster/DlFreeFr.py
+++ b/module/plugins/hoster/DlFreeFr.py
@@ -92,7 +92,7 @@ class DlFreeFr(SimpleHoster):
__name__ = "DlFreeFr"
__type__ = "hoster"
__pattern__ = r"http://dl\.free\.fr/([a-zA-Z0-9]+|getfile\.pl\?file=/[a-zA-Z0-9]+)"
- __version__ = "0.23"
+ __version__ = "0.24"
__description__ = """dl.free.fr download hoster"""
__author_name__ = ("the-razer", "zoidberg", "Toilal")
__author_mail__ = ("daniel_ AT gmx DOT net", "zoidberg@mujmail.cz", "toilal.dev@gmail.com")
@@ -145,7 +145,7 @@ class DlFreeFr(SimpleHoster):
result = adyoulike.result(ayl, challenge)
inputs.update(result)
- data = self.load("http://dl.free.fr/getfile.pl", post = inputs)
+ self.load("http://dl.free.fr/getfile.pl", post = inputs)
headers = self.getLastHeaders()
if headers.get("code") == 302 and headers.has_key("set-cookie") and headers.has_key("location"):
found = re.search("(.*?)=(.*?); path=(.*?); domain=(.*?)", headers.get("set-cookie"))
diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py
index 5f3159b20..0deaa782e 100644
--- a/module/plugins/hoster/EasybytezCom.py
+++ b/module/plugins/hoster/EasybytezCom.py
@@ -25,7 +25,7 @@ class EasybytezCom(XFileSharingPro):
__name__ = "EasybytezCom"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w+).*"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """easybytez.com"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -38,6 +38,7 @@ class EasybytezCom(XFileSharingPro):
DIRECT_LINK_PATTERN = r'(http://(\w+\.easybytez\.com|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)'
OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)'
+ ERROR_PATTERN = r'(?:class=["\']err["\'][^>]*>|<Center><b>)(.*?)</'
HOSTER_NAME = "easybytez.com"
diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py
new file mode 100644
index 000000000..b27abb416
--- /dev/null
+++ b/module/plugins/hoster/EgoFilesCom.py
@@ -0,0 +1,75 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.ReCaptcha import ReCaptcha
+import re
+
+
+class EgoFilesCom(SimpleHoster):
+ __name__ = "EgoFilesCom"
+ __type__ = "hoster"
+ __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)"
+ __version__ = "0.10"
+ __description__ = """Egofiles.com Download Hoster"""
+ __author_name__ = ("stickell")
+ __author_mail__ = ("l.stickell@yahoo.it")
+
+ FILE_INFO_PATTERN = r'<div class="down-file">\s+(?P<N>\S+)\s+<div class="file-properties">\s+(File size|Rozmiar): (?P<S>[\w.]+) (?P<U>\w+) \|'
+ FILE_OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB'
+ WAIT_TIME_PATTERN = r'For next free download you have to wait <strong>((?P<m>\d*)m)? ?((?P<s>\d+)s)?</strong>'
+ DIRECT_LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>'
+ RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX'
+
+ def init(self):
+ self.file_info = {}
+ # Set English language
+ self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True)
+
+ def handleFree(self):
+ self.html = self.load(self.pyfile.url, decode=True)
+
+ # Wait time between free downloads
+ if 'For next free download you have to wait' in self.html:
+ m = re.search(self.WAIT_TIME_PATTERN, self.html).groupdict('0')
+ waittime = int(m['m']) * 60 + int(m['s'])
+ self.setWait(waittime, True)
+ self.wait()
+
+ downloadURL = ''
+ recaptcha = ReCaptcha(self)
+ for i in xrange(5):
+ challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
+ post_data = {'recaptcha_challenge_field': challenge,
+ 'recaptcha_response_field': response}
+ self.html = self.load(self.pyfile.url, post=post_data, decode=True)
+ m = re.search(self.DIRECT_LINK_PATTERN, self.html)
+ if not m:
+ self.logInfo('Wrong captcha')
+ self.invalidCaptcha()
+ elif hasattr(m, 'group'):
+ downloadURL = m.group('link')
+ self.correctCaptcha()
+ break
+ else:
+ self.fail('Unknown error - Plugin may be out of date')
+
+ if not downloadURL:
+ self.fail("No Download url retrieved/all captcha attempts failed")
+
+ self.download(downloadURL)
+
+ def handlePremium(self):
+ header = self.load(self.pyfile.url, just_header=True)
+ if header.has_key('location'):
+ self.logDebug('DIRECT LINK from header: ' + header['location'])
+ self.download(header['location'])
+ else:
+ self.html = self.load(self.pyfile.url, decode=True)
+ m = re.search(r'<a href="(?P<link>[^"]+)">Download ></a>', self.html)
+ if not m:
+ self.parseError('Unable to detect direct download url')
+ else:
+ self.logDebug('DIRECT URL from html: ' + m.group('link'))
+ self.download(m.group('link'))
+
+getInfo = create_getInfo(EgoFilesCom)
diff --git a/module/plugins/hoster/EnteruploadCom.py b/module/plugins/hoster/EnteruploadCom.py
deleted file mode 100644
index 2c99b0047..000000000
--- a/module/plugins/hoster/EnteruploadCom.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
-"""
-
-import re
-from module.plugins.internal.DeadHoster import DeadHoster as SimpleHoster, create_getInfo
-
-class EnteruploadCom(SimpleHoster):
- __name__ = "EnteruploadCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?enterupload.com/\w+.*"
- __version__ = "0.02"
- __description__ = """EnterUpload.com plugin - free only"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- FILE_INFO_PATTERN = r'<h3>(?P<N>[^<]+)</h3>\s*<span>File size:\s*(?P<S>[0-9.]+)\s*(?P<U>[kKMG])i?B</span>'
- FILE_OFFLINE_PATTERN = r'<(b|h2)>File Not Found</(b|h2)>|<font class="err">No such file with this filename</font>'
- TEMP_OFFLINE_PATTERN = r'>This server is in maintenance mode\. Refresh this page in some minutes\.<'
- URL_REPLACEMENTS = [(r"(http://(?:www\.)?enterupload.com/\w+).*", r"\1")]
-
- FORM1_PATTERN = r'<form method="POST" action=\'\' style="display: none;">(.*?)</form>'
- FORM2_PATTERN = r'<form name="F1" method="POST"[^>]*>(.*?)</form>'
- FORM3_PATTERN = r'<form action="([^"]+)" method="get">'
- FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)" value="([^"]*)"[^>]*>'
- WAIT_PATTERN = r'<span id="countdown_str">Wait <[^>]*>(\d+)</span> seconds</span>'
-
- def handleFree(self):
- # Page 1
- try:
- form = re.search(self.FORM1_PATTERN, self.html, re.DOTALL).group(1)
- inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
- except Exception, e:
- self.logError(e)
- self.parseError("Form 1")
-
- inputs['method_free'] = 'Free Download'
- self.logDebug(inputs)
- self.html = self.load(self.pyfile.url, post = inputs, decode = True, cookies = True, ref = True)
-
- # Page 2
- try:
- form = re.search(self.FORM2_PATTERN, self.html, re.DOTALL).group(1)
- inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
- except Exception, e:
- self.logError(e)
- self.parseError("Form 2")
-
- inputs['method_free'] = self.pyfile.url
- self.logDebug(inputs)
-
- found = re.search(self.WAIT_PATTERN, self.html)
- if found:
- self.setWait(int(found.group(1)) + 1)
- self.wait()
-
- self.html = self.load(self.pyfile.url, post = inputs, decode = True, cookies = True, ref = True)
-
- # Page 3
- found = re.search(self.FORM3_PATTERN, self.html)
- if not found: self.parseError("Form 3")
- url = found.group(1)
-
- # Download
- self.logDebug("Download URL: " + url)
- self.download(url, cookies = True, ref = True)
-
-getInfo = create_getInfo(EnteruploadCom) \ No newline at end of file
diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py
index 1e1cc0b4b..5224dfd9f 100644
--- a/module/plugins/hoster/EuroshareEu.py
+++ b/module/plugins/hoster/EuroshareEu.py
@@ -17,54 +17,58 @@
"""
import re
-from module.plugins.Hoster import Hoster
-from module.network.RequestFactory import getURL
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-def getInfo(urls):
- result = []
-
- for url in urls:
-
- html = getURL(url, decode=True)
- if re.search(EuroshareEu.FILE_OFFLINE_PATTERN, html):
- # File offline
- result.append((url, 0, 1, url))
- else:
- result.append((url, 0, 2, url))
- yield result
-
-class EuroshareEu(Hoster):
+class EuroshareEu(SimpleHoster):
__name__ = "EuroshareEu"
__type__ = "hoster"
- __pattern__ = r"http://(\w*\.)?euroshare.eu/file/.*"
- __version__ = "0.30"
+ __pattern__ = r"http://(\w*\.)?euroshare.(eu|sk|cz|hu|pl)/file/.*"
+ __version__ = "0.25"
__description__ = """Euroshare.eu"""
__author_name__ = ("zoidberg")
- URL_PATTERN = r'<a class="free" href="([^"]+)"></a>'
- FILE_OFFLINE_PATTERN = r'<h2>S.bor sa nena.iel</h2>'
- ERR_PARDL_PATTERN = r'<h2>Prebieha s.ahovanie</h2>'
-
- def setup(self):
- self.multiDL = False
+ FILE_INFO_PATTERN = r'<span style="float: left;"><strong>(?P<N>.+?)</strong> \((?P<S>.+?)\)</span>'
+ FILE_OFFLINE_PATTERN = ur'<h2>S.bor sa nena.iel</h2>|Požadovaná stránka neexistuje!'
- def process(self, pyfile):
- self.html = self.load(pyfile.url, decode=True)
+ FREE_URL_PATTERN = r'<a href="(/file/\d+/[^/]*/download/)"><div class="downloadButton"'
+ ERR_PARDL_PATTERN = r'<h2>Prebieha s.ahovanie</h2>|<p>Naraz je z jednej IP adresy mo.n. s.ahova. iba jeden s.bor'
+ ERR_NOT_LOGGED_IN_PATTERN = r'href="/customer-zone/login/"'
- if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None:
- self.offline()
+ FILE_URL_REPLACEMENTS = [(r"(http://[^/]*\.)(sk|cz|hu|pl)/", r"\1eu/")]
+ def setup(self):
+ self.multiDL = self.resumeDownload = self.premium
+ self.req.setOption("timeout", 120)
+
+ def handlePremium(self):
+ if self.ERR_NOT_LOGGED_IN_PATTERN in self.html:
+ self.account.relogin(self.user)
+ self.retry(reason="User not logged in")
+
+ self.download(self.pyfile.url.rstrip('/') + "/download/")
+
+ check = self.checkDownload({"login": re.compile(self.ERR_NOT_LOGGED_IN_PATTERN),
+ "json": re.compile(r'\{"status":"error".*?"message":"(.*?)"')
+ })
+ if check == "login" or (check == "json" and self.lastCheck.group(1) == "Access token expired"):
+ self.account.relogin(self.user)
+ self.retry(reason="Access token expired")
+ elif check == "json":
+ self.fail(self.lastCheck.group(1))
+
+ def handleFree(self):
if re.search(self.ERR_PARDL_PATTERN, self.html) is not None:
- self.waitForFreeSlot()
+ self.longWait(300, 12)
- found = re.search(self.URL_PATTERN, self.html)
+ found = re.search(self.FREE_URL_PATTERN, self.html)
if found is None:
- self.fail("Parse error (URL)")
- parsed_url = found.group(1)
-
+ self.parseError("Parse error (URL)")
+ parsed_url = "http://euroshare.eu%s" % found.group(1)
+ self.logDebug("URL", parsed_url)
self.download(parsed_url, disposition=True)
- def waitForFreeSlot(self):
- self.setWait(300, True)
- self.wait()
- self.retry() \ No newline at end of file
+ check = self.checkDownload({"multi_dl": re.compile(self.ERR_PARDL_PATTERN)})
+ if check == "multi_dl":
+ self.longWait(300, 12)
+
+getInfo = create_getInfo(EuroshareEu) \ No newline at end of file
diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py
index 654a1abe8..cc0b18c96 100644
--- a/module/plugins/hoster/FastshareCz.py
+++ b/module/plugins/hoster/FastshareCz.py
@@ -23,30 +23,55 @@ class FastshareCz(SimpleHoster):
__name__ = "FastshareCz"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?fastshare.cz/\d+/.+"
- __version__ = "0.12"
+ __version__ = "0.14"
__description__ = """FastShare.cz"""
__author_name__ = ("zoidberg")
- FILE_NAME_PATTERN = r'<h3><b><span style=color:black;>(?P<N>[^<]+)</b></h3>'
+ FILE_NAME_PATTERN = r'<h[23]><b><span style=color:black;>(?P<N>[^<]+)</b></h[23]>'
FILE_SIZE_PATTERN = r'<tr><td>Velikost: </td><td style=font-weight:bold>(?P<S>[^<]+)</td></tr>'
- FILE_OFFLINE_PATTERN = r'<div id="content">\s*<div style=background-color:white'
- SH_HTML_ENCODING = 'cp1250'
+ FILE_OFFLINE_PATTERN = ur'<td align=center>Tento soubor byl smazán'
+ SH_COOKIES = [("fastshare.cz","lang","cs")]
+ FILE_URL_REPLACEMENTS = [('#.*','')]
FREE_URL_PATTERN = ur'<form method=post action=(/free/.*?)><b>Stáhnout FREE.*?<img src="([^"]*)">'
+ 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 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")
+
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"})
- check = self.checkDownload({"paralell_dl": "<script>alert('Pres FREE muzete stahovat jen jeden soubor najednou.')"})
+ check = self.checkDownload({
+ "paralell_dl": "<title>FastShare.cz</title>|<script>alert\('Pres FREE muzete stahovat jen jeden soubor najednou.'\)"
+ })
self.logDebug(self.req.lastEffectiveURL, self.req.lastURL, self.req.code)
if check == "paralell_dl":
self.setWait(600, True)
self.wait()
- self.retry()
+ self.retry(6, "Paralell download")
+
+ def handlePremium(self):
+ if self.NOT_ENOUGH_CREDIC_PATTERN in self.html:
+ self.logWarning('Not enough traffic left')
+ self.resetAccount()
+
+ found = re.search(self.PREMIUM_URL_PATTERN, self.html)
+ if not found: self.parseError("Premium URL")
+ url = found.group(1)
+ self.logDebug("PREMIUM URL: %s" % url)
+ self.download(url)
+
+ check = self.checkDownload({"credit": re.compile(self.NOT_ENOUGH_CREDIC_PATTERN)})
+ if check == "credit":
+ self.resetAccount()
getInfo = create_getInfo(FastshareCz) \ No newline at end of file
diff --git a/module/plugins/hoster/FilebeerInfo.py b/module/plugins/hoster/FilebeerInfo.py
new file mode 100644
index 000000000..216ecfbca
--- /dev/null
+++ b/module/plugins/hoster/FilebeerInfo.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
+
+
+class FilebeerInfo(DeadHoster):
+ __name__ = "FilebeerInfo"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:www\.)?filebeer\.info/(?!\d*~f)(?P<ID>\w+).*"
+ __version__ = "0.03"
+ __description__ = """Filebeer.info plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+
+getInfo = create_getInfo(FilebeerInfo) \ No newline at end of file
diff --git a/module/plugins/hoster/FiledinoCom.py b/module/plugins/hoster/FiledinoCom.py
deleted file mode 100644
index 6bdd01b51..000000000
--- a/module/plugins/hoster/FiledinoCom.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
-import re
-
-class FiledinoCom(XFileSharingPro):
- __name__ = "FiledinoCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:\w*\.)*(file(dino|fat).com)/\w{12}"
- __version__ = "0.02"
- __description__ = """FileDino / FileFat hoster plugin"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- FILE_SIZE_PATTERN = r'File Size : </(span|font)><(span|font)[^>]*>(?P<S>.+?)</(span|font)>'
- DIRECT_LINK_PATTERN = r'http://www\.file(dino|fat)\.com/cgi-bin/dl\.cgi/'
-
- def setup(self):
- self.HOSTER_NAME = re.search(self.__pattern__, self.pyfile.url).group(1)
- self.multiDL = False
-
-getInfo = create_getInfo(FiledinoCom) \ No newline at end of file
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py
index 135dd90a1..66d26c999 100644
--- a/module/plugins/hoster/FilefactoryCom.py
+++ b/module/plugins/hoster/FilefactoryCom.py
@@ -9,7 +9,6 @@ from module.common.json_layer import json_loads
import re
def checkFile(plugin, urls):
- file_info = []
url_dict = {}
for url in urls:
@@ -35,7 +34,7 @@ class FilefactoryCom(Hoster):
__name__ = "FilefactoryCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?filefactory\.com/file/(?P<id>[a-zA-Z0-9]+).*" # URLs given out are often longer but this is the requirement
- __version__ = "0.34"
+ __version__ = "0.36"
__description__ = """Filefactory.Com File Download Hoster"""
__author_name__ = ("paulking", "zoidberg")
@@ -112,13 +111,15 @@ class FilefactoryCom(Hoster):
self.invalidCaptcha()
else:
self.fail("No valid captcha after 5 attempts")
-
+
# This will take us to a wait screen
waiturl = "http://www.filefactory.com" + response['path']
self.logDebug("Fetching wait with url [%s]" % waiturl)
waithtml = self.load(waiturl, decode=True)
+ found = re.search(r'<a href="(http://www.filefactory.com/dlf/.*?)"', waithtml)
+ waithtml = self.load(found.group(1), decode=True)
- # Find the wait value and wait
+ # Find the wait value and wait
wait = int(re.search(self.WAIT_PATTERN, waithtml).group('wait'))
self.logDebug("Waiting %d seconds." % wait)
self.setWait(wait, True)
@@ -128,7 +129,7 @@ class FilefactoryCom(Hoster):
url = re.search(self.FILE_URL_PATTERN,waithtml).group('url')
# this may either download our file or forward us to an error page
self.logDebug("Download URL: %s" % url)
- dl = self.download(url)
+ self.download(url)
check = self.checkDownload({"multiple": "You are currently downloading too many files at once.",
"error": '<div id="errorMessage">'})
diff --git a/module/plugins/hoster/FilerioCom.py b/module/plugins/hoster/FilerioCom.py
index 3d983bedf..7be0fa4f6 100644
--- a/module/plugins/hoster/FilerioCom.py
+++ b/module/plugins/hoster/FilerioCom.py
@@ -4,17 +4,17 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class FilerioCom(XFileSharingPro):
__name__ = "FilerioCom"
__type__ = "hoster"
- __pattern__ = r"http://(?:\w*\.)*file(rio|keen).com/\w{12}"
- __version__ = "0.01"
- __description__ = """FileRio.com hoster plugin"""
+ __pattern__ = r"http://(?:\w*\.)*(filerio\.(in|com)|filekeen\.com)/\w{12}"
+ __version__ = "0.02"
+ __description__ = """FileRio.in hoster plugin"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
FILE_OFFLINE_PATTERN = '<b>&quot;File Not Found&quot;</b>|File has been removed due to Copyright Claim'
- HOSTER_NAME = "filerio.com"
- DIRECT_LINK_PATTERN = r'Download Link:.*?<a href="(.*?)"'
+ HOSTER_NAME = "filerio.in"
+ FILE_URL_REPLACEMENTS = [(r'http://.*?/','http://filerio.in/')]
def setup(self):
- self.multiDL = False
+ self.resumeDownload = self.multiDL = self.premium
getInfo = create_getInfo(FilerioCom) \ No newline at end of file
diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py
index 1284329b5..ee4ea4953 100644
--- a/module/plugins/hoster/FilesMailRu.py
+++ b/module/plugins/hoster/FilesMailRu.py
@@ -31,7 +31,7 @@ class FilesMailRu(Hoster):
__name__ = "FilesMailRu"
__type__ = "hoster"
__pattern__ = r"http://files\.mail\.ru/.*"
- __version__ = "0.2"
+ __version__ = "0.3"
__description__ = """Files.Mail.Ru One-Klick Hoster"""
__author_name__ = ("oZiRiz")
__author_mail__ = ("ich@oziriz.de")
@@ -95,5 +95,5 @@ class FilesMailRu(Hoster):
# (Loading 100MB in to ram is not an option)
check = self.checkDownload({"html": "<meta name="}, read_size=50000)
if check == "html":
- self.log.info(_("There was HTML Code in the Downloaded File("+ pyfile.name +")...redirect error? The Download will be restarted."))
+ self.log.info(_("There was HTML Code in the Downloaded File("+ self.pyfile.name +")...redirect error? The Download will be restarted."))
self.retry()
diff --git a/module/plugins/hoster/FileshareInUa.py b/module/plugins/hoster/FileshareInUa.py
new file mode 100644
index 000000000..9700b2d0a
--- /dev/null
+++ b/module/plugins/hoster/FileshareInUa.py
@@ -0,0 +1,78 @@
+from urllib import urlencode
+import re
+from module.plugins.Hoster import Hoster
+from module.network.RequestFactory import getURL
+from module.utils import parseFileSize
+
+class FileshareInUa(Hoster):
+ __name__ = "FileshareInUa"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?fileshare.in.ua/[A-Za-z0-9]+"
+ __version__ = "0.01"
+ __description__ = """fileshare.in.ua hoster plugin"""
+ __author_name__ = ("fwannmacher")
+ __author_mail__ = ("felipe@warhammerproject.com")
+
+ HOSTER_NAME = "fileshare.in.ua"
+ PATTERN_FILENAME = r'<h3 class="b-filename">(.*?)</h3>'
+ PATTERN_FILESIZE = r'<b class="b-filesize">(.*?)</b>'
+ PATTERN_OFFLINE = "This file doesn't exist, or has been removed."
+
+ def setup(self):
+ self.resumeDownload = True
+ self.multiDL = True
+
+ def process(self, pyfile):
+ self.pyfile = pyfile
+ self.html = self.load(pyfile.url, decode=True)
+
+ if not self._checkOnline():
+ self.offline()
+
+ self.pyfile.name = self._getName()
+
+ self.link = self._getLink()
+
+ if not self.link.startswith('http://'):
+ self.link = "http://fileshare.in.ua" + self.link
+
+ self.download(self.link)
+
+ def _checkOnline(self):
+ if re.search(self.PATTERN_OFFLINE, self.html):
+ return False
+ else:
+ return True
+
+ def _getName(self):
+ name = re.search(self.PATTERN_FILENAME, self.html)
+ if name is None:
+ self.fail("%s: Plugin broken." % self.__name__)
+
+ return name.group(1)
+
+ def _getLink(self):
+ return re.search("<a href=\"(/get/.+)\" class=\"b-button m-blue m-big\" >", self.html).group(1)
+
+def getInfo(urls):
+ result = []
+
+ for url in urls:
+ html = getURL(url)
+
+ if re.search(FileshareInUa.PATTERN_OFFLINE, html):
+ result.append((url, 0, 1, url))
+ else:
+ name = re.search(FileshareInUa.PATTERN_FILENAME, html)
+
+ if name is None:
+ result.append((url, 0, 1, url))
+ continue
+
+ name = name.group(1)
+ size = re.search(FileshareInUa.PATTERN_FILESIZE, html)
+ size = parseFileSize(size.group(1))
+
+ result.append((name, size, 3, url))
+
+ yield result
diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py
deleted file mode 100644
index b35ce1b1f..000000000
--- a/module/plugins/hoster/FilesonicCom.py
+++ /dev/null
@@ -1,217 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-import string
-from urllib import unquote
-
-from module.plugins.Hoster import Hoster
-from module.plugins.ReCaptcha import ReCaptcha
-from module.utils import chunks
-
-from module.network.RequestFactory import getURL
-from module.common.json_layer import json_loads
-
-
-def getInfo(urls):
- yield [(url, 0, 1, url) for url in urls]
-
-
-def getId(url):
- match = re.search(FilesonicCom.FILE_ID_PATTERN, url)
- if match:
- return string.replace(match.group("id"), "/", "-")
- else:
- return None
-
-
-class FilesonicCom(Hoster):
- __name__ = "FilesonicCom"
- __type__ = "hoster"
- __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/.*?file/([a-zA-Z0-9]+(/.+)?|[a-z0-9]+/[0-9]+(/.+)?|[0-9]+(/.+)?)"
- __version__ = "0.36"
- __description__ = """FilesonicCom und Sharingmatrix Download Hoster"""
- __author_name__ = ("jeix", "paulking")
- __author_mail__ = ("jeix@hasnomail.de", "")
-
- API_ADDRESS = "http://api.filesonic.com"
- URL_DOMAIN_PATTERN = r'(?P<prefix>.*?)(?P<domain>.(filesonic|sharingmatrix)\..+?)(?P<suffix>/.*)'
- FILE_ID_PATTERN = r'/file/(?P<id>([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?' #change may break wupload - be careful
- FILE_LINK_PATTERN = r'Your download is ready</p>\s*<a href="(http://[^"]+)'
- WAIT_TIME_PATTERN = r'countDownDelay = (?P<wait>\d+)'
- WAIT_TM_PATTERN = r"name='tm' value='(.*?)' />"
- WAIT_TM_HASH_PATTERN = r"name='tm_hash' value='(.*?)' />"
- CAPTCHA_TYPE1_PATTERN = r'Recaptcha.create\("(.*?)",'
- CAPTCHA_TYPE2_PATTERN = r'id="recaptcha_image"><img style="display: block;" src="(.+)image?c=(.+?)"'
-
- def init(self):
- if self.account:
- self.premium = self.account.getAccountInfo(self.user)["premium"]
- if not self.premium:
- self.chunkLimit = 1
- self.multiDL = False
-
- def process(self, pyfile):
- self.fail("Hoster not longer available")
-
- def checkFile(self, url):
- id = getId(url)
- self.logDebug("file id is %s" % id)
- if id:
- # Use the api to check the current status of the file and fixup data
- check_url = self.API_ADDRESS + "/link?method=getInfo&format=json&ids=%s" % id
- result = json_loads(self.load(check_url, decode=True))
- item = result["FSApi_Link"]["getInfo"]["response"]["links"][0]
- self.logDebug("api check returns %s" % item)
-
- if item["status"] != "AVAILABLE":
- self.offline()
- if item["is_password_protected"] != 0:
- self.fail("This file is password protected")
-
- # ignored this check due to false api information
- #if item["is_premium_only"] != 0 and not self.premium:
- # self.fail("need premium account for file")
-
- self.pyfile.name = unquote(item["filename"])
-
- # Fix the url and resolve the domain to the correct regional variation
- url = item["url"]
- urlparts = re.search(self.URL_DOMAIN_PATTERN, url)
- if urlparts:
- url = urlparts.group("prefix") + self.getDomain() + urlparts.group("suffix")
- self.logDebug("localised url is %s" % url)
- return url
- else:
- self.fail("Invalid URL")
-
- def getDomain(self):
- result = json_loads(
- self.load(self.API_ADDRESS + "/utility?method=getFilesonicDomainForCurrentIp&format=json", decode=True))
- self.logDebug("response to get domain %s" % result)
- return result["FSApi_Utility"]["getFilesonicDomainForCurrentIp"]["response"]
-
-
- def downloadPremium(self):
- self.logDebug("Premium download")
-
- api = self.API_ADDRESS + "/link?method=getDownloadLink&u=%%s&p=%%s&ids=%s" % getId(self.pyfile.url)
-
- result = json_loads(self.load(api % (self.user, self.account.getAccountData(self.user)["password"])))
- links = result["FSApi_Link"]["getDownloadLink"]["response"]["links"]
-
- #wupload seems to return list and no dicts
- if type(links) == dict:
- info = links.values()[0]
- else:
- info = links[0]
-
- if "status" in info and info["status"] == "NOT_AVAILABLE":
- self.tempOffline()
-
- self.download(info["url"])
-
- def downloadFree(self):
- self.logDebug("Free download")
- # Get initial page
- self.html = self.load(self.pyfile.url)
- url = self.pyfile.url + "?start=1"
- self.html = self.load(url)
- self.handleErrors()
-
- finalUrl = re.search(self.FILE_LINK_PATTERN, self.html)
-
- if not finalUrl:
- self.doWait(url)
-
- chall = re.search(self.CAPTCHA_TYPE1_PATTERN, self.html)
- chall2 = re.search(self.CAPTCHA_TYPE2_PATTERN, self.html)
- if chall or chall2:
- for i in range(5):
- re_captcha = ReCaptcha(self)
- if chall:
- self.logDebug("Captcha type1")
- challenge, result = re_captcha.challenge(chall.group(1))
- else:
- self.logDebug("Captcha type2")
- server = chall2.group(1)
- challenge = chall2.group(2)
- result = re_captcha.result(server, challenge)
-
- postData = {"recaptcha_challenge_field": challenge,
- "recaptcha_response_field": result}
-
- self.html = self.load(url, post=postData)
- self.handleErrors()
- chall = re.search(self.CAPTCHA_TYPE1_PATTERN, self.html)
- chall2 = re.search(self.CAPTCHA_TYPE2_PATTERN, self.html)
-
- if chall or chall2:
- self.invalidCaptcha()
- else:
- self.correctCaptcha()
- break
-
- finalUrl = re.search(self.FILE_LINK_PATTERN, self.html)
-
- if not finalUrl:
- self.fail("Couldn't find free download link")
-
- self.logDebug("got download url %s" % finalUrl.group(1))
- self.download(finalUrl.group(1))
-
- def doWait(self, url):
- # If the current page requires us to wait then wait and move to the next page as required
-
- # There maybe more than one wait period. The extended wait if download limits have been exceeded (in which case we try reconnect)
- # and the short wait before every download. Visually these are the same, the difference is that one includes a code to allow
- # progress to the next page
-
- waitSearch = re.search(self.WAIT_TIME_PATTERN, self.html)
- while waitSearch:
- wait = int(waitSearch.group("wait"))
- if wait > 300:
- self.wantReconnect = True
-
- self.setWait(wait)
- self.logDebug("Waiting %d seconds." % wait)
- self.wait()
-
- tm = re.search(self.WAIT_TM_PATTERN, self.html)
- tm_hash = re.search(self.WAIT_TM_HASH_PATTERN, self.html)
-
- if tm and tm_hash:
- tm = tm.group(1)
- tm_hash = tm_hash.group(1)
- self.html = self.load(url, post={"tm": tm, "tm_hash": tm_hash})
- self.handleErrors()
- break
- else:
- self.html = self.load(url)
- self.handleErrors()
- waitSearch = re.search(self.WAIT_TIME_PATTERN, self.html)
-
- def handleErrors(self):
- if "This file is available for premium users only." in self.html:
- self.fail("need premium account for file")
-
- if "The file that you're trying to download is larger than" in self.html:
- self.fail("need premium account for file")
-
- if "Free users may only download 1 file at a time" in self.html:
- self.fail("only 1 file at a time for free users")
-
- if "Free user can not download files" in self.html:
- self.fail("need premium account for file")
-
- if "Download session in progress" in self.html:
- self.fail("already downloading")
-
- if "This file is password protected" in self.html:
- self.fail("This file is password protected")
-
- if "An Error Occurred" in self.html:
- self.fail("A server error occured.")
-
- if "This file was deleted" in self.html:
- self.offline()
diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py
new file mode 100644
index 000000000..0ffb76191
--- /dev/null
+++ b/module/plugins/hoster/FlyFilesNet.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+import urllib
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.network.RequestFactory import getURL
+
+class FlyFilesNet(SimpleHoster):
+ __name__ = "FlyFilesNet"
+ __version__ = "0.1"
+ __type__ = "hoster"
+ __pattern__ = r'http://flyfiles\.net/.*'
+
+ SESSION_PATTERN = r'flyfiles\.net/(.*)/.*'
+ FILE_NAME_PATTERN = r'flyfiles\.net/.*/(.*)'
+
+ def process(self, pyfile):
+
+ pyfile.name = re.search(self.FILE_NAME_PATTERN, pyfile.url).group(1)
+ pyfile.name = urllib.unquote_plus(pyfile.name)
+
+ session = re.search(self.SESSION_PATTERN, pyfile.url).group(1)
+
+ url = "http://flyfiles.net"
+
+ # get download URL
+ parsed_url = getURL(url, post={"getDownLink": session}, cookies=True)
+ self.logDebug("Parsed URL: %s" % parsed_url)
+
+ if parsed_url == '#downlink|' or parsed_url == "#downlink|#":
+ self.logWarning("Could not get the download URL. Please wait 10 minutes.")
+ self.setWait(600, True) # wait 10 minutes
+ self.wait()
+ self.retry()
+
+ download_url = parsed_url.replace('#downlink|','')
+
+ self.logDebug("Download URL: %s" % download_url)
+ self.download(download_url)
diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py
index 551706283..518ae2ae6 100644
--- a/module/plugins/hoster/FourSharedCom.py
+++ b/module/plugins/hoster/FourSharedCom.py
@@ -7,8 +7,8 @@ import re
class FourSharedCom(SimpleHoster):
__name__ = "FourSharedCom"
__type__ = "hoster"
- __pattern__ = r"http://[\w\.]*?4shared(-china)?\.com/(account/)?(download|get|file|document|photo|video|audio|office)/.+?/.*"
- __version__ = "0.28"
+ __pattern__ = r"https?://(www\.)?4shared(\-china)?\.com/(account/)?(download|get|file|document|photo|video|audio|mp3|office|rar|zip|archive|music)/.+?/.*"
+ __version__ = "0.29"
__description__ = """4Shared Download Hoster"""
__author_name__ = ("jeix", "zoidberg")
__author_mail__ = ("jeix@hasnomail.de", "zoidberg@mujmail.cz")
diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py
index dfa0eb01e..19eb77470 100644
--- a/module/plugins/hoster/FreevideoCz.py
+++ b/module/plugins/hoster/FreevideoCz.py
@@ -37,7 +37,7 @@ class FreevideoCz(Hoster):
__name__ = "FreevideoCz"
__type__ = "hoster"
__pattern__ = r"http://www.freevideo.cz/vase-videa/(.*)\.html"
- __version__ = "0.1"
+ __version__ = "0.2"
__description__ = """freevideo.cz"""
__author_name__ = ("zoidberg")
@@ -53,7 +53,7 @@ class FreevideoCz(Hoster):
self.html = self.load(pyfile.url, decode=True)
if re.search(self.FILE_OFFLINE_PATTERN, self.html):
- self.offline()
+ self.offline()
found = re.search(self.URL_PATTERN, self.html)
if found is None: self.fail("Parse error (URL)")
@@ -61,4 +61,4 @@ class FreevideoCz(Hoster):
pyfile.name = re.search(self.__pattern__, pyfile.url).group(1) + ".mp4"
- self.download(download_url) \ No newline at end of file
+ self.download(download_url)
diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py
index 977e97211..926781b40 100644
--- a/module/plugins/hoster/FshareVn.py
+++ b/module/plugins/hoster/FshareVn.py
@@ -4,6 +4,7 @@
from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
from module.network.RequestFactory import getURL
import re
+from time import strptime, mktime, gmtime
def getInfo(urls):
for url in urls:
@@ -23,20 +24,17 @@ class FshareVn(SimpleHoster):
__name__ = "FshareVn"
__type__ = "hoster"
__pattern__ = r"http://(www\.)?fshare.vn/file/.*"
- __version__ = "0.13"
+ __version__ = "0.16"
__description__ = """FshareVn Download Hoster"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
FILE_INFO_PATTERN = r'<p>(?P<N>[^<]+)<\\/p>[\\trn\s]*<p>(?P<S>[0-9,.]+)\s*(?P<U>[kKMG])i?B<\\/p>'
- FILE_OFFLINE_PATTERN = r'<div class=\\"f_left file_(enable|w)\\">'
- FILE_NAME_REPLACEMENTS = [("(.*)", doubleDecode)]
-
- DOWNLOAD_URL_PATTERN = r"<a class=\"bt_down\" id=\"down\".*window.location='([^']+)'\">"
- FORM_PATTERN = r'<form action="" method="post" name="frm_download">(.*?)</form>'
- FORM_INPUT_PATTERN = r'<input[^>]* name="?([^" ]+)"? value="?([^" ]+)"?[^>]*>'
+ FILE_OFFLINE_PATTERN = r'<div class=\\"f_left file_w\\"|<\\/p>\\t\\t\\t\\t\\r\\n\\t\\t<p><\\/p>\\t\\t\\r\\n\\t\\t<p>0 KB<\\/p>'
+ FILE_NAME_REPLACEMENTS = [("(.*)", doubleDecode)]
+ DOWNLOAD_URL_PATTERN = r'action="(http://download.*?)[#"]'
VIP_URL_PATTERN = r'<form action="([^>]+)" method="get" name="frm_download">'
- WAIT_PATTERN = u"Vui lòng chờ lượt download kế tiếp"
+ WAIT_PATTERN = ur'Lượt tải xuống kế tiếp là:\s*(.*?)\s*<'
def process(self, pyfile):
self.html = self.load('http://www.fshare.vn/check_link.php', post = {
@@ -44,61 +42,65 @@ class FshareVn(SimpleHoster):
"arrlinks": pyfile.url
}, decode = True)
self.getFileInfo()
-
- url = self.handlePremium() if self.premium else self.handleFree()
- self.download(url)
+
+ if self.premium:
+ self.handlePremium()
+ else:
+ self.handleFree()
self.checkDownloadedFile()
def handleFree(self):
self.html = self.load(self.pyfile.url, decode = True)
- if self.WAIT_PATTERN in self.html:
- self.retry(20, 300, "Try again later...")
-
+
self.checkErrors()
- found = re.search(self.FORM_PATTERN, self.html, re.DOTALL)
- if not found: self.parseError('FORM')
- form = found.group(1)
- inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
+ action, inputs = self.parseHtmlForm('frm_download')
+ self.url = self.pyfile.url + action
+
+ if not inputs: self.parseError('FORM')
+ elif 'link_file_pwd_dl' in inputs:
+ for password in self.getPassword().splitlines():
+ self.logInfo('Password protected link, trying "%s"' % password)
+ inputs['link_file_pwd_dl'] = password
+ self.html = self.load(self.url, post=inputs, decode=True)
+ if not 'name="link_file_pwd_dl"' in self.html:
+ break
+ else:
+ self.fail("No or incorrect password")
+ else:
+ self.html = self.load(self.url, post=inputs, decode=True)
- self.html = self.load(self.pyfile.url, post = inputs, decode = True)
+ self.checkErrors()
- if self.WAIT_PATTERN in self.html:
- self.retry(300, 20, "Try again later...")
+ found = re.search(r'var count = (\d+)', self.html)
+ self.setWait(int(found.group(1)) if found else 30)
found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
- if not found: self.parseError('Free URL')
- url = found.group(1)
+ if not found: self.parseError('FREE DL URL')
+ self.url = found.group(1)
+ self.logDebug("FREE DL URL: %s" % self.url)
- found = re.search(r'var count = (\d+)', self.html)
- self.setWait(int(found.group(1)) if found else 30)
self.wait()
-
- return url
+ self.download(self.url)
def handlePremium(self):
- header = self.load(self.pyfile.url, just_header = True)
- if 'location' in header and header['location'].startswith('http://download'):
- self.logDebug('Direct download')
- return self.pyfile.url
- else:
- self.html = self.load(self.pyfile.url)
-
- self.checkErrors()
-
- found = re.search(self.VIP_URL_PATTERN, self.html)
- if not found:
- if self.retries >= 3: self.resetAccount()
- self.account.relogin(self.user)
- self.retry(5, 1, 'VIP URL not found')
- url = found.group(1)
- self.logDebug('VIP URL: ' + url)
- return url
-
+ self.download(self.pyfile.url)
+
def checkErrors(self):
- if '/error.php?' in self.req.lastEffectiveURL:
+ if '/error.php?' in self.req.lastEffectiveURL or u"Liên kết bạn chọn không tồn" in self.html:
self.offline()
-
+
+ found = re.search(self.WAIT_PATTERN, self.html)
+ if found:
+ self.logInfo("Wait until %s ICT" % found.group(1))
+ wait_until = mktime(strptime(found.group(1), "%d/%m/%Y %H:%M"))
+ self.setWait(wait_until - mktime(gmtime()) - 7 * 3600, True)
+ self.wait()
+ self.retry()
+ elif '<ul class="message-error">' in self.html:
+ self.logError("Unknown error occured or wait time not parsed")
+ self.retry(30, 120, "Unknown error")
+
def checkDownloadedFile(self):
# check download
check = self.checkDownload({
@@ -106,4 +108,4 @@ class FshareVn(SimpleHoster):
})
if check == "not_found":
- self.fail("File not found on server") \ No newline at end of file
+ self.fail("File not found on server")
diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py
index 7c2af85ed..3bda3b32e 100644
--- a/module/plugins/hoster/Ftp.py
+++ b/module/plugins/hoster/Ftp.py
@@ -17,24 +17,75 @@
@author: jeix
@author: mkaay
"""
+from urlparse import urlparse, urljoin
+from urllib import quote, unquote
+import pycurl, re
from module.plugins.Hoster import Hoster
-
+from module.network.HTTPRequest import BadHeader
class Ftp(Hoster):
__name__ = "Ftp"
- __version__ = "0.31"
+ __version__ = "0.41"
__pattern__ = r'(ftps?|sftp)://(.*?:.*?@)?.*?/.*' # ftp://user:password@ftp.server.org/path/to/file
__type__ = "hoster"
__description__ = """A Plugin that allows you to download from an from an ftp directory"""
- __author_name__ = ("jeix", "mkaay")
- __author_mail__ = ("jeix@hasnomail.com", "mkaay@mkaay.de")
+ __author_name__ = ("jeix", "mkaay", "zoidberg")
+ __author_mail__ = ("jeix@hasnomail.com", "mkaay@mkaay.de", "zoidberg@mujmail.cz")
- def process(self, pyfile):
- pyfile.name = self.pyfile.url.rpartition('/')[2]
-
+ def setup(self):
self.chunkLimit = -1
- self.resumeDownload = True
-
- self.download(pyfile.url)
-
+ self.resumeDownload = True
+
+ def process(self, pyfile):
+ parsed_url = urlparse(pyfile.url)
+ netloc = parsed_url.netloc
+
+ pyfile.name = parsed_url.path.rpartition('/')[2]
+ try:
+ pyfile.name = unquote(str(pyfile.name)).decode('utf8')
+ except:
+ pass
+
+ if not "@" in netloc:
+ servers = [ x['login'] for x in self.account.getAllAccounts() ] if self.account else []
+
+ if netloc in servers:
+ self.logDebug("Logging on to %s" % netloc)
+ self.req.addAuth(self.account.accounts[netloc]["password"])
+ else:
+ for pwd in pyfile.package().password.splitlines():
+ if ":" in pwd:
+ self.req.addAuth(pwd.strip())
+ break
+
+ self.req.http.c.setopt(pycurl.NOBODY, 1)
+
+ try:
+ response = self.load(pyfile.url)
+ except pycurl.error, e:
+ self.fail("Error %d: %s" % e.args)
+
+ self.req.http.c.setopt(pycurl.NOBODY, 0)
+ self.logDebug(self.req.http.header)
+
+ found = re.search(r"Content-Length:\s*(\d+)", response)
+ if found:
+ pyfile.size = int(found.group(1))
+ self.download(pyfile.url)
+ else:
+ #Naive ftp directory listing
+ if re.search(r'^25\d.*?"', self.req.http.header, re.M):
+ pyfile.url = pyfile.url.rstrip('/')
+ pkgname = "/".join((pyfile.package().name,urlparse(pyfile.url).path.rpartition('/')[2]))
+ pyfile.url += '/'
+ self.req.http.c.setopt(48, 1) # CURLOPT_DIRLISTONLY
+ response = self.load(pyfile.url, decode = False)
+ links = [ pyfile.url + quote(x) for x in response.splitlines() ]
+ self.logDebug("LINKS", links)
+ self.core.api.addPackage(pkgname, links, 1)
+ #self.core.files.addLinks(links, pyfile.package().id)
+ else:
+ self.fail("Unexpected server response")
+
+ \ No newline at end of file
diff --git a/module/plugins/hoster/GamefrontCom.py b/module/plugins/hoster/GamefrontCom.py
new file mode 100644
index 000000000..34fda09d2
--- /dev/null
+++ b/module/plugins/hoster/GamefrontCom.py
@@ -0,0 +1,80 @@
+import re
+from module.plugins.Hoster import Hoster
+from module.network.RequestFactory import getURL
+from module.utils import parseFileSize
+
+class GamefrontCom(Hoster):
+ __name__ = "GamefrontCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?gamefront.com/files/[A-Za-z0-9]+"
+ __version__ = "0.02"
+ __description__ = """gamefront.com hoster plugin"""
+ __author_name__ = ("fwannmacher")
+ __author_mail__ = ("felipe@warhammerproject.com")
+
+ HOSTER_NAME = "gamefront.com"
+ PATTERN_FILENAME = r'<title>(.*?) | Game Front'
+ PATTERN_FILESIZE = r'<dt>File Size:</dt>[\n\s]*<dd>(.*?)</dd>'
+ PATTERN_OFFLINE = "This file doesn't exist, or has been removed."
+
+ def setup(self):
+ self.resumeDownload = True
+ self.multiDL = False
+
+ def process(self, pyfile):
+ self.pyfile = pyfile
+ self.html = self.load(pyfile.url, decode=True)
+
+ if not self._checkOnline():
+ self.offline()
+
+ self.pyfile.name = self._getName()
+
+ self.link = self._getLink()
+
+ if not self.link.startswith('http://'):
+ self.link = "http://www.gamefront.com/" + self.link
+
+ self.download(self.link)
+
+ def _checkOnline(self):
+ if re.search(self.PATTERN_OFFLINE, self.html):
+ return False
+ else:
+ return True
+
+ def _getName(self):
+ name = re.search(self.PATTERN_FILENAME, self.html)
+ if name is None:
+ self.fail("%s: Plugin broken." % self.__name__)
+
+ return name.group(1)
+
+ def _getLink(self):
+ self.html2 = self.load("http://www.gamefront.com/" + re.search("(files/service/thankyou\\?id=[A-Za-z0-9]+)", self.html).group(1))
+ self.link = re.search("<a href=\"(http://media[0-9]+\.gamefront.com/.*)\">click here</a>", self.html2)
+
+ return self.link.group(1).replace("&amp;", "&")
+
+def getInfo(urls):
+ result = []
+
+ for url in urls:
+ html = getURL(url)
+
+ if re.search(GamefrontCom.PATTERN_OFFLINE, html):
+ result.append((url, 0, 1, url))
+ else:
+ name = re.search(GamefrontCom.PATTERN_FILENAME, html)
+
+ if name is None:
+ result.append((url, 0, 1, url))
+ continue
+
+ name = name.group(1)
+ size = re.search(GamefrontCom.PATTERN_FILESIZE, html)
+ size = parseFileSize(size.group(1))
+
+ result.append((name, size, 3, url))
+
+ yield result \ No newline at end of file
diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py
index 0add79ed9..aa494e34e 100644
--- a/module/plugins/hoster/HellshareCz.py
+++ b/module/plugins/hoster/HellshareCz.py
@@ -17,28 +17,21 @@
"""
import re
-import datetime
from math import ceil
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.network.RequestFactory import getURL
+
class HellshareCz(SimpleHoster):
__name__ = "HellshareCz"
__type__ = "hoster"
- __pattern__ = r"(http://(?:.*\.)*hellshare\.(?:cz|com|sk|hu)/[^?]*/\d+).*"
- __version__ = "0.77"
- __description__ = """Hellshare.cz"""
+ __pattern__ = r"(http://(?:.*\.)*hellshare\.(?:cz|com|sk|hu|pl)/[^?]*/\d+).*"
+ __version__ = "0.82"
+ __description__ = """Hellshare.cz - premium only"""
__author_name__ = ("zoidberg")
- FREE_URL_PATTERN = r'<form[^>]*action="(http://free\d*\.helldata[^"]*)"'
- PREMIUM_URL_PATTERN = r"launchFullDownload\('([^']*)'\);"
- FILE_NAME_PATTERN = r'<h1 id="filename">(?P<N>[^<]+)</h1>'
- FILE_SIZE_PATTERN = r'<td><span>Size</span></td>\s*<th><span>(?P<S>[0-9.]*)&nbsp;(?P<U>[kKMG])i?B</span></th>'
+ FILE_NAME_PATTERN = r'<h1 id="filename"[^>]*>(?P<N>[^<]+)</h1>'
+ FILE_SIZE_PATTERN = r'<strong id="FileSize_master">(?P<S>[0-9.]*)&nbsp;(?P<U>[kKMG])i?B</strong>'
FILE_OFFLINE_PATTERN = r'<h1>File not found.</h1>'
- CAPTCHA_PATTERN = r'<img class="left" id="captcha-img"src="([^"]*)" />'
- #FILE_CREDITS_PATTERN = r'<strong class="filesize">(\d+) MB</strong>'
- CREDIT_LEFT_PATTERN = r'<p>After downloading this file you will have (\d+) MB for future downloads.'
- DOWNLOAD_AGAIN_PATTERN = r'<p>This file you downloaded already and re-download is for free. </p>'
SHOW_WINDOW_PATTERN = r'<a href="([^?]+/(\d+)/\?do=(fileDownloadButton|relatedFileDownloadButton-\2)-showDownloadWindow)"'
def setup(self):
@@ -46,77 +39,18 @@ class HellshareCz(SimpleHoster):
self.chunkLimit = 1
def process(self, pyfile):
+ if not self.account: self.fail("User not logged in")
pyfile.url = re.search(self.__pattern__, pyfile.url).group(1)
self.html = self.load(pyfile.url, decode = True)
self.getFileInfo()
-
+ if not self.checkTrafficLeft():
+ self.fail("Not enough traffic left for user %s." % self.user)
+
found = re.search(self.SHOW_WINDOW_PATTERN, self.html)
if not found: self.parseError('SHOW WINDOW')
- self.url = "http://www.hellshare.com" + found.group(1)
- self.logDebug("SHOW WINDOW: " + self.url)
- self.html = self.load(self.url, decode=True)
-
- if self.account:
- self.handlePremium()
- else:
- self.handleFree()
-
- def handleFree(self):
- # hellshare is very generous
- if "You exceeded your today's limit for free download. You can download only 1 files per 24 hours." in self.html:
- t = datetime.datetime.today().replace(hour=1, minute=0, second=0) + datetime.timedelta(
- days=1) - datetime.datetime.today()
- self.setWait(t.seconds, True)
- self.wait()
- self.retry()
-
- # parse free download url
- found = re.search(self.FREE_URL_PATTERN, self.html)
- if found is None: self.parseError("Free URL)")
- parsed_url = found.group(1)
- self.logDebug("Free URL: %s" % parsed_url)
-
- # decrypt captcha
- found = re.search(self.CAPTCHA_PATTERN, self.html)
- if found is None: self.parseError("Captcha")
- captcha_url = found.group(1)
-
- captcha = self.decryptCaptcha(captcha_url)
- self.logDebug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha)
-
- self.download(parsed_url, post = {"captcha" : captcha, "submit" : "Download"})
-
- # check download
- check = self.checkDownload({
- "wrong_captcha": re.compile(self.FREE_URL_PATTERN)
- })
-
- if check == "wrong_captcha":
- self.invalidCaptcha()
- self.retry()
-
- def handlePremium(self):
- # get premium download url
- found = re.search(self.PREMIUM_URL_PATTERN, self.html)
- if found is None: self.fail("Parse error (URL)")
- download_url = found.group(1)
-
- # check credit
- if self.DOWNLOAD_AGAIN_PATTERN in self.html:
- self.logInfo("Downloading again for free")
- else:
- found = re.search(self.CREDIT_LEFT_PATTERN, self.html)
- if not found:
- self.logError("Not enough credit left: %d (%d needed). Trying to download as free user." % (credits_left, file_credits))
- self.resetAccount()
- credits_left = int(found.group(1))
-
- file_credits = ceil(self.pyfile.size / 1024 ** 2)
- self.logInfo("Downloading file for %d credits, %d credits left" % (file_credits, credits_left))
-
- self.download(download_url)
+ self.url = "http://www.hellshare.com" + found.group(1)
+ self.logDebug("DOWNLOAD URL: " + self.url)
- info = self.account.getAccountInfo(self.user, True)
- self.logInfo("User %s has %i credits left" % (self.user, info["trafficleft"] / 1024))
+ self.download(self.url)
-getInfo = create_getInfo(HellshareCz) \ No newline at end of file
+getInfo = create_getInfo(HellshareCz)
diff --git a/module/plugins/hoster/HellspyCz.py b/module/plugins/hoster/HellspyCz.py
index a03e2bf21..9858c82b7 100644
--- a/module/plugins/hoster/HellspyCz.py
+++ b/module/plugins/hoster/HellspyCz.py
@@ -22,15 +22,16 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class HellspyCz(SimpleHoster):
__name__ = "HellspyCz"
__type__ = "hoster"
- __pattern__ = r"http://(?:\w*\.)*hellspy\.(?:cz|com|sk|hu)(/\S+/\d+)/?.*"
- __version__ = "0.24"
+ __pattern__ = r"http://(?:\w*\.)*(?:hellspy\.(?:cz|com|sk|hu|pl)|sciagaj.pl)(/\S+/\d+)/?.*"
+ __version__ = "0.27"
__description__ = """HellSpy.cz"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- FILE_INFO_PATTERN = '<span class="filesize right">(?P<S>[0-9.]+) <span>(?P<U>[kKMG])i?B</span></span>\s*<h1>(?P<N>[^<]+)</h1>'
+ FILE_SIZE_PATTERN = r'<span class="filesize right">(?P<S>[0-9.]+)\s*<span>(?P<U>[kKMG])i?B'
+ FILE_NAME_PATTERN = r'<h1 title="(?P<N>.*?)"'
FILE_OFFLINE_PATTERN = r'<h2>(404 - Page|File) not found</h2>'
- FILE_URL_REPLACEMENTS = [(r"http://(?:\w*\.)*hellspy\.(?:cz|com|sk|hu)(/\S+/\d+)/?.*", r"http://www.hellspy.com\1")]
+ FILE_URL_REPLACEMENTS = [(__pattern__, r"http://www.hellspy.com\1")]
CREDIT_LEFT_PATTERN = r'<strong>Credits: </strong>\s*(\d+)'
DOWNLOAD_AGAIN_PATTERN = r'<a id="button-download-start"[^>]*title="You can download the file without deducting your credit.">'
diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py
index df652edcc..2caf1ffbc 100644
--- a/module/plugins/hoster/HotfileCom.py
+++ b/module/plugins/hoster/HotfileCom.py
@@ -13,7 +13,7 @@ def getInfo(urls):
for chunk in chunks(urls, 90):
api_param_file = {"action":"checklinks","links": ",".join(chunk),"fields":"id,status,name,size"} #api only supports old style links
- src = getURL(api_url_base, post=api_param_file)
+ src = getURL(api_url_base, post=api_param_file, decode=True)
result = []
for i, res in enumerate(src.split("\n")):
if not res:
@@ -31,8 +31,8 @@ def getInfo(urls):
class HotfileCom(Hoster):
__name__ = "HotfileCom"
__type__ = "hoster"
- __pattern__ = r"http://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/"
- __version__ = "0.34"
+ __pattern__ = r"https?://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/"
+ __version__ = "0.36"
__description__ = """Hotfile.com Download Hoster"""
__author_name__ = ("sitacuisses","spoob","mkaay","JoKoT3")
__author_mail__ = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de","jokot3@gmail.com")
@@ -66,14 +66,14 @@ class HotfileCom(Hoster):
args = {"links":self.pyfile.url, "fields":"id,status,name,size,sha1"}
resp = self.apiCall("checklinks", args)
- self.apiData = {}
+ self.api_data = {}
for k, v in zip(args["fields"].split(","), resp.strip().split(",")):
- self.apiData[k] = v
+ self.api_data[k] = v
- if self.apiData["status"] == "0":
+ if self.api_data["status"] == "0":
self.offline()
- pyfile.name = self.apiData["name"]
+ pyfile.name = self.api_data["name"]
if not self.premium:
self.downloadHTML()
diff --git a/module/plugins/hoster/IFileWs.py b/module/plugins/hoster/IFileWs.py
new file mode 100644
index 000000000..160fe641c
--- /dev/null
+++ b/module/plugins/hoster/IFileWs.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+
+class IFileWs(XFileSharingPro):
+ __name__ = "IFileWs"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?ifile\.ws/\w+(/.+)?"
+ __version__ = "0.01"
+ __description__ = """Ifile.ws hoster plugin"""
+ __author_name__ = ("z00nx")
+ __author_mail__ = ("z00nx0@gmail.com")
+
+ FILE_INFO_PATTERN = '<h1\s+style="display:inline;">(?P<N>[^<]+)</h1>\s+\[(?P<S>[^]]+)\]'
+ FILE_OFFLINE_PATTERN = 'File Not Found|The file was removed by administrator'
+ HOSTER_NAME = "ifile.ws"
+ LONG_WAIT_PATTERN = "(?P<M>\d(?=\s+minutes)).*(?P<S>\d+(?=\s+seconds))"
+
+
+getInfo = create_getInfo(IFileWs)
diff --git a/module/plugins/hoster/IcyFilesCom.py b/module/plugins/hoster/IcyFilesCom.py
index 3f966d936..34737e560 100644
--- a/module/plugins/hoster/IcyFilesCom.py
+++ b/module/plugins/hoster/IcyFilesCom.py
@@ -42,7 +42,7 @@ class IcyFilesCom(Hoster):
__name__ = "IcyFilesCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?icyfiles\.com/(.*)"
- __version__ = "0.04"
+ __version__ = "0.05"
__description__ = """IcyFiles.com plugin - free only"""
__author_name__ = ("godofdream")
__author_mail__ = ("soilfiction@gmail.com")
@@ -91,7 +91,7 @@ class IcyFilesCom(Hoster):
if found is None:
self.fail("Parse error (URL)")
download_url = "http://icyfiles.com/download.php?key=" + found.group(1)
- self.download(download_url)
+ self.download(download_url)
# check download
check = self.checkDownload({
"notfound": re.compile(r"^<head><title>404 Not Found</title>$"),
diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py
index a21cc748b..6accbc524 100644
--- a/module/plugins/hoster/IfolderRu.py
+++ b/module/plugins/hoster/IfolderRu.py
@@ -24,8 +24,8 @@ from module.network.RequestFactory import getURL
class IfolderRu(SimpleHoster):
__name__ = "IfolderRu"
__type__ = "hoster"
- __pattern__ = r"http://(?:[^.]*\.)?(?:ifolder.ru|rusfolder.com)/(?P<ID>\d+).*"
- __version__ = "0.36"
+ __pattern__ = r"http://(?:[^.]*\.)?(?:ifolder\.ru|rusfolder\.(?:com|net|ru))/(?:files/)?(?P<ID>\d+).*"
+ __version__ = "0.37"
__description__ = """rusfolder.com / ifolder.ru"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -50,7 +50,7 @@ class IfolderRu(SimpleHoster):
self.html = self.load("http://rusfolder.com/%s" % file_id, cookies=True, decode=True)
self.getFileInfo()
- url = "http://ints.rusfolder.com/ints/?rusfolder.com/%s?ints_code=" % file_id
+ url = re.search('<a href="(http://ints\..*?=)"', self.html).group(1)
self.html = self.load(url, cookies=True, decode=True)
url, session_id = re.search(self.SESSION_ID_PATTERN, self.html).groups()
@@ -64,7 +64,7 @@ class IfolderRu(SimpleHoster):
captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id
for i in range(5):
- self.html = self.load(url, cookies=True)
+ self.html = self.load(url, cookies=True)
action, inputs = self.parseHtmlForm('ID="Form1"')
inputs['ints_session'] = re.search(self.INTS_SESSION_PATTERN, self.html).group(1)
inputs[re.search(self.HIDDEN_INPUT_PATTERN, self.html).group(1)] = '1'
@@ -80,7 +80,7 @@ class IfolderRu(SimpleHoster):
else:
self.fail("Invalid captcha")
- self.html = self.load("http://rusfolder.com/%s?ints_code=%s" % (file_id, session_id), decode=True, cookies = True)
+ #self.html = self.load("http://rusfolder.com/%s?ints_code=%s" % (file_id, session_id), decode=True, cookies = True)
download_url = re.search(self.DOWNLOAD_LINK_PATTERN, self.html).group(1)
self.correctCaptcha()
diff --git a/module/plugins/hoster/KickloadCom.py b/module/plugins/hoster/KickloadCom.py
deleted file mode 100644
index 9f1e5083d..000000000
--- a/module/plugins/hoster/KickloadCom.py
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-
-from module.plugins.Hoster import Hoster
-
-class KickloadCom(Hoster):
- __name__ = "KickloadCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www)?\.?(?:storage\.to|kickload\.com)/get/.*"
- __version__ = "0.2"
- __description__ = """Storage.to / Kickload.com Download Hoster"""
- __author_name__ = ("mkaay")
-
- def setup(self):
- self.wantReconnect = False
- self.api_data = None
- self.html = None
- self.multiDL = False
-
- def process(self, pyfile):
- self.pyfile = pyfile
- self.prepare()
- self.download( self.get_file_url() )
-
- def prepare(self):
- pyfile = self.pyfile
-
- self.wantReconnect = False
-
- if not self.file_exists():
- self.offline()
-
- pyfile.name = self.get_file_name()
-
- self.setWait( self.get_wait_time() )
-
- while self.wantReconnect:
- self.wait()
- self.download_api_data()
- self.setWait( self.get_wait_time() )
-
- return True
-
- def download_html(self):
- url = self.pyfile.url
- self.html = self.load(url)
-
- def download_api_data(self):
- url = self.pyfile.url
- info_url = url.replace("/get/", "/getlink/")
- src = self.load(info_url)
- if "To download this file you need a premium account" in src:
- self.fail("Need premium account for this file")
-
- pattern = re.compile(r"'(\w+)' : (.*?)[,|\}]")
- self.api_data = {}
- for pair in pattern.findall(src):
- self.api_data[pair[0]] = pair[1].strip("'")
- print self.api_data
-
- def get_wait_time(self):
- if not self.api_data:
- self.download_api_data()
- if self.api_data["state"] == "wait":
- self.wantReconnect = True
- else:
- self.wantReconnect = False
-
- return int(self.api_data["countdown"]) + 3
-
-
-
- def file_exists(self):
- """ returns True or False
- """
- if not self.api_data:
- self.download_api_data()
- if self.api_data["state"] == "failed":
- return False
- else:
- return True
-
- def get_file_url(self):
- """ returns the absolute downloadable filepath
- """
- if not self.api_data:
- self.download_api_data()
- return self.api_data["link"]
-
- def get_file_name(self):
- if not self.html:
- self.download_html()
- file_name_pattern = r"<span class=\"orange\">Downloading:</span>(.*?)<span class=\"light\">(.*?)</span>"
- return re.search(file_name_pattern, self.html).group(1).strip()
diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py
index 88e708bf5..c63272f27 100644
--- a/module/plugins/hoster/LetitbitNet.py
+++ b/module/plugins/hoster/LetitbitNet.py
@@ -17,40 +17,44 @@
"""
import re
-from random import random
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.common.json_layer import json_loads
+from module.plugins.ReCaptcha import ReCaptcha
+
class LetitbitNet(SimpleHoster):
__name__ = "LetitbitNet"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*(letitbit|shareflare).net/download/.*"
- __version__ = "0.19"
+ __version__ = "0.20"
__description__ = """letitbit.net"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
+ __author_name__ = ("zoidberg", "z00nx")
+ __author_mail__ = ("zoidberg@mujmail.cz", "z00nx0@gmail.com")
CHECK_URL_PATTERN = r"ajax_check_url\s*=\s*'((http://[^/]+)[^']+)';"
SECONDS_PATTERN = r"seconds\s*=\s*(\d+);"
-
- FILE_INFO_PATTERN = r'<h1[^>]*>File:.*?<span>(?P<N>[^<]+)</span>.*?\[<span>(?P<S>[^<]+)</span>]</h1>'
+ CAPTCHA_CONTROL_FIELD = r"recaptcha_control_field\s=\s'(?P<value>[^']+)'"
+ FILE_INFO_PATTERN = r'<span[^>]*>File:.*?<span[^>]*>(?P<N>[^&]+).*</span>.*?\[(?P<S>[^\]]+)\]</span>'
FILE_OFFLINE_PATTERN = r'>File not found<'
-
+
DOMAIN = "http://letitbit.net"
FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "letitbit.net")]
-
+ RECAPTCHA_KEY = "6Lc9zdMSAAAAAF-7s2wuQ-036pLRbM0p8dDaQdAM"
+
def setup(self):
- self.resumeDownload = self.multiDL = True
+ self.resumeDownload = True
+ #TODO confirm that resume works
def handleFree(self):
action, inputs = self.parseHtmlForm('id="ifree_form"')
- if not action: self.parseError("page 1 / ifree_form")
+ if not action:
+ self.parseError("page 1 / ifree_form")
self.pyfile.size = float(inputs['sssize'])
- #self.logDebug(action, inputs)
+ self.logDebug(action, inputs)
inputs['desc'] = ""
- self.html = self.load(self.DOMAIN + action, post = inputs, cookies = True)
-
+ self.html = self.load(self.DOMAIN + action, post=inputs, cookies=True)
+
"""
action, inputs = self.parseHtmlForm('id="d3_form"')
if not action: self.parseError("page 2 / d3_form")
@@ -68,35 +72,46 @@ class LetitbitNet(SimpleHoster):
self.logError(e)
self.parseError("page 3 / js")
"""
-
- found = re.search(self.SECONDS_PATTERN, self.html)
+
+ found = re.search(self.SECONDS_PATTERN, self.html)
seconds = int(found.group(1)) if found else 60
- self.setWait(seconds+1)
+ self.logDebug("Seconds found", seconds)
+ found = re.search(self.CAPTCHA_CONTROL_FIELD, self.html)
+ recaptcha_control_field = found.group(1)
+ self.logDebug("ReCaptcha control field found", recaptcha_control_field)
+ self.setWait(seconds + 1)
self.wait()
-
- response = self.load("%s/ajax/download3.php" % self.DOMAIN, post = " ", cookies = True)
- if response != '1': self.parseError('Unknown response - ajax_check_url')
-
- for i in range(5):
- captcha = self.decryptCaptcha('%s/captcha_new.php?rand=%d' % (self.DOMAIN, random() * 100000), cookies = True)
- response = self.load('%s/ajax/check_captcha.php' % self.DOMAIN, post = {"code": captcha}, cookies = True)
- self.logDebug(response)
- if not response:
- self.invalidCaptcha()
- elif response.startswith('['):
- urls = json_loads(response)
- break
- elif response.startswith('http://'):
- urls = [response]
- break
- else:
- self.parseError("Unknown response - captcha check")
-
+
+ response = self.load("%s/ajax/download3.php" % self.DOMAIN, post=" ", cookies=True)
+ if response != '1':
+ self.parseError('Unknown response - ajax_check_url')
+ self.logDebug(response)
+
+ recaptcha = ReCaptcha(self)
+ challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
+ post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response, "recaptcha_control_field": recaptcha_control_field}
+ self.logDebug("Post data to send", post_data)
+ response = self.load('%s/ajax/check_recaptcha.php' % self.DOMAIN, post=post_data, cookies=True)
+ self.logDebug(response)
+ if not response:
+ self.invalidCaptcha()
+ if response == "error_free_download_blocked":
+ self.logInfo("Daily limit reached, waiting 24 hours")
+ self.setWait(24 * 60 * 60)
+ self.wait()
+ if response == "error_wrong_captcha":
+ self.logInfo("Wrong Captcha")
+ self.invalidCaptcha()
+ self.retry()
+ elif response.startswith('['):
+ urls = json_loads(response)
+ elif response.startswith('http://'):
+ urls = [response]
else:
- self.fail("No valid captcha solution received")
-
+ self.parseError("Unknown response - captcha check")
+
self.correctCaptcha()
-
+
for download_url in urls:
try:
self.logDebug("Download URL", download_url)
@@ -107,4 +122,4 @@ class LetitbitNet(SimpleHoster):
else:
self.fail("Download did not finish correctly")
-getInfo = create_getInfo(LetitbitNet) \ No newline at end of file
+getInfo = create_getInfo(LetitbitNet)
diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py
index 66bc6f407..babf354a9 100644
--- a/module/plugins/hoster/LoadTo.py
+++ b/module/plugins/hoster/LoadTo.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -43,7 +43,7 @@ class LoadTo(Hoster):
__name__ = "LoadTo"
__type__ = "hoster"
__pattern__ = r"http://(www.*?\.)?load\.to/.{7,10}?/.*"
- __version__ = "0.1002"
+ __version__ = "0.11"
__description__ = """load.to"""
__author_name__ = ("halfman")
__author_mail__ = ("Pulpan3@gmail.com")
@@ -79,4 +79,5 @@ class LoadTo(Hoster):
self.setWait(timmy.group(1))
self.wait()
- self.download(download_url)
+ self.req.setOption("timeout", 120)
+ self.download(download_url) \ No newline at end of file
diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py
new file mode 100644
index 000000000..a1e866089
--- /dev/null
+++ b/module/plugins/hoster/LuckyShareNet.py
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+
+import re
+from module.lib.bottle import json_loads
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.ReCaptcha import ReCaptcha
+
+
+class LuckyShareNet(SimpleHoster):
+ __name__ = "LuckyShareNet"
+ __type__ = "hoster"
+ __pattern__ = r"https?://(www\.)?luckyshare.net/(?P<ID>\d{10,})"
+ __version__ = "0.02"
+ __description__ = """LuckyShare.net Download Hoster"""
+ __author_name__ = ("stickell")
+ __author_mail__ = ("l.stickell@yahoo.it")
+
+ FILE_INFO_PATTERN = r"<h1 class='file_name'>(?P<N>\S+)</h1>\s*<span class='file_size'>Filesize: (?P<S>[\d.]+)(?P<U>\w+)</span>"
+ FILE_OFFLINE_PATTERN = 'There is no such file available'
+ RECAPTCHA_KEY = '6LdivsgSAAAAANWh-d7rPE1mus4yVWuSQIJKIYNw'
+
+ def parseJson(self, rep):
+ if 'AJAX Error' in rep:
+ html = self.load(self.pyfile.url, decode=True)
+ m = re.search(r"waitingtime = (\d+);", html)
+ if m:
+ waittime = int(m.group(1))
+ self.logDebug('You have to wait %d seconds between free downloads' % waittime)
+ self.retry(wait_time=waittime)
+ else:
+ self.parseError('Unable to detect wait time between free downloads')
+ elif 'Hash expired' in rep:
+ self.retry(reason='Hash expired')
+ return json_loads(rep)
+
+ # TODO: There should be a filesize limit for free downloads
+ # TODO: Some files could not be downloaded in free mode
+ def handleFree(self):
+ file_id = re.search(self.__pattern__, self.pyfile.url).group('ID')
+ self.logDebug('File ID: ' + file_id)
+ rep = self.load(r"http://luckyshare.net/download/request/type/time/file/" + file_id, decode=True)
+ self.logDebug('JSON: ' + rep)
+ json = self.parseJson(rep)
+
+ self.setWait(int(json['time']))
+ self.wait()
+
+ recaptcha = ReCaptcha(self)
+ for i in xrange(5):
+ challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
+ rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" %
+ (challenge, response, json['hash']), decode=True)
+ self.logDebug('JSON: ' + rep)
+ if 'link' in rep:
+ json.update(self.parseJson(rep))
+ self.correctCaptcha()
+ break
+ elif 'Verification failed' in rep:
+ self.logInfo('Wrong captcha')
+ self.invalidCaptcha()
+ else:
+ self.parseError('Unable to get downlaod link')
+
+ if not json['link']:
+ self.fail("No Download url retrieved/all captcha attempts failed")
+
+ self.logDebug('Direct URL: ' + json['link'])
+ self.download(json['link'])
+
+
+getInfo = create_getInfo(LuckyShareNet)
diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py
index 1069e5e1a..0e405930f 100644
--- a/module/plugins/hoster/MediafireCom.py
+++ b/module/plugins/hoster/MediafireCom.py
@@ -39,7 +39,7 @@ def checkHTMLHeader(url):
elif 'content-disposition' in line:
return url, 2
else:
- break
+ break
except:
return url, 3
@@ -58,7 +58,7 @@ class MediafireCom(SimpleHoster):
__name__ = "MediafireCom"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*mediafire\.com/(file/|(view/?|download.php)?\?)(\w{11}|\w{15})($|/)"
- __version__ = "0.77"
+ __version__ = "0.78"
__description__ = """Mediafire.com plugin - free only"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -160,4 +160,4 @@ class MediafireCom(SimpleHoster):
else:
break
else:
- self.fail("No valid recaptcha solution received") \ No newline at end of file
+ self.fail("No valid recaptcha solution received")
diff --git a/module/plugins/hoster/MegaNz.py b/module/plugins/hoster/MegaNz.py
new file mode 100644
index 000000000..a28ddca9d
--- /dev/null
+++ b/module/plugins/hoster/MegaNz.py
@@ -0,0 +1,125 @@
+# -*- coding: utf-8 -*-
+
+import re
+import random
+from array import array
+from os import remove
+from base64 import standard_b64decode
+
+from Crypto.Cipher import AES
+from Crypto.Util import Counter
+
+from module.common.json_layer import json
+from module.plugins.Hoster import Hoster
+
+#def getInfo(urls):
+# pass
+
+class MegaNz(Hoster):
+ __name__ = "MegaNz"
+ __type__ = "hoster"
+ __pattern__ = r"https?://([a-z0-9]+\.)?mega\.co\.nz/#!([a-zA-Z0-9!_\-]+)"
+ __version__ = "0.11"
+ __description__ = """mega.co.nz hoster plugin"""
+ __author_name__ = ("RaNaN", )
+ __author_mail__ = ("ranan@pyload.org", )
+
+ API_URL = "https://g.api.mega.co.nz/cs?id=%d"
+ FILE_SUFFIX = ".crypted"
+
+ def b64_decode(self, data):
+ data = data.replace("-", "+").replace("_", "/")
+ return standard_b64decode(data + '=' * (-len(data) % 4))
+
+ def getCipherKey(self, key):
+ """ Construct the cipher key from the given data """
+ a = array("I", key)
+ key_array = array("I", [a[0] ^ a[4], a[1] ^a[5], a[2] ^ a[6], a[3] ^a[7]])
+ return key_array
+
+ def callApi(self, **kwargs):
+ """ Dispatch a call to the api, see https://mega.co.nz/#developers """
+ # generate a session id, no idea where to obtain elsewhere
+ uid = random.randint(10 << 9, 10 ** 10)
+
+ resp = self.load(self.API_URL % uid, post=json.dumps([kwargs]))
+ self.logDebug("Api Response: " + resp)
+ return json.loads(resp)
+
+ def decryptAttr(self, data, key):
+
+ cbc = AES.new(self.getCipherKey(key), AES.MODE_CBC, "\0" * 16)
+ attr = cbc.decrypt(self.b64_decode(data))
+ self.logDebug("Decrypted Attr: " + attr)
+ if not attr.startswith("MEGA"):
+ self.fail(_("Decryption failed"))
+
+ # Data is padded, 0-bytes must be stripped
+ return json.loads(attr.replace("MEGA", "").rstrip("\0").strip())
+
+ def decryptFile(self, key):
+ """ Decrypts the file at lastDownload` """
+
+ # upper 64 bit of counter start
+ n = key[16:24]
+
+ # convert counter to long and shift bytes
+ ctr = Counter.new(128, initial_value=long(n.encode("hex"),16) << 64)
+ cipher = AES.new(self.getCipherKey(key), AES.MODE_CTR, counter=ctr)
+
+ self.pyfile.setStatus("decrypting")
+ f = open(self.lastDownload, "rb")
+ df = open(self.lastDownload.rstrip(self.FILE_SUFFIX), "wb")
+
+ # TODO: calculate CBC-MAC for checksum
+
+ size = 2 ** 15 # buffer size, 32k
+ while True:
+ buf = f.read(size)
+ if not buf: break
+
+ df.write(cipher.decrypt(buf))
+
+ f.close()
+ df.close()
+ remove(self.lastDownload)
+
+ def process(self, pyfile):
+
+ key = None
+
+ # match is guaranteed because plugin was chosen to handle url
+ node = re.search(self.__pattern__, pyfile.url).group(2)
+ if "!" in node:
+ node, key = node.split("!")
+
+ self.logDebug("File id: %s | Key: %s" % (node, key))
+
+ if not key:
+ self.fail(_("No file key provided in the URL"))
+
+ # g is for requesting a download url
+ # this is similar to the calls in the mega js app, documentation is very bad
+ dl = self.callApi(a="g", g=1, p=node, ssl=1)[0]
+
+ if "e" in dl:
+ e = dl["e"]
+ # ETEMPUNAVAIL (-18): Resource temporarily not available, please try again later
+ if e == -18:
+ self.retry()
+ else:
+ self.fail(_("Error code:") + e)
+
+ # TODO: map other error codes, e.g
+ # EACCESS (-11): Access violation (e.g., trying to write to a read-only share)
+
+ key = self.b64_decode(key)
+ attr = self.decryptAttr(dl["at"], key)
+
+ pyfile.name = attr["n"] + self.FILE_SUFFIX
+
+ self.download(dl["g"])
+ self.decryptFile(key)
+
+ # Everything is finished and final name can be set
+ pyfile.name = attr["n"]
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py
deleted file mode 100644
index 8693e4303..000000000
--- a/module/plugins/hoster/MegauploadCom.py
+++ /dev/null
@@ -1,171 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-
-from module.plugins.Hoster import Hoster
-
-from module.network.RequestFactory import getURL
-
-from module.utils import html_unescape
-from datatypes.PyFile import statusMap
-
-def getInfo(urls):
- yield [(url, 0, 1, url) for url in urls]
-
-
-def _translateAPIFileInfo(apiFileId, apiFileDataMap, apiHosterMap):
-
- # Translate
- fileInfo = {}
- try:
- fileInfo['status'] = MegauploadCom.API_STATUS_MAPPING[apiFileDataMap[apiFileId]]
- fileInfo['name'] = html_unescape(apiFileDataMap['n'])
- fileInfo['size'] = int(apiFileDataMap['s'])
- fileInfo['hoster'] = apiHosterMap[apiFileDataMap['d']]
- except:
- pass
-
- return fileInfo
-
-class MegauploadCom(Hoster):
- __name__ = "MegauploadCom"
- __type__ = "hoster"
- __pattern__ = r"http://[\w\.]*?(megaupload)\.com/.*?(\?|&)d=(?P<id>[0-9A-Za-z]+)"
- __version__ = "0.32"
- __description__ = """Megaupload.com Download Hoster"""
- __author_name__ = ("spoob")
- __author_mail__ = ("spoob@pyload.org")
-
- API_URL = "http://megaupload.com/mgr_linkcheck.php"
- API_STATUS_MAPPING = {"0": statusMap['online'], "1": statusMap['offline'], "3": statusMap['temp. offline']}
-
- FILE_URL_PATTERN = r'<a href="([^"]+)" class="download_regular_usual"'
- PREMIUM_URL_PATTERN = r'href=\"(http://[^\"]*?)\" class=\"download_premium_but\">'
-
- def init(self):
- self.html = [None, None]
- if self.account:
- self.premium = self.account.getAccountInfo(self.user)["premium"]
-
- if not self.premium:
- self.multiDL = False
- self.chunkLimit = 1
-
- self.api = {}
-
- self.fileID = re.search(self.__pattern__, self.pyfile.url).group("id")
- self.pyfile.url = "http://www.megaupload.com/?d=" + self.fileID
-
-
- def process(self, pyfile):
- self.fail("Hoster not longer available")
-
- def download_html(self):
- for i in range(3):
- self.html[0] = self.load(self.pyfile.url)
- self.html[1] = self.html[0] # in case of no captcha, this already contains waiting time, etc
- count = 0
- if "The file that you're trying to download is larger than 1 GB" in self.html[0]:
- self.fail(_("You need premium to download files larger than 1 GB"))
-
- if re.search(r'<input[^>]*name="filepassword"', self.html[0]):
- pw = self.getPassword()
- if not pw:
- self.fail(_("The file is password protected, enter a password and restart."))
-
- self.html[1] = self.load(self.pyfile.url, post={"filepassword":pw})
- break # looks like there is no captcha for pw protected files
-
- while "document.location='http://www.megaupload.com/?c=msg" in self.html[0]:
- # megaupload.com/?c=msg usually says: Please check back in 2 minutes,
- # so we can spare that http request
- self.setWait(120)
- if count > 1:
- self.wantReconnect = True
-
- self.wait()
-
- self.html[0] = self.load(self.pyfile.url)
- count += 1
- if count > 5:
- self.fail(_("Megaupload is currently blocking your IP. Try again later, manually."))
-
- try:
- url_captcha_html = re.search('(http://[\w\.]*?megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1)
- except:
- continue
-
- captcha = self.decryptCaptcha(url_captcha_html)
- captchacode = re.search('name="captchacode" value="(.*)"', self.html[0]).group(1)
- megavar = re.search('name="megavar" value="(.*)">', self.html[0]).group(1)
- self.html[1] = self.load(self.pyfile.url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar})
- if re.search(r"Waiting time before each download begins", self.html[1]) is not None:
- break
-
- def download_api(self):
-
- # MU API request
- fileId = self.pyfile.url.split("=")[-1] # Get file id from url
- apiFileId = "id0"
- post = {apiFileId: fileId}
- response = getURL(self.API_URL, post=post, decode = True)
- self.log.debug("%s: API response [%s]" % (self.__name__, response))
-
- # Translate API response
- parts = [re.split(r"&(?!amp;|#\d+;)", x) for x in re.split(r"&?(?=id[\d]+=)", response)]
- apiHosterMap = dict([elem.split('=') for elem in parts[0]])
- apiFileDataMap = dict([elem.split('=') for elem in parts[1]])
- self.api = _translateAPIFileInfo(apiFileId, apiFileDataMap, apiHosterMap)
-
- # File info
- try:
- self.pyfile.status = self.api['status']
- self.pyfile.name = self.api['name']
- self.pyfile.size = self.api['size']
- except KeyError:
- self.log.warn("%s: Cannot recover all file [%s] info from API response." % (self.__name__, fileId))
-
- # Fail if offline
- if self.pyfile.status == statusMap['offline']:
- self.offline()
-
- def get_file_url(self):
- search = re.search(self.FILE_URL_PATTERN, self.html[1])
- return search.group(1).replace(" ", "%20") if search else None
-
- def get_file_name(self):
- try:
- name = self.api["name"]
- except KeyError:
- file_name_pattern = 'id="downloadlink"><a href="(.*)" onclick="'
- name = re.search(file_name_pattern, self.html[1]).group(1).split("/")[-1]
-
- return html_unescape(name)
-
- def get_wait_time(self):
- time = re.search(r"count=(\d+);", self.html[1])
- if time:
- return time.group(1)
- else:
- return 60
-
- def file_exists(self):
- #self.download_html()
- if re.search(r"Unfortunately, the link you have clicked is not available.", self.html[0]) is not None or \
- re.search(r"Download limit exceeded", self.html[0]) is not None:
- return False
-
- if re.search("The file you are trying to access is temporarily unavailable", self.html[0]) is not None:
- self.setWait(120)
- self.log.debug("%s: The file is temporarily not available. Waiting 2 minutes." % self.__name__)
- self.wait()
-
- self.download_html()
- if re.search("The file you are trying to access is temporarily unavailable", self.html[0]) is not None:
- self.fail(_("Looks like the file is still not available. Retry downloading later, manually."))
-
- if re.search("The password you have entered is not correct", self.html[1]):
- self.fail(_("Wrong password for download link."))
-
- return True
diff --git a/module/plugins/hoster/MegavideoCom.py b/module/plugins/hoster/MegavideoCom.py
deleted file mode 100644
index fa5d87993..000000000
--- a/module/plugins/hoster/MegavideoCom.py
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-from time import time
-from module.plugins.Hoster import Hoster
-from module.unescape import unescape
-
-class MegavideoCom(Hoster):
- __name__ = "MegavideoCom"
- __type__ = "hoster"
- __pattern__ = r"http://(www\.)?megavideo.com/\?v=.*"
- __version__ = "0.2"
- __description__ = """Megavideo.com Download Hoster"""
- __author_name__ = ("jeix","mkaay")
- __author_mail__ = ("jeix@hasnomail.de","mkaay@mkaay.de")
-
- def setup(self):
- self.html = None
-
- def process(self, pyfile):
- self.pyfile = pyfile
-
- if not self.file_exists():
- self.offline()
-
- self.pyfile.name = self.get_file_name()
- self.download( self.get_file_url() )
-
- def download_html(self):
- url = self.pyfile.url
- self.html = self.req.load(url)
-
- def get_file_url(self):
- """ returns the absolute downloadable filepath
- """
- if self.html is None:
- self.download_html()
-
- # get id
- id = re.search("previewplayer/\\?v=(.*?)&width", self.html).group(1)
-
- # check for hd link and return if there
- if "flashvars.hd = \"1\";" in self.html:
- content = self.req.load("http://www.megavideo.com/xml/videolink.php?v=%s" % id)
- return unescape(re.search("hd_url=\"(.*?)\"", content).group(1))
-
- # else get normal link
- s = re.search("flashvars.s = \"(\\d+)\";", self.html).group(1)
- un = re.search("flashvars.un = \"(.*?)\";", self.html).group(1)
- k1 = re.search("flashvars.k1 = \"(\\d+)\";", self.html).group(1)
- k2 = re.search("flashvars.k2 = \"(\\d+)\";", self.html).group(1)
- return "http://www%s.megavideo.com/files/%s/" % (s, self.__decrypt(un, int(k1), int(k2)))
-
- def __decrypt(self, input, k1, k2):
- req1 = []
- req3 = 0
- for c in input:
- c = int(c, 16)
- tmp = "".join([str((c >> y) & 1) for y in range(4 -1, -1, -1)])
- req1.extend([int(x) for x in tmp])
-
- req6 = []
- req3 = 0
- while req3 < 384:
- k1 = (k1 * 11 + 77213) % 81371
- k2 = (k2 * 17 + 92717) % 192811
- req6.append((k1 + k2) % 128)
- req3 += 1
-
- req3 = 256
- while req3 >= 0:
- req5 = req6[req3]
- req4 = req3 % 128
- req8 = req1[req5]
- req1[req5] = req1[req4]
- req1[req4] = req8
- req3 -= 1
-
- req3 = 0
- while req3 < 128:
- req1[req3] = req1[req3] ^ (req6[req3+256] & 1)
- req3 += 1
-
- out = ""
- req3 = 0
- while req3 < len(req1):
- tmp = req1[req3] * 8
- tmp += req1[req3+1] * 4
- tmp += req1[req3+2] * 2
- tmp += req1[req3+3]
-
- out += "%X" % tmp
-
- req3 += 4
-
- return out.lower()
-
- def get_file_name(self):
- if self.html is None:
- self.download_html()
-
- name = re.search("flashvars.title = \"(.*?)\";", self.html).group(1)
- name = "%s.flv" % unescape(name.encode("ascii", "ignore")).decode("utf-8").encode("ascii", "ignore").replace("+", " ")
- return name
-
- def file_exists(self):
- """ returns True or False
- """
- if self.html is None:
- self.download_html()
-
- if re.search(r"Dieses Video ist nicht verfügbar.", self.html) is not None or \
- re.search(r"This video is unavailable.", self.html) is not None:
- return False
- else:
- return True
-
diff --git a/module/plugins/hoster/NahrajCz.py b/module/plugins/hoster/NahrajCz.py
deleted file mode 100644
index 634c1af7d..000000000
--- a/module/plugins/hoster/NahrajCz.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
-"""
-
-import re
-from module.plugins.Hoster import Hoster
-
-class NahrajCz(Hoster):
- __name__ = "NahrajCz"
- __type__ = "hoster"
- __pattern__ = r"http://.*nahraj.cz/content/download/.*"
- __version__ = "0.2"
- __description__ = """nahraj.cz"""
- __author_name__ = ("zoidberg")
-
- FILE_URL_PATTERN = r'<form id="forwarder" method="post"[^>]*action="([^"]+/([^/"]+))">'
- SUBMIT_PATTERN = r'<input id="submit" type="submit" value="([^"]+)" name="submit"/>'
- #ERR_PATTERN = r'<p class="errorreport_error">Chyba: ([^<]+)</p>'
-
- def setup(self):
- self.multiDL = False
-
- def process(self, pyfile):
- self.html = self.load(pyfile.url)
-
- found = re.search(self.FILE_URL_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (URL)")
- parsed_url = found.group(1)
- pyfile.name = found.group(2)
-
- found = re.search(self.SUBMIT_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (SUBMIT)")
- submit = found.group(1)
-
- self.download(parsed_url, disposition=True, post={
- "submit": submit
- })
- \ No newline at end of file
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index 9310b5c34..fd38be8c0 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -53,7 +53,7 @@ class NetloadIn(Hoster):
__name__ = "NetloadIn"
__type__ = "hoster"
__pattern__ = r"http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)"
- __version__ = "0.40"
+ __version__ = "0.41"
__description__ = """Netload.in Download Hoster"""
__author_name__ = ("spoob", "RaNaN", "Gregy")
__author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "gregy@gregy.cz")
@@ -64,7 +64,7 @@ class NetloadIn(Hoster):
self.multiDL = True
self.chunkLimit = -1
self.resumeDownload = True
-
+
def process(self, pyfile):
self.url = pyfile.url
self.prepare()
@@ -92,7 +92,11 @@ class NetloadIn(Hoster):
id_regex = re.compile(self.__pattern__)
match = id_regex.search(url)
- if not match:
+ if match:
+ #normalize url
+ self.url = 'http://www.netload.in/datei%s.htm' % match.group(1)
+ self.logDebug("URL: %s" % self.url)
+ else:
self.api_data = False
return
@@ -105,7 +109,7 @@ class NetloadIn(Hoster):
self.log.debug("Netload: APIDATA: "+src)
self.api_data = {}
- if src and src not in ("unknown file_data", "unknown_server_data", "No input file specified."):
+ if src and ";" in src and src not in ("unknown file_data", "unknown_server_data", "No input file specified."):
lines = src.split(";")
self.api_data["exists"] = True
self.api_data["fileid"] = lines[0]
diff --git a/module/plugins/hoster/NovafileCom.py b/module/plugins/hoster/NovafileCom.py
new file mode 100644
index 000000000..dfd18761c
--- /dev/null
+++ b/module/plugins/hoster/NovafileCom.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class NovafileCom(XFileSharingPro):
+ __name__ = "NovafileCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*novafile\.com/\w{12}"
+ __version__ = "0.01"
+ __description__ = """novafile.com hoster plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ FILE_SIZE_PATTERN = r'<div class="size">(?P<S>.+?)</div>'
+ #FILE_OFFLINE_PATTERN = '<b>&quot;File Not Found&quot;</b>|File has been removed due to Copyright Claim'
+ FORM_PATTERN = r'name="F\d+"'
+ ERROR_PATTERN = r'class="alert[^"]*alert-separate"[^>]*>\s*(?:<p>)?(.*?)\s*</'
+ DIRECT_LINK_PATTERN = r'<a href="(http://s\d+\.novafile\.com/.*?)" class="btn btn-green">Download File</a>'
+
+ HOSTER_NAME = "novafile.com"
+
+ def setup(self):
+ self.multiDL = False
+
+getInfo = create_getInfo(NovafileCom) \ No newline at end of file
diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py
index fa699a278..126ca3d89 100644
--- a/module/plugins/hoster/NowDownloadEu.py
+++ b/module/plugins/hoster/NowDownloadEu.py
@@ -19,12 +19,13 @@
import re
from random import random
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.utils import fixup
class NowDownloadEu(SimpleHoster):
__name__ = "NowDownloadEu"
__type__ = "hoster"
__pattern__ = r"http://(www\.)?nowdownload\.(eu|co)/dl/(?P<ID>[a-z0-9]+)"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """NowDownloadEu"""
__author_name__ = ("godofdream")
FILE_INFO_PATTERN = r'Downloading</span> <br> (?P<N>.*) (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B </h4>'
@@ -33,6 +34,9 @@ class NowDownloadEu(SimpleHoster):
FILE_CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"'
FILE_WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),'
FILE_DOWNLOAD_LINK = r'"(http://f\d+\.nowdownload\.eu/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"'
+
+ FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')]
+
def setup(self):
self.wantReconnect = False
self.multiDL = True
@@ -59,4 +63,4 @@ class NowDownloadEu(SimpleHoster):
self.logDebug('Download link: ' + str(url.group(1)))
self.download(str(url.group(1)))
-getInfo = create_getInfo(NowDownloadEu) \ No newline at end of file
+getInfo = create_getInfo(NowDownloadEu)
diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py
index 3a4ff7275..46323d829 100644
--- a/module/plugins/hoster/OneFichierCom.py
+++ b/module/plugins/hoster/OneFichierCom.py
@@ -7,10 +7,11 @@ class OneFichierCom(SimpleHoster):
__name__ = "OneFichierCom"
__type__ = "hoster"
__pattern__ = r"(http://(\w+)\.((1fichier|d(es)?fichiers|pjointe)\.(com|fr|net|org)|(cjoint|mesfichiers|piecejointe|oi)\.(org|net)|tenvoi\.(com|org|net)|dl4free\.com|alterupload\.com|megadl.fr))"
- __version__ = "0.44"
+ __version__ = "0.45"
__description__ = """1fichier.com download hoster"""
- __author_name__ = ("fragonib", "the-razer", "zoidberg")
- __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", "zoidberg@mujmail.cz")
+ __author_name__ = ("fragonib", "the-razer", "zoidberg","imclem")
+ __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net",
+ "zoidberg@mujmail.cz","imclem on github")
FILE_NAME_PATTERN = r'">File name :</th>\s*<td>(?P<N>[^<]+)</td>'
FILE_SIZE_PATTERN = r'<th>File size :</th>\s*<td>(?P<S>[^<]+)</td>'
@@ -19,8 +20,7 @@ class OneFichierCom(SimpleHoster):
DOWNLOAD_LINK_PATTERN = r'<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;\s+<a href="(?P<url>http://.*?)"'
PASSWORD_PROTECTED_TOKEN = "protected by password"
- WAITING_PATTERN = "you must wait (\d+) minutes"
-
+ WAITING_PATTERN = "Warning ! Without premium status, you can download only one file at a time and you must wait at least (\d+) minutes between each downloads."
def process(self, pyfile):
found = re.search(self.__pattern__, pyfile.url)
file_id = found.group(2)
diff --git a/module/plugins/hoster/OronCom.py b/module/plugins/hoster/OronCom.py
deleted file mode 100755
index 864b7e96a..000000000
--- a/module/plugins/hoster/OronCom.py
+++ /dev/null
@@ -1,147 +0,0 @@
-# -*- coding: utf-8 -*-
-import re
-
-from module.plugins.Hoster import Hoster
-from module.network.RequestFactory import getURL
-from module.plugins.ReCaptcha import ReCaptcha
-from module.utils import parseFileSize
-
-def getInfo(urls):
- result = []
-
- for url in urls:
- html = getURL(url).replace("\n", "")
- html = html.replace("\t", "")
- if "File could not be found" in html:
- result.append((url, 0, 1, url))
- continue
-
- m = re.search(OronCom.FILE_INFO_PATTERN, html, re.MULTILINE)
- if m:
- name = m.group(1)
- size = parseFileSize(m.group(2), m.group(3))
- else:
- name = url
- size = 0
-
- result.append((name, size, 2, url))
- yield result
-
-
-class OronCom(Hoster):
- __name__ = "OronCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www.)?oron.com/(?!folder)\w+"
- __version__ = "0.16"
- __description__ = "Oron.com Hoster Plugin"
- __author_name__ = ("chrox", "DHMH")
- __author_mail__ = ("chrox@pyload.org", "webmaster@pcProfil.de")
-
- FILE_INFO_PATTERN = r'(?:Filename|Dateiname): <b class="f_arial f_14px">(.*?)</b>\s*<br>\s*(?:Größe|File size): ([0-9,\.]+) (Kb|Mb|Gb)'
-
- def init(self):
- self.resumeDownload = self.multiDL = True if self.account else False
- self.chunkLimit = 1
- self.file_id = re.search(r'http://(?:www.)?oron.com/([a-zA-Z0-9]+)', self.pyfile.url).group(1)
- self.logDebug("File id is %s" % self.file_id)
- self.pyfile.url = "http://oron.com/" + self.file_id
-
- def process(self, pyfile):
- #self.load("http://oron.com/?op=change_lang&lang=german")
- # already logged in, so the above line shouldn't be necessary
- self.html = self.load(self.pyfile.url, ref=False, decode=True).encode("utf-8").replace("\n", "")
- if "File could not be found" in self.html or "Datei nicht gefunden" in self.html or \
- "This file has been blocked for TOS violation." in self.html:
- self.offline()
- self.html = self.html.replace("\t", "")
- m = re.search(self.FILE_INFO_PATTERN, self.html)
- if m:
- pyfile.name = m.group(1)
- pyfile.size = parseFileSize(m.group(2), m.group(3))
- self.logDebug("File Size: %s" % pyfile.formatSize())
- else:
- self.logDebug("Name and/or size not found.")
-
- if self.account:
- self.handlePremium()
- else:
- self.handleFree()
-
- def handleFree(self):
- #self.load("http://oron.com/?op=change_lang&lang=german")
- # already logged in, so the above line shouldn't be necessary
- self.html = self.load(self.pyfile.url, ref=False, decode=True).replace("\n", "")
- if "download1" in self.html:
- post_url = "http://oron.com/" + self.file_id
- post_dict = {'op': 'download1',
- 'usr_login': '',
- 'id': self.file_id,
- 'fname': self.pyfile.name,
- 'referer': '',
- 'method_free': ' Regular Download '}
-
- self.html = self.load(post_url, post=post_dict, ref=False, decode=True).encode("utf-8")
- if '<p class="err">' in self.html:
- time_list = re.findall(r'\d+(?=\s[a-z]+,)|\d+(?=\s.*?until)', self.html)
- tInSec = 0
- for t in time_list:
- tInSec += int(t) * 60 ** (len(time_list) - time_list.index(t) - 1)
- self.setWait(tInSec, True)
- self.wait()
- self.retry()
-
- if "download2" in self.html:
- post_dict['op'] = 'download2'
- post_dict['method_free'] = 'Regular Download'
- post_dict['method_premium'] = ''
- post_dict['down_direct'] = '1'
- post_dict['btn_download'] = ' Create Download Link '
- del(post_dict['fname'])
-
- re_captcha = ReCaptcha(self)
- downloadLink = None
- for i in range(5):
- m = re.search('name="rand" value="(.*?)">', self.html)
- post_dict['rand'] = m.group(1)
- challengeId = re.search(r'/recaptcha/api/challenge[?k=]+([^"]+)', self.html)
- challenge, result = re_captcha.challenge(challengeId.group(1))
- post_dict['recaptcha_challenge_field'] = challenge
- post_dict['recaptcha_response_field'] = result
- self.html = self.load(post_url, post=post_dict)
- m = re.search('<p class="err">(.*?)</p>', self.html)
- if m:
- if m.group(1) == "Wrong captcha":
- self.invalidCaptcha()
- self.logDebug("Captcha failed")
- if 'class="atitle">Download File' in self.html:
- self.correctCaptcha()
- downloadLink = re.search('href="(.*?)" class="atitle"', self.html)
- break
-
- if not downloadLink:
- self.fail("Could not find download link")
-
- self.logDebug("Download url found: %s" % downloadLink.group(1))
- self.download(downloadLink.group(1))
- else:
- self.logError("error in parsing site")
-
- def handlePremium(self):
- info = self.account.getAccountInfo(self.user, True)
- self.logDebug("Traffic left: %s" % info['trafficleft'])
- self.logDebug("File Size: %d" % int(self.pyfile.size / 1024))
-
- if int(self.pyfile.size / 1024) > info["trafficleft"]:
- self.logInfo(_("Not enough traffic left"))
- self.account.empty(self.user)
- self.fail(_("Traffic exceeded"))
-
- post_url = "http://oron.com/" + self.file_id
- m = re.search('name="rand" value="(.*?)">', self.html)
- rand = m.group(1)
- post_dict = {'down_direct': '1', 'id': self.file_id, 'op': 'download2', 'rand': rand, 'referer': '',
- 'method_free': '', 'method_premium': '1'}
-
- self.html = self.load(post_url, post=post_dict, ref=False, decode=True).encode("utf-8")
- link = re.search('href="(.*?)" class="atitle"', self.html).group(1)
- self.download(link)
diff --git a/module/plugins/hoster/PornhubCom.py b/module/plugins/hoster/PornhubCom.py
index 445627873..e1ed612b9 100644
--- a/module/plugins/hoster/PornhubCom.py
+++ b/module/plugins/hoster/PornhubCom.py
@@ -8,7 +8,7 @@ class PornhubCom(Hoster):
__name__ = "PornhubCom"
__type__ = "hoster"
__pattern__ = r'http://[\w\.]*?pornhub\.com/view_video\.php\?viewkey=[\w\d]+'
- __version__ = "0.4"
+ __version__ = "0.5"
__description__ = """Pornhub.com Download Hoster"""
__author_name__ = ("jeix")
__author_mail__ = ("jeix@hasnomail.de")
@@ -61,7 +61,7 @@ class PornhubCom(Hoster):
match = re.search(r'<title[^>]+>([^<]+) - ', self.html)
if match:
- name = re.group(1)
+ name = match.group(1)
else:
matches = re.findall('<h1>(.*?)</h1>', self.html)
if len(matches) > 1:
diff --git a/module/plugins/hoster/Premium4Me.py b/module/plugins/hoster/Premium4Me.py
index cd47a9e91..2679916e9 100644
--- a/module/plugins/hoster/Premium4Me.py
+++ b/module/plugins/hoster/Premium4Me.py
@@ -3,10 +3,13 @@
from urllib import quote
from module.plugins.Hoster import Hoster
+from module.utils import fs_encode
+from os.path import exists
+from os import remove
class Premium4Me(Hoster):
__name__ = "Premium4Me"
- __version__ = "0.10"
+ __version__ = "0.04"
__type__ = "hoster"
__pattern__ = r"http://premium4.me/.*"
@@ -55,4 +58,4 @@ class Premium4Me(Hoster):
traffic = int(self.load ("http://premium4.me/api/traffic.php?authcode=%s" % self.account.authcode))
except:
traffic = 0
- return traffic \ No newline at end of file
+ return traffic
diff --git a/module/plugins/hoster/PrzeklejPl.py b/module/plugins/hoster/PrzeklejPl.py
deleted file mode 100644
index e97fb551e..000000000
--- a/module/plugins/hoster/PrzeklejPl.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
-"""
-
-import re
-from module.plugins.Hoster import Hoster
-
-class PrzeklejPl(Hoster):
- __name__ = "PrzeklejPl"
- __type__ = "hoster"
- __pattern__ = r"http://.*przeklej.pl/plik/.*"
- __version__ = "0.1"
- __description__ = """przeklej.pl"""
- __author_name__ = ("zoidberg")
-
- FILE_URL_PATTERN = r'<a href="([^"]+)" title="Pobierz plik">([^<]+)</a>'
-
- #ERR_PATTERN = r'<p class="errorreport_error">Chyba: ([^<]+)</p>'
-
- def setup(self):
- self.multiDL = True
-
- def process(self, pyfile):
- self.html = self.load(pyfile.url, decode=True)
-
- found = re.search(self.FILE_URL_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (URL)")
- parsed_url = found.group(1)
- pyfile.name = found.group(2)
-
- self.download("http://www.przeklej.pl" + parsed_url)
- \ No newline at end of file
diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py
index 8cfcd4d9e..ca5336231 100644
--- a/module/plugins/hoster/PutlockerCom.py
+++ b/module/plugins/hoster/PutlockerCom.py
@@ -52,7 +52,7 @@ class PutlockerCom(Hoster):
__name__ = "PutlockerCom"
__type__ = "hoster"
__pattern__ = r'http://(www\.)?putlocker\.com/(file|embed)/[A-Z0-9]+'
- __version__ = "0.2"
+ __version__ = "0.21"
__description__ = """Putlocker.Com"""
__author_name__ = ("jeix")
@@ -111,6 +111,9 @@ class PutlockerCom(Hoster):
self.link = re.search("\"(/get_file\\.php\\?download=[A-Z0-9]+\\&key=[a-z0-9]+&original=1)\"", self.html2)
if self.link is None:
+ self.link = re.search("\"(/get_file\\.php\\?id=[A-Z0-9]+\\&key=[A-Za-z0-9=]+\\&original=1)\"", self.html2)
+
+ if self.link is None:
self.link = re.search("playlist: \\'(/get_file\\.php\\?stream=[A-Za-z0-9=]+)\\'", self.html2)
if not self.link is None:
self.html3 = self.load("http://www.putlocker.com" + self.link.group(1))
diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py
index ef33d3263..4932c4702 100644
--- a/module/plugins/hoster/QuickshareCz.py
+++ b/module/plugins/hoster/QuickshareCz.py
@@ -18,51 +18,82 @@
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from pycurl import FOLLOWLOCATION
class QuickshareCz(SimpleHoster):
__name__ = "QuickshareCz"
__type__ = "hoster"
__pattern__ = r"http://.*quickshare.cz/stahnout-soubor/.*"
- __version__ = "0.52"
+ __version__ = "0.54"
__description__ = """Quickshare.cz"""
__author_name__ = ("zoidberg")
- VAR_PATTERN = r"var ID1 = '(?P<ID1>[^']+)';var ID2 = '(?P<ID2>[^']+)';var ID3 = '(?P<ID3>[^']+)';var ID4 = '(?P<ID4>[^']+)';var ID5 = '[^']*';var UU_prihlasen = '[^']*';var UU_kredit = [^;]*;var velikost = [^;]*;var kredit_odecet = [^;]*;var CaptchaText = '(?P<CaptchaText>[^']+)';var server = '(?P<Server>[^']+)';"
- FILE_OFFLINE_PATTERN = r'<script type="text/javascript">location.href=\'/chyba\';</script>'
FILE_NAME_PATTERN = r'<th width="145px">Název:</th>\s*<td style="word-wrap:break-word;">(?P<N>[^<]+)</td>'
FILE_SIZE_PATTERN = r'<th>Velikost:</th>\s*<td>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</td>'
-
- def setup(self):
- self.multiDL = False
+ FILE_OFFLINE_PATTERN = r'<script type="text/javascript">location.href=\'/chyba\';</script>'
def process(self, pyfile):
- self.html = self.load(pyfile.url, decode=True)
+ self.html = self.load(pyfile.url, decode = True)
self.getFileInfo()
-
- # parse the name from the site and set attribute in pyfile
- parsed_vars = re.search(self.VAR_PATTERN, self.html)
- if parsed_vars is None: self.parseError("VARs")
- pyfile.name = parsed_vars.group('ID3')
-
- # download the file, destination is determined by pyLoad
- download_url = parsed_vars.group('Server') + "/download.php"
- self.log.debug("File:" + pyfile.name)
- self.log.debug("URL:" + download_url)
-
- self.download(download_url, post={
- "ID1": parsed_vars.group('ID1'),
- "ID2": parsed_vars.group('ID2'),
- "ID3": parsed_vars.group('ID3'),
- "ID4": parsed_vars.group('ID4')
- })
-
- # check download
- check = self.checkDownload({
- "no_slots": "obsazen na 100 %"
- })
+ # parse js variables
+ self.jsvars = dict((x, y.strip("'")) for x,y in re.findall(r"var (\w+) = ([0-9.]+|'[^']*')", self.html))
+ self.logDebug(self.jsvars)
+ pyfile.name = self.jsvars['ID3']
+
+ # determine download type - free or premium
+ if self.premium:
+ if 'UU_prihlasen' in self.jsvars:
+ if self.jsvars['UU_prihlasen'] == '0':
+ self.logWarning('User not logged in')
+ self.relogin(self.user)
+ self.retry()
+ elif float(self.jsvars['UU_kredit']) < float(self.jsvars['kredit_odecet']):
+ self.logWarning('Not enough credit left')
+ self.premium = False
+
+ if self.premium:
+ self.handlePremium()
+ else:
+ self.handleFree()
+
+ check = self.checkDownload({"err": re.compile(r"\AChyba!")}, max_size=100)
+ if check == "err":
+ self.fail("File not found or plugin defect")
+
+ def handleFree(self):
+ # get download url
+ download_url = '%s/download.php' % self.jsvars['server']
+ data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ('ID1', 'ID2', 'ID3', 'ID4'))
+ self.logDebug("FREE URL1:" + download_url, data)
+
+ self.req.http.c.setopt(FOLLOWLOCATION, 0)
+ self.load(download_url, post=data)
+ self.header = self.req.http.header
+ self.req.http.c.setopt(FOLLOWLOCATION, 1)
+
+ found = re.search("Location\s*:\s*(.*)", self.header, re.I)
+ if not found: self.fail('File not found')
+ download_url = found.group(1)
+ self.logDebug("FREE URL2:" + download_url)
+
+ # check errors
+ found = re.search(r'/chyba/(\d+)', download_url)
+ if found:
+ if found.group(1) == '1':
+ self.retry(max_tries=60, wait_time=120, reason="This IP is already downloading")
+ elif found.group(1) == '2':
+ self.retry(max_tries=60, wait_time=60, reason="No free slots available")
+ else:
+ self.fail('Error %d' % found.group(1))
- if check == "no_slots":
- self.retry(5, 600, "No free slots")
+ # download file
+ self.download(download_url)
+
+ def handlePremium(self):
+ download_url = '%s/download_premium.php' % self.jsvars['server']
+ data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ('ID1', 'ID2', 'ID4', 'ID5'))
+ self.logDebug("PREMIUM URL:" + download_url, data)
+ self.download(download_url, get=data)
-create_getInfo(QuickshareCz) \ No newline at end of file
+getInfo = create_getInfo(QuickshareCz)
diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py
index 678a3d707..1cc3ff8ae 100644
--- a/module/plugins/hoster/RapidgatorNet.py
+++ b/module/plugins/hoster/RapidgatorNet.py
@@ -21,90 +21,106 @@ from pycurl import HTTPHEADER
from random import random
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia, AdsCaptcha
from module.common.json_layer import json_loads
-from module.plugins.ReCaptcha import ReCaptcha
-
-class AdsCaptcha():
- def __init__(self, plugin):
- self.plugin = plugin
-
- def challenge(self, src):
- js = self.plugin.req.load(src, cookies=True)
-
- try:
- challenge = re.search("challenge: '(.*?)',", js).group(1)
- server = re.search("server: '(.*?)',", js).group(1)
- except:
- self.plugin.fail("adscaptcha error")
- result = self.result(server,challenge)
-
- return challenge, result
-
- def result(self, server, challenge):
- return self.plugin.decryptCaptcha("%sChallenge.aspx" % server, get={"cid": challenge, "dummy": random()}, cookies=True, imgtype="jpg")
-
-class SolveMedia():
- def __init__(self,plugin):
- self.plugin = plugin
-
- def challenge(self, src):
- html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.script?k=%s" % src, cookies=True)
- try:
- ckey = re.search("ckey:.*?'(.*?)',",html).group(1)
- html = self.plugin.req.load("http://api.solvemedia.com/papi/_challenge.js?k=%s" % ckey, cookies=True)
- challenge = re.search('"chid".*?: "(.*?)"',html).group(1)
- except:
- self.plugin.fail("solvmedia error")
- result = self.result(challenge)
-
- return challenge, result
-
- def result(self,challenge):
- return self.plugin.decryptCaptcha("http://api.solvemedia.com/papi/media?c=%s" % challenge,imgtype="gif")
-
+from module.network.HTTPRequest import BadHeader
class RapidgatorNet(SimpleHoster):
__name__ = "RapidgatorNet"
__type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\d+)"
- __version__ = "0.06"
+ __pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\w+)"
+ __version__ = "0.16"
__description__ = """rapidgator.net"""
__author_name__ = ("zoidberg","chrox")
-
+
+ API_URL = 'http://rapidgator.net/api/file'
+
FILE_INFO_PATTERN = r'Downloading:(\s*<[^>]*>)*\s*(?P<N>.*?)(\s*<[^>]*>)*\s*File size:\s*<strong>(?P<S>.*?)</strong>'
FILE_OFFLINE_PATTERN = r'<title>File not found</title>'
-
- JSVARS_PATTERN = r"\s+var\s*(startTimerUrl|getDownloadUrl|captchaUrl|fid|secs)\s*=\s*'?(.*?)'?;"
- DOWNLOAD_LINK_PATTERN = r"location.href = '(.*?)'"
+
+ JSVARS_PATTERN = r"\s+var\s*(startTimerUrl|getDownloadUrl|captchaUrl|fid|secs)\s*=\s*'?(.*?)'?;"
+ DOWNLOAD_LINK_PATTERN = r"location.href = '([^']+)';\s*}\s*return false;"
RECAPTCHA_KEY_PATTERN = r'"http://api.recaptcha.net/challenge?k=(.*?)"'
ADSCAPTCHA_SRC_PATTERN = r'(http://api.adscaptcha.com/Get.aspx[^"\']*)'
SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"'
+
+ def setup(self):
+ self.resumeDownload = False
+ self.multiDL = False
+ self.sid = None
+ self.chunkLimit = 1
+ self.req.setOption("timeout", 120)
+
+ def process(self, pyfile):
+ if self.account:
+ self.sid = self.account.getAccountData(self.user).get('SID', None)
+ if self.sid:
+ self.handlePremium()
+ else:
+ self.handleFree()
+
+ def getAPIResponse(self, cmd):
+ try:
+ json = self.load('%s/%s' % (self.API_URL, cmd),
+ get = {'sid': self.sid,
+ 'url': self.pyfile.url}, decode = True)
+ self.logDebug('API:%s' % cmd, json, "SID: %s" % self.sid)
+ json = json_loads(json)
+ status = json['response_status']
+ msg = json['response_details']
+ except BadHeader, e:
+ self.logError('API:%s' % cmd, e, "SID: %s" % self.sid)
+ status = e.code
+ msg = e
+
+ if status == 200:
+ return json['response']
+ elif status == 423:
+ self.account.empty(self.user)
+ self.retry()
+ else:
+ self.account.relogin(self.user)
+ self.retry(wait_time=60)
+
+ def handlePremium(self):
+ #self.logDebug("ACCOUNT_DATA", self.account.getAccountData(self.user))
+ self.api_data = self.getAPIResponse('info')
+ self.api_data['md5'] = self.api_data['hash']
+ self.pyfile.name = self.api_data['filename']
+ self.pyfile.size = self.api_data['size']
+ url = self.getAPIResponse('download')['url']
+ self.multiDL = True
+ self.download(url)
+
def handleFree(self):
+ self.html = self.load(self.pyfile.url, decode = True)
+ self.getFileInfo()
+
if "You can download files up to 500 MB in free mode" in self.html \
or "This file can be downloaded by premium only" in self.html:
self.fail("Premium account needed for download")
-
- self.checkWait()
-
+
+ self.checkWait()
+
jsvars = dict(re.findall(self.JSVARS_PATTERN, self.html))
self.logDebug(jsvars)
-
+
self.req.http.lastURL = self.pyfile.url
self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
-
- url = "http://rapidgator.net%s?fid=%s" % (jsvars.get('startTimerUrl', '/download/AjaxStartTimer'), jsvars["fid"])
+
+ url = "http://rapidgator.net%s?fid=%s" % (jsvars.get('startTimerUrl', '/download/AjaxStartTimer'), jsvars["fid"])
jsvars.update(self.getJsonResponse(url))
-
+
self.setWait(int(jsvars.get('secs', 30)) + 1, False)
self.wait()
-
+
url = "http://rapidgator.net%s?sid=%s" % (jsvars.get('getDownloadUrl', '/download/AjaxGetDownload'), jsvars["sid"])
jsvars.update(self.getJsonResponse(url))
-
+
self.req.http.lastURL = self.pyfile.url
self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With:"])
-
+
url = "http://rapidgator.net%s" % jsvars.get('captchaUrl', '/download/captcha')
self.html = self.load(url)
found = re.search(self.ADSCAPTCHA_SRC_PATTERN, self.html)
@@ -116,19 +132,15 @@ class RapidgatorNet(SimpleHoster):
if found:
captcha_key = found.group(1)
captcha = ReCaptcha(self)
-
+
else:
found = re.search(self.SOLVEMEDIA_PATTERN, self.html)
if found:
captcha_key = found.group(1)
captcha = SolveMedia(self)
else:
- self.parseError("Captcha:"+st)
- if captcha.__class__.__name__ == "SolveMedia":
- captcha_prov = "adcopy"
- else:
- captcha_prov = captcha.__class__.__name__.lower()
-
+ self.parseError("Captcha")
+
for i in range(5):
self.checkWait()
captcha_challenge, captcha_response = captcha.challenge(captcha_key)
@@ -146,14 +158,14 @@ class RapidgatorNet(SimpleHoster):
break
else:
self.fail("No valid captcha solution received")
-
+
found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html)
if not found:
self.parseError("download link")
download_url = found.group(1)
self.logDebug(download_url)
self.download(download_url)
-
+
def checkWait(self):
found = re.search(r"(?:Delay between downloads must be not less than|Try again in)\s*(\d+)\s*(hour|min)", self.html)
if found:
@@ -164,18 +176,17 @@ class RapidgatorNet(SimpleHoster):
wait_time = 60
else:
return
-
+
self.logDebug("Waiting %d minutes" % wait_time)
self.setWait(wait_time * 60, True)
self.wait()
self.retry(max_tries = 24)
-
+
def getJsonResponse(self, url):
response = self.load(url, decode = True)
if not response.startswith('{'):
- self.retry()
+ self.retry()
self.logDebug(url, response)
- return json_loads(response)
+ return json_loads(response)
getInfo = create_getInfo(RapidgatorNet)
-
diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py
index 8339d40eb..7c5543cc8 100644
--- a/module/plugins/hoster/RarefileNet.py
+++ b/module/plugins/hoster/RarefileNet.py
@@ -7,13 +7,17 @@ class RarefileNet(XFileSharingPro):
__name__ = "RarefileNet"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*rarefile.net/\w{12}"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """Rarefile.net hoster plugin"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
FILE_NAME_PATTERN = r'<td><font color="red">(?P<N>.*?)</font></td>'
FILE_SIZE_PATTERN = r'<td>Size : (?P<S>.+?)&nbsp;'
+ HOSTER_NAME = "rarefile.net"
+
+ def setup(self):
+ self.resumeDownload = self.multiDL = self.premium
def handleCaptcha(self, inputs):
captcha_div = re.search(r'<b>Enter code.*?<div.*?>(.*?)</div>', self.html, re.S).group(1)
diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py
index 370adf077..141dcb8c8 100644
--- a/module/plugins/hoster/RehostTo.py
+++ b/module/plugins/hoster/RehostTo.py
@@ -6,9 +6,8 @@ from module.plugins.Hoster import Hoster
class RehostTo(Hoster):
__name__ = "RehostTo"
- __version__ = "0.1"
+ __version__ = "0.11"
__type__ = "hoster"
-
__pattern__ = r"https?://.*rehost.to\..*"
__description__ = """rehost.com hoster plugin"""
__author_name__ = ("RaNaN")
@@ -18,7 +17,7 @@ class RehostTo(Hoster):
return unquote(url.rsplit("/", 1)[1])
def setup(self):
- self.chunkLimit = 3
+ self.chunkLimit = 1
self.resumeDownload = True
def process(self, pyfile):
diff --git a/module/plugins/hoster/ReloadCc.py b/module/plugins/hoster/ReloadCc.py
new file mode 100644
index 000000000..7dc6d9bb6
--- /dev/null
+++ b/module/plugins/hoster/ReloadCc.py
@@ -0,0 +1,103 @@
+from module.plugins.Hoster import Hoster
+
+from module.common.json_layer import json_loads
+
+from module.network.HTTPRequest import BadHeader
+
+class ReloadCc(Hoster):
+ __name__ = "ReloadCc"
+ __version__ = "0.4"
+ __type__ = "hoster"
+ __description__ = """Reload.Cc hoster plugin"""
+
+ # Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady create the regex patterns for us using getHosters in our ReloadCc hook.
+ __pattern__ = None
+
+ __author_name__ = ("Reload Team")
+ __author_mail__ = ("hello@reload.cc")
+
+ def process(self, pyfile):
+ # Check account
+ if not self.account or not self.account.canUse():
+ self.logError("Please enter a valid reload.cc account or deactivate this plugin")
+ self.fail("No valid reload.cc account provided")
+
+ # In some cases hostsers do not supply us with a filename at download, so we are going to set a fall back filename (e.g. for freakshare or xfileshare)
+ self.pyfile.name = self.pyfile.name.split('/').pop() # Remove everthing before last slash
+
+ # Correction for automatic assigned filename: Removing html at end if needed
+ suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"]
+ temp = self.pyfile.name.split('.')
+ if temp.pop() in suffix_to_remove:
+ self.pyfile.name = ".".join(temp)
+
+ # Get account data
+ (user, data) = self.account.selectAccount()
+
+ query_params = dict(
+ via='pyload',
+ v=1,
+ user=user,
+ uri=self.pyfile.url
+ )
+
+ try:
+ query_params.update(dict(hash=self.account.infos[user]['pwdhash']))
+ except Exception:
+ query_params.update(dict(pwd=data['password']))
+
+ try:
+ answer = self.load("http://api.reload.cc/dl", get=query_params)
+ except BadHeader, e:
+ if e.code == 400:
+ self.fail("The URI is not supported by Reload.cc.")
+ elif e.code == 401:
+ self.fail("Wrong username or password")
+ elif e.code == 402:
+ self.fail("Your account is inactive. A payment is required for downloading!")
+ elif e.code == 403:
+ self.fail("Your account is disabled. Please contact the Reload.cc support!")
+ elif e.code == 409:
+ self.logWarning("The hoster seems to be a limited hoster and you've used your daily traffic for this hoster: %s" % self.pyfile.url)
+ # Wait for 6 hours and retry up to 4 times => one day
+ self.retry(max_retries=4, wait_time=(3600 * 6), reason="Limited hoster traffic limit exceeded")
+ elif e.code == 429:
+ self.retry(max_retries=5, wait_time=120, reason="Too many concurrent connections") # Too many connections, wait 2 minutes and try again
+ elif e.code == 503:
+ self.retry(wait_time=600, reason="Reload.cc is currently in maintenance mode! Please check again later.") # Retry in 10 minutes
+ else:
+ self.fail("Internal error within Reload.cc. Please contact the Reload.cc support for further information.")
+ return
+
+ data = json_loads(answer)
+
+ # Check status and decide what to do
+ status = data.get('status', None)
+ if status == "ok":
+ conn_limit = data.get('msg', 0)
+ # API says these connections are limited
+ # Make sure this limit is used - the download will fail if not
+ if conn_limit > 0:
+ try:
+ self.limitDL = int(conn_limit)
+ except ValueError:
+ self.limitDL = 1
+ else:
+ self.limitDL = 0
+
+ try:
+ self.download(data['link'], disposition=True)
+ except BadHeader, e:
+ if e.code == 404:
+ self.fail("File Not Found")
+ elif e.code == 412:
+ self.fail("File access password is wrong")
+ elif e.code == 417:
+ self.fail("Password required for file access")
+ elif e.code == 429:
+ self.retry(max_retries=5, wait_time=120, reason="Too many concurrent connections") # Too many connections, wait 2 minutes and try again
+ else:
+ self.fail("Internal error within Reload.cc. Please contact the Reload.cc support for further information.")
+ return
+ else:
+ self.fail("Internal error within Reload.cc. Please contact the Reload.cc support for further information.")
diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py
index b3d7bafc6..c2ff54e0c 100644
--- a/module/plugins/hoster/RyushareCom.py
+++ b/module/plugins/hoster/RyushareCom.py
@@ -1,18 +1,53 @@
# -*- coding: utf-8 -*-
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+import re
+
class RyushareCom(XFileSharingPro):
__name__ = "RyushareCom"
__type__ = "hoster"
- __pattern__ = r"http://(?:\w*\.)*?ryushare.com/\w{12}"
- __version__ = "0.02"
+ __pattern__ = r"http://(?:\w*\.)*?ryushare.com/\w{11,}"
+ __version__ = "0.10"
__description__ = """ryushare.com hoster plugin"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
+ __author_name__ = ("zoidberg", "stickell")
+ __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+
HOSTER_NAME = "ryushare.com"
-
+
+ WAIT_PATTERN = r'(?:You have to|Please) wait (?:(?P<min>\d+) minutes, )?(?:<span id="[^"]+">)?(?P<sec>\d+)(?:</span>)? seconds'
+ DIRECT_LINK_PATTERN = r'<a href="([^"]+)">Click here to download</a>'
+
def setup(self):
self.resumeDownload = self.multiDL = self.premium
+ # Up to 3 chunks allowed in free downloads. Unknown for premium
+ self.chunkLimit = 3
+
+ def getDownloadLink(self):
+ self.html = self.load(self.pyfile.url)
+ action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")})
+ if inputs.has_key('method_premium'):
+ del inputs['method_premium']
+
+ self.html = self.load(self.pyfile.url, post = inputs)
+ action, inputs = self.parseHtmlForm('F1')
+
+ for i in xrange(10):
+ self.logInfo('Attempt to detect direct link #%d' % i)
+
+ # Wait
+ if 'You have reached the download-limit!!!' in self.html:
+ self.setWait(3600, True)
+ else:
+ m = re.search(self.WAIT_PATTERN, self.html).groupdict('0')
+ waittime = int(m['min']) * 60 + int(m['sec'])
+ self.setWait(waittime)
+ self.wait()
+
+ self.html = self.load(self.pyfile.url, post = inputs)
+ if 'Click here to download' in self.html:
+ m = re.search(self.DIRECT_LINK_PATTERN, self.html)
+ return m.group(1)
+
+ self.parseError('No direct link within 10 retries')
-getInfo = create_getInfo(RyushareCom) \ No newline at end of file
+getInfo = create_getInfo(RyushareCom)
diff --git a/module/plugins/hoster/SecureUploadEu.py b/module/plugins/hoster/SecureUploadEu.py
new file mode 100644
index 000000000..b9a900d96
--- /dev/null
+++ b/module/plugins/hoster/SecureUploadEu.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+
+class SecureUploadEu(XFileSharingPro):
+ __name__ = "SecureUploadEu"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?secureupload\.eu/(\w){12}(/\w+)"
+ __version__ = "0.01"
+ __description__ = """SecureUpload.eu hoster plugin"""
+ __author_name__ = ("z00nx")
+ __author_mail__ = ("z00nx0@gmail.com")
+
+ HOSTER_NAME = "secureupload.eu"
+ FILE_INFO_PATTERN = '<h3>Downloading (?P<N>[^<]+) \((?P<S>[^<]+)\)</h3>'
+ FILE_OFFLINE_PATTERN = 'The file was removed|File Not Found'
+
+getInfo = create_getInfo(SecureUploadEu)
diff --git a/module/plugins/hoster/SendmywayCom.py b/module/plugins/hoster/SendmywayCom.py
new file mode 100644
index 000000000..fcbac850a
--- /dev/null
+++ b/module/plugins/hoster/SendmywayCom.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+
+class SendmywayCom(XFileSharingPro):
+ __name__ = "SendmywayCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?sendmyway.com/\w{12}"
+ __version__ = "0.01"
+ __description__ = """SendMyWay hoster plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ FILE_NAME_PATTERN = r'<p class="file-name" ><.*?>\s*(?P<N>.+)'
+ FILE_SIZE_PATTERN = r'<small>\((?P<S>\d+) bytes\)</small>'
+ HOSTER_NAME = "sendmyway.com"
+
+getInfo = create_getInfo(SendmywayCom)
diff --git a/module/plugins/hoster/Share76Com.py b/module/plugins/hoster/Share76Com.py
new file mode 100644
index 000000000..db850cb73
--- /dev/null
+++ b/module/plugins/hoster/Share76Com.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class Share76Com(XFileSharingPro):
+ __name__ = "Share76Com"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?share76.com/\w{12}"
+ __version__ = "0.03"
+ __description__ = """share76.com hoster plugin"""
+ __author_name__ = ("me")
+
+ FILE_INFO_PATTERN = r'<h2>\s*File:\s*<font[^>]*>(?P<N>[^>]+)</font>\s*\[<font[^>]*>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</font>\]</h2>'
+ HOSTER_NAME = "share76.com"
+
+ def setup(self):
+ self.resumeDownload = self.multiDL = self.premium
+ self.chunkLimit = 1
+
+getInfo = create_getInfo(Share76Com)
diff --git a/module/plugins/hoster/ShareFilesCo.py b/module/plugins/hoster/ShareFilesCo.py
new file mode 100644
index 000000000..ee44b0a1f
--- /dev/null
+++ b/module/plugins/hoster/ShareFilesCo.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+import re
+
+class ShareFilesCo(XFileSharingPro):
+ __name__ = "ShareFilesCo"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?sharefiles\.co/\w{12}"
+ __version__ = "0.01"
+ __description__ = """Sharefiles.co hoster plugin"""
+ __author_name__ = ("stickell")
+ __author_mail__ = ("l.stickell@yahoo.it")
+
+ HOSTER_NAME = "sharefiles.co"
+
+ def startDownload(self, link):
+ link = link.strip()
+ if link.startswith('http://adf.ly'):
+ link = re.sub('http://adf.ly/\d+/', '', link)
+ if self.captcha: self.correctCaptcha()
+ self.logDebug('DIRECT LINK: %s' % link)
+ self.download(link)
+
+getInfo = create_getInfo(ShareFilesCo)
diff --git a/module/plugins/hoster/ShareRapidCom.py b/module/plugins/hoster/ShareRapidCom.py
index 4a25d4027..5a08fed1f 100644
--- a/module/plugins/hoster/ShareRapidCom.py
+++ b/module/plugins/hoster/ShareRapidCom.py
@@ -9,8 +9,6 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
from module.common.json_layer import json_loads
def checkFile(url):
- info = {"name" : url, "size" : 0, "status" : 3}
-
response = getURL("http://share-rapid.com/checkfiles.php", post = {"files": url}, decode = True)
info = json_loads(response)
@@ -44,8 +42,8 @@ def getInfo(urls):
class ShareRapidCom(SimpleHoster):
__name__ = "ShareRapidCom"
__type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/stahuj/(.+)"
- __version__ = "0.50"
+ __pattern__ = r"http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/stahuj/(\w+)"
+ __version__ = "0.52"
__description__ = """Share-rapid.com plugin - premium only"""
__author_name__ = ("MikyWoW", "zoidberg")
__author_mail__ = ("MikyWoW@seznam.cz", "zoidberg@mujmail.cz")
@@ -57,6 +55,8 @@ class ShareRapidCom(SimpleHoster):
DOWNLOAD_URL_PATTERN = r'<a href="([^"]+)" title="Stahnout">([^<]+)</a>'
ERR_LOGIN_PATTERN = ur'<div class="error_div"><strong>Stahování je přístupné pouze přihlášeným uživatelům'
ERR_CREDIT_PATTERN = ur'<div class="error_div"><strong>Stahování zdarma je možné jen přes náš'
+
+ FILE_URL_REPLACEMENTS = [(__pattern__, r'http://share-rapid.com/stahuj/\1')]
def setup(self):
self.chunkLimit = 1
@@ -101,4 +101,4 @@ class ShareRapidCom(SimpleHoster):
elif re.search(self.ERR_CREDIT_PATTERN, self.html):
self.fail("Not enough credit left")
else:
- self.fail("Download link not found") \ No newline at end of file
+ self.fail("Download link not found")
diff --git a/module/plugins/hoster/SharebeesCom.py b/module/plugins/hoster/SharebeesCom.py
new file mode 100644
index 000000000..f5bacc5b0
--- /dev/null
+++ b/module/plugins/hoster/SharebeesCom.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+
+class SharebeesCom(XFileSharingPro):
+ __name__ = "SharebeesCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?sharebees.com/\w{12}"
+ __version__ = "0.01"
+ __description__ = """ShareBees hoster plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ FILE_NAME_PATTERN = r'<p class="file-name" ><.*?>\s*(?P<N>.+)'
+ FILE_SIZE_PATTERN = r'<small>\((?P<S>\d+) bytes\)</small>'
+ FORM_PATTERN = 'F1'
+ HOSTER_NAME = "sharebees.com"
+
+getInfo = create_getInfo(SharebeesCom)
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index e47aa0e5e..e1867168b 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -17,7 +17,7 @@ def getInfo(urls):
for chunk in chunks(urls, 90):
api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","").rstrip("/") for x in chunk)} #api only supports old style links
- src = getURL(api_url_base, post=api_param_file)
+ src = getURL(api_url_base, post=api_param_file, decode=True)
result = []
for i, res in enumerate(src.split("\n")):
if not res:
@@ -43,7 +43,7 @@ class ShareonlineBiz(Hoster):
__name__ = "ShareonlineBiz"
__type__ = "hoster"
__pattern__ = r"http://[\w\.]*?(share\-online\.biz|egoshare\.com)/(download.php\?id\=|dl/)[\w]+"
- __version__ = "0.34"
+ __version__ = "0.36"
__description__ = """Shareonline.biz Download Hoster"""
__author_name__ = ("spoob", "mkaay", "zoidberg")
__author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz")
@@ -57,7 +57,8 @@ class ShareonlineBiz(Hoster):
self.file_id = re.search(r"(id\=|/dl/)([a-zA-Z0-9]+)", self.pyfile.url).group(2)
self.pyfile.url = "http://www.share-online.biz/dl/" + self.file_id
- self.resumeDownload = self.multiDL = self.premium
+ self.resumeDownload = self.premium
+ self.multiDL = False
#self.chunkLimit = 1
self.check_data = None
@@ -84,7 +85,7 @@ class ShareonlineBiz(Hoster):
def downloadAPIData(self):
api_url_base = "http://api.share-online.biz/linkcheck.php?md5=1"
api_param_file = {"links": self.pyfile.url.replace("http://www.share-online.biz/dl/","")} #api only supports old style links
- src = self.load(api_url_base, cookies=False, post=api_param_file)
+ src = self.load(api_url_base, cookies=False, post=api_param_file, decode=True)
fields = src.split(";")
self.api_data = {"fileid": fields[0],
@@ -139,7 +140,6 @@ class ShareonlineBiz(Hoster):
self.retry(5, 60, "Cookie failure")
elif check == "fail":
self.retry(5, 300, "Download failed")
-
def checkErrors(self):
found = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL)
@@ -165,7 +165,9 @@ class ShareonlineBiz(Hoster):
def handleAPIPremium(self): #should be working better
self.account.getAccountInfo(self.user, True)
- src = self.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=download&lid=%s" % (self.user, self.account.accounts[self.user]["password"], self.file_id), post={})
+ src = self.load("http://api.share-online.biz/account.php",
+ {"username": self.user, "password": self.account.accounts[self.user]["password"], "act": "download", "lid": self.file_id})
+
self.api_data = dlinfo = {}
for line in src.splitlines():
key, value = line.split(": ")
@@ -182,6 +184,7 @@ class ShareonlineBiz(Hoster):
if dlLink == "server_under_maintenance":
self.tempoffline()
else:
+ self.multiDL = True
self.download(dlLink)
def checksum(self, local_file):
diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py
new file mode 100644
index 000000000..7f0dee0e5
--- /dev/null
+++ b/module/plugins/hoster/ShareplaceCom.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+import urllib
+from module.plugins.Hoster import Hoster
+
+class ShareplaceCom(Hoster):
+ __name__ = "ShareplaceCom"
+ __type__ = "hoster"
+ __pattern__ = r"(http://)?(www\.)?shareplace\.(com|org)/\?[a-zA-Z0-9]+"
+ __version__ = "0.1"
+ __description__ = """Shareplace.com Download Hoster"""
+ __author_name__ = ("ACCakut, based on YourfilesTo by jeix and skydancer")
+ __author_mail__ = ("none")
+
+ def setup(self):
+ self.html = None
+ self.multiDL = True
+
+ def process(self,pyfile):
+ self.pyfile = pyfile
+ self.prepare()
+ self.download(self.get_file_url())
+
+ def prepare(self):
+ if not self.file_exists():
+ self.offline()
+
+ self.pyfile.name = self.get_file_name()
+
+ wait_time = self.get_waiting_time()
+ self.setWait(wait_time)
+ self.log.debug("%s: Waiting %d seconds." % (self.__name__,wait_time))
+ self.wait()
+
+ def get_waiting_time(self):
+ if self.html is None:
+ self.download_html()
+
+ #var zzipitime = 15;
+ m = re.search(r'var zzipitime = (\d+);', self.html)
+ if m:
+ sec = int(m.group(1))
+ else:
+ sec = 0
+
+ return sec
+
+ def download_html(self):
+ url = re.sub("shareplace.com\/\?", "shareplace.com//index1.php/?a=", self.pyfile.url)
+ self.html = self.load(url, decode=True)
+
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ url = re.search(r"var beer = '(.*?)';", self.html)
+ if url:
+ url = url.group(1)
+ url = urllib.unquote(url.replace("http://http:/", "").replace("vvvvvvvvv", "").replace("lllllllll", "").replace("teletubbies", ""))
+ self.logDebug("URL: %s" % url)
+ return url
+ else:
+ self.fail("absolute filepath could not be found. offline? ")
+
+ def get_file_name(self):
+ if self.html is None:
+ self.download_html()
+
+ return re.search("<title>\s*(.*?)\s*</title>", self.html).group(1)
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if self.html is None:
+ self.download_html()
+
+ if re.search(r"HTTP Status 404", self.html) is not None:
+ return False
+ else:
+ return True
+
+
+
diff --git a/module/plugins/hoster/ShragleCom.py b/module/plugins/hoster/ShragleCom.py
index 8fe05a2b9..99f9f2366 100644
--- a/module/plugins/hoster/ShragleCom.py
+++ b/module/plugins/hoster/ShragleCom.py
@@ -32,14 +32,14 @@ def parseFileInfo(self, url):
def getInfo(urls):
for url in urls:
- file_info = parseFileInfo(plugin, url)
+ file_info = parseFileInfo(ShragleCom, url)
yield file_info
class ShragleCom(Hoster):
__name__ = "ShragleCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www.)?(cloudnator|shragle).com/files/(?P<ID>.*?)/"
- __version__ = "0.20"
+ __version__ = "0.21"
__description__ = """Cloudnator.com (Shragle.com) Download PLugin"""
__author_name__ = ("RaNaN", "zoidberg")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz")
@@ -103,4 +103,4 @@ class ShragleCom(Hoster):
self.wait()
self.retry()
- \ No newline at end of file
+
diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py
new file mode 100644
index 000000000..32e7baf13
--- /dev/null
+++ b/module/plugins/hoster/SpeedLoadOrg.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class SpeedLoadOrg(XFileSharingPro):
+ __name__ = "SpeedLoadOrg"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?speedload\.org/(?P<ID>\w+)"
+ __version__ = "1.01"
+ __description__ = """Speedload.org hoster plugin"""
+ __author_name__ = ("stickell")
+ __author_mail__ = ("l.stickell@yahoo.it")
+
+ FILE_NAME_PATTERN = r'Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>'
+ FILE_SIZE_PATTERN = r'Size:</b></td><td>[\w. ]+<small>\((?P<S>\d+) bytes\)</small>'
+
+ HOSTER_NAME = "speedload.org"
+
+ def handlePremium(self):
+ self.download(self.pyfile.url, post = self.getPostParameters())
+
+getInfo = create_getInfo(SpeedLoadOrg)
diff --git a/module/plugins/hoster/StahnuTo.py b/module/plugins/hoster/StahnuTo.py
deleted file mode 100644
index 354a99b1a..000000000
--- a/module/plugins/hoster/StahnuTo.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
-"""
-
-import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
-from module.network.RequestFactory import getURL
-
-def getInfo(urls):
- result = []
-
- for url in urls:
- file_info = parseFileInfo(StahnuTo, url, getURL("http://stahnu.to/?file=" + re.search(StahnuTo.__pattern__, url).group(3), decode=True))
- result.append(file_info)
-
- yield result
-
-class StahnuTo(SimpleHoster):
- __name__ = "StahnuTo"
- __type__ = "hoster"
- __pattern__ = r"http://(?:\w*\.)?stahnu.to/(?:files/get/|.*\?file=)(?P<ID>[^/]+).*"
- __version__ = "0.14"
- __description__ = """stahnu.to"""
- __author_name__ = ("zoidberg")
-
- FILE_NAME_PATTERN = r"<td colspan='2'>N&aacute;zev souboru<br /><span>(?P<N>[^<]+)</span>"
- FILE_SIZE_PATTERN = r'<td>Velikost souboru<br /><span>(?P<S>[^<]+)\s*(?P<U>[kKMG])i?[Bb]</span></td>'
- FILE_OFFLINE_PATTERN = r'<!-- Obsah - start -->\s*<!-- Obsah - end -->'
-
- def setup(self):
- self.multiDL = True
-
- def process(self, pyfile):
- if not self.account:
- self.fail("Please enter your stahnu.to account")
-
- found = re.search(self.__pattern__, pyfile.url)
- file_id = found.group(1)
-
- self.html = self.load("http://www.stahnu.to/getfile.php?file=%s" % file_id, decode=True)
- self.getFileInfo()
-
- if "K sta&#382;en&iacute; souboru se mus&iacute;te <strong>zdarma</strong> p&#345;ihl&aacute;sit!" in self.html:
- self.account.relogin(self.user)
- self.retry()
-
- self.download("http://www.stahnu.to/files/gen/" + file_id, post={
- "downloadbutton": u"STÁHNOUT"
- })
diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py
index b3b01c92b..b429d5510 100644
--- a/module/plugins/hoster/TurbobitNet.py
+++ b/module/plugins/hoster/TurbobitNet.py
@@ -24,6 +24,7 @@ import random
from urllib import quote
from binascii import hexlify, unhexlify
from Crypto.Cipher import ARC4
+import time
from module.network.RequestFactory import getURL
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp
@@ -35,7 +36,7 @@ class TurbobitNet(SimpleHoster):
__name__ = "TurbobitNet"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P<ID>\w+).*"
- __version__ = "0.07"
+ __version__ = "0.08"
__description__ = """Turbobit.net plugin"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -150,7 +151,7 @@ class TurbobitNet(SimpleHoster):
cipher = ARC4.new(hexlify('E\x15\xa1\x9e\xa3M\xa0\xc6\xa0\x84\xb6H\x83\xa8o\xa0'))
return unhexlify(cipher.encrypt(unhexlify(data)))
- def getLocalTimeString():
+ def getLocalTimeString(self):
lt = time.localtime()
tz = time.altzone if lt.tm_isdst else time.timezone
return "%s GMT%+03d%02d" % (time.strftime("%a %b %d %Y %H:%M:%S", lt), -tz // 3600, tz % 3600)
@@ -166,4 +167,4 @@ class TurbobitNet(SimpleHoster):
self.logDebug(self.url)
self.download(self.url)
-getInfo = create_getInfo(TurbobitNet) \ No newline at end of file
+getInfo = create_getInfo(TurbobitNet)
diff --git a/module/plugins/hoster/TusfilesNet.py b/module/plugins/hoster/TusfilesNet.py
new file mode 100644
index 000000000..517df8561
--- /dev/null
+++ b/module/plugins/hoster/TusfilesNet.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class TusfilesNet(XFileSharingPro):
+ __name__ = "TusfilesNet"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?tusfiles\.net/\w{12}"
+ __version__ = "0.01"
+ __description__ = """Tusfiles.net hoster plugin"""
+ __author_name__ = ("stickell")
+ __author_mail__ = ("l.stickell@yahoo.it")
+
+ FILE_INFO_PATTERN = r'<li>(?P<N>[^<]+)</li>\s+<li><b>Size:</b> <small>(?P<S>[\d.]+) (?P<U>\w+)</small></li>'
+ FILE_OFFLINE_PATTERN = r'The file you were looking for could not be found'
+
+ HOSTER_NAME = "tusfiles.net"
+
+getInfo = create_getInfo(TusfilesNet)
diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py
index cf2f09311..5c38fdaad 100644
--- a/module/plugins/hoster/UlozTo.py
+++ b/module/plugins/hoster/UlozTo.py
@@ -27,12 +27,12 @@ class UlozTo(SimpleHoster):
__name__ = "UlozTo"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(?:live/)?(?P<id>\w+/[^/?]*)"
- __version__ = "0.89"
+ __version__ = "0.92"
__description__ = """uloz.to"""
__author_name__ = ("zoidberg")
FILE_NAME_PATTERN = r'<a href="#download" class="jsShowDownload">(?P<N>[^<]+)</a>'
- FILE_SIZE_PATTERN = r'<span id="fileSize">.*?(?P<S>[0-9.]+\s[kMG]B)</span>'
+ FILE_SIZE_PATTERN = r'<span id="fileSize">.*?(?P<S>[0-9.]+\s[kMG]?B)</span>'
FILE_INFO_PATTERN = r'<p>File <strong>(?P<N>[^<]+)</strong> is password protected</p>'
FILE_OFFLINE_PATTERN = r'<title>404 - Page not found</title>|<h1 class="h1">File (has been deleted|was banned)</h1>'
FILE_SIZE_REPLACEMENTS = [('([0-9.]+)\s([kMG])B', convertDecimalPrefix)]
@@ -80,7 +80,6 @@ class UlozTo(SimpleHoster):
# get and decrypt captcha
captcha_id_field = captcha_text_field = None
- captcha_id = captcha_text = None
for key in inputs.keys():
found = re.match("captcha.*(id|text|value)", key)
@@ -112,10 +111,10 @@ class UlozTo(SimpleHoster):
inputs.update({captcha_id_field: captcha_id, captcha_text_field: captcha_text})
- self.download("http://www.ulozto.net" + action, post=inputs, cookies=True)
+ self.download("http://www.ulozto.net" + action, post=inputs, cookies=True, disposition=True)
def handlePremium(self):
- self.download(self.pyfile.url + "?do=directDownload")
+ self.download(self.pyfile.url + "?do=directDownload", disposition=True)
#parsed_url = self.findDownloadURL(premium=True)
#self.download(parsed_url, post={"download": "Download"})
@@ -154,4 +153,4 @@ class UlozTo(SimpleHoster):
elif check == "not_found":
self.fail("Server error - file not downloadable")
-getInfo = create_getInfo(UlozTo) \ No newline at end of file
+getInfo = create_getInfo(UlozTo)
diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py
index 8d950f0a6..c607e7a5b 100644
--- a/module/plugins/hoster/UloziskoSk.py
+++ b/module/plugins/hoster/UloziskoSk.py
@@ -17,13 +17,13 @@
"""
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError
class UloziskoSk(SimpleHoster):
__name__ = "UloziskoSk"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)?ulozisko.sk/.*"
- __version__ = "0.22"
+ __version__ = "0.23"
__description__ = """Ulozisko.sk"""
__author_name__ = ("zoidberg")
@@ -72,4 +72,4 @@ class UloziskoSk(SimpleHoster):
"but": "++++STIAHNI+S%DABOR++++"
})
-getInfo = create_getInfo(UloziskoSk) \ No newline at end of file
+getInfo = create_getInfo(UloziskoSk)
diff --git a/module/plugins/hoster/UploadboxCom.py b/module/plugins/hoster/UploadboxCom.py
deleted file mode 100644
index ce80b37dc..000000000
--- a/module/plugins/hoster/UploadboxCom.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
-"""
-
-import re
-from module.plugins.internal.DeadHoster import DeadHoster as SimpleHoster
-
-"""
-from module.network.RequestFactory import getURL
-
-def getInfo(urls):
- for url in urls:
- file_id = re.search(UploadboxCom.__pattern__, url).group(1)
- html = getURL('http://uploadbox.com/files/%s/?ac=lang&lang_new=en' % file_id, decode = False)
- file_info = parseFileInfo(UploadboxCom, url, html)
- yield file_info
-"""
-
-class UploadboxCom(SimpleHoster):
- __name__ = "Uploadbox"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?uploadbox\.com/files/([^/]+).*"
- __version__ = "0.05"
- __description__ = """UploadBox.com plugin - free only"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- FILE_NAME_PATTERN = r'<p><span>File name:</span>\s*(?P<N>[^<]+)</p>'
- FILE_SIZE_PATTERN = r'<span>Size:</span>\s*(?P<S>[0-9.]+) (?P<U>[kKMG])i?B <span>'
- FILE_OFFLINE_PATTERN = r'<strong>File deleted from service</strong>'
- FILE_NAME_REPLACEMENTS = [(r"(.*)", lambda m: unicode(m.group(1), 'koi8_r'))]
-
- FREE_FORM_PATTERN = r'<form action="([^"]+)" method="post" id="free" name="free">(.*?)</form>'
- FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)" value="([^"]+)" />'
- LIMIT_EXCEEDED_PATTERN = r'<strong>The limit of traffic for you is exceeded. Please </strong> <br />wait <strong>(\d+)</strong> minutes'
- DOWNLOAD_URL_PATTERN = r'<iframe id="file_download"[^>]*src="([^"]+)"></iframe>'
-
- def process(self, pyfile):
- self.file_id = re.search(self.__pattern__, pyfile.url).group(1)
- self.html = self.load('http://uploadbox.com/files/%s/?ac=lang&lang_new=en' % self.file_id, decode = False)
- self.getFileInfo()
- self.handleFree()
-
- def handleFree(self):
- # Solve captcha
- url = 'http://uploadbox.com/files/' + self.file_id
-
- for i in range(5):
- self.html = self.load(url, post = {"free": "yes"})
- found = re.search(self.LIMIT_EXCEEDED_PATTERN, self.html)
- if found:
- self.setWait(int(found.group(1))*60, True)
- self.wait()
- else:
- break
- else:
- self.fail("Unable to get free download slot")
-
- for i in range(5):
- try:
- action, form = re.search(self.FREE_FORM_PATTERN, self.html, re.DOTALL).groups()
- inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
- except Exception, e:
- self.logError(e)
- self.fail("Parse error on page 2")
-
- captcha_url = 'http://uploadbox.com/?ac=captcha&code=' + inputs['code']
- inputs['enter'] = self.decryptCaptcha(captcha_url)
- self.html = self.load('http://uploadbox.com/' + action, post = inputs)
- found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
- if found:
- self.correctCaptcha()
- download_url = found.group(1)
- break
- else:
- self.invalidCaptcha()
- else:
- self.fail("Incorrect captcha entered 5 times")
-
- # Download
- self.download(download_url) \ No newline at end of file
diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index 3cb1e71ff..ae70b1471 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -72,14 +72,15 @@ def getInfo(urls):
class UploadedTo(Hoster):
__name__ = "UploadedTo"
__type__ = "hoster"
- __pattern__ = r"http://[\w\.-]*?(uploaded\.(to|net)(/file/|/?\?id=|.*?&id=)|ul\.to/)\w+"
- __version__ = "0.62"
+ __pattern__ = r"http://[\w\.-]*?(uploaded\.(to|net)(/file/|/?\?id=|.*?&id=)|ul\.to/)\w+"
+ __version__ = "0.64"
__description__ = """Uploaded.net Download Hoster"""
- __author_name__ = ("spoob", "mkaay", "zoidberg", "netpok")
- __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz", "netpok@gmail.com")
+ __author_name__ = ("spoob", "mkaay", "zoidberg", "netpok", "stickell")
+ __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz", "netpok@gmail.com", "l.stickell@yahoo.it")
FILE_INFO_PATTERN = r'<a href="file/(?P<ID>\w+)" id="filename">(?P<N>[^<]+)</a> &nbsp;\s*<small[^>]*>(?P<S>[^<]+)</small>'
FILE_OFFLINE_PATTERN = r'<small class="cL">Error: 404</small>'
+ DL_LIMIT_PATTERN = "You have reached the max. number of possible free downloads for this hour"
def setup(self):
self.html = None
@@ -97,8 +98,7 @@ class UploadedTo(Hoster):
self.pyfile.url = "http://uploaded.net/file/%s" % self.fileID
def process(self, pyfile):
- self.req.cj.setCookie("uploaded.net", "lang", "en") # doesn't work anymore
- self.load("http://uploaded.net/language/en")
+ self.load("http://uploaded.net/language/en", just_header=True)
api = getAPIData([pyfile.url])
@@ -163,7 +163,7 @@ class UploadedTo(Hoster):
def handleFree(self):
self.html = self.load(self.pyfile.url, decode=True)
-
+
if 'var free_enabled = false;' in self.html:
self.logError("Free-download capacities exhausted.")
self.retry(24, 300)
@@ -198,7 +198,7 @@ class UploadedTo(Hoster):
self.retry()
elif "limit-parallel" in result:
self.fail("Cannot download in parallel")
- elif "You have reached the max. number of possible free downloads for this hour" in result: # limit-dl
+ elif self.DL_LIMIT_PATTERN in result: # limit-dl
self.setWait(60 * 60, True)
self.wait()
self.retry()
@@ -211,11 +211,13 @@ class UploadedTo(Hoster):
break
else:
self.fail("Unknown error '%s'")
- self.setWait(60 * 60, True)
- self.wait()
- self.retry()
if not downloadURL:
self.fail("No Download url retrieved/all captcha attempts failed")
self.download(downloadURL)
+ check = self.checkDownload({"limit-dl": self.DL_LIMIT_PATTERN})
+ if check == "limit-dl":
+ self.setWait(60 * 60, True)
+ self.wait()
+ self.retry()
diff --git a/module/plugins/hoster/UploadhereCom.py b/module/plugins/hoster/UploadhereCom.py
deleted file mode 100644
index 8deec1397..000000000
--- a/module/plugins/hoster/UploadhereCom.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
-"""
-
-from module.plugins.internal.DeadHoster import DeadHoster as UploadkingCom, create_getInfo
-#from module.plugins.internal.SimpleHoster import create_getInfo
-#from UploadkingCom import UploadkingCom
-
-class UploadhereCom(UploadkingCom):
- __name__ = "UploadhereCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?uploadhere\.com/\w{10}"
- __version__ = "0.12"
- __description__ = """Uploadhere.com plugin - free only"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- # shares code with UploadkingCom
-
-create_getInfo(UploadhereCom) \ No newline at end of file
diff --git a/module/plugins/hoster/UploadkingCom.py b/module/plugins/hoster/UploadkingCom.py
deleted file mode 100644
index be2d6c3bd..000000000
--- a/module/plugins/hoster/UploadkingCom.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
-"""
-
-import re
-from module.plugins.internal.DeadHoster import DeadHoster as SimpleHoster, create_getInfo
-#from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-
-class UploadkingCom(SimpleHoster):
- __name__ = "UploadkingCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?uploadking\.com/\w{10}"
- __version__ = "0.14"
- __description__ = """UploadKing.com plugin - free only"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- FILE_NAME_PATTERN = r'<font style="font-size:\d*px;">File(?:name)?:\s*<(?:b|/font><font[^>]*)>(?P<N>[^<]+)'
- FILE_SIZE_PATTERN = r'<font style="font-size:\d*px;">(?:Files|S)ize:\s*<(?:b|/font><font[^>]*)>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B'
- FILE_OFFLINE_PATTERN = r'<center><font[^>]*>Unfortunately, this file is unavailable</font></center>'
- FILE_URL_PATTERN = r'id="dlbutton"><a href="([^"]+)"'
-
- def handleFree(self):
- found = re.search(self.FILE_URL_PATTERN, self.html)
- if not found: self.fail("Download URL not found")
- url = found.group(1)
- self.logDebug("DOWNLOAD URL: " + url)
- self.download(url)
-
-create_getInfo(UploadkingCom) \ No newline at end of file
diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py
new file mode 100644
index 000000000..60a93c1e5
--- /dev/null
+++ b/module/plugins/hoster/UptoboxCom.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class UptoboxCom(XFileSharingPro):
+ __name__ = "UptoboxCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?uptobox.com/\w{12}"
+ __version__ = "0.06"
+ __description__ = """Uptobox.com hoster plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ FILE_INFO_PATTERN = r'<h2>\s*Download File\s*<span[^>]*>(?P<N>[^>]+)</span></h2>\s*[^\(]*\((?P<S>[^\)]+)\)</h2>'
+ FILE_OFFLINE_PATTERN = r'<center>File Not Found</center>'
+ HOSTER_NAME = "uptobox.com"
+
+ def setup(self):
+ self.resumeDownload = self.multiDL = self.premium
+ self.chunkLimit = 1
+
+getInfo = create_getInfo(UptoboxCom) \ No newline at end of file
diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py
index 06e59c7fa..23048b831 100644
--- a/module/plugins/hoster/VeehdCom.py
+++ b/module/plugins/hoster/VeehdCom.py
@@ -4,77 +4,77 @@ import re
from module.plugins.Hoster import Hoster
class VeehdCom(Hoster):
- __name__ = 'VeehdCom'
- __type__ = 'hoster'
- __pattern__ = r'http://veehd\.com/video/\d+_\S+'
- __config__ = [
- ('filename_spaces', 'bool', "Allow spaces in filename", 'False'),
- ('replacement_char', 'str', "Filename replacement character", '_'),
- ]
- __version__ = '0.1'
- __description__ = """Veehd.com Download Hoster"""
- __author_name__ = ('cat')
- __author_mail__ = ('cat@pyload')
-
- def _debug(self, msg):
- self.log.debug('[%s] %s' % (self.__name__, msg))
-
- def setup(self):
- self.html = None
- self.multiDL = True
- self.req.canContinue = True
+ __name__ = 'VeehdCom'
+ __type__ = 'hoster'
+ __pattern__ = r'http://veehd\.com/video/\d+_\S+'
+ __config__ = [
+ ('filename_spaces', 'bool', "Allow spaces in filename", 'False'),
+ ('replacement_char', 'str', "Filename replacement character", '_'),
+ ]
+ __version__ = '0.2'
+ __description__ = """Veehd.com Download Hoster"""
+ __author_name__ = ('cat')
+ __author_mail__ = ('cat@pyload')
+
+ def _debug(self, msg):
+ self.log.debug('[%s] %s' % (self.__name__, msg))
+
+ def setup(self):
+ self.html = None
+ self.multiDL = True
+ self.req.canContinue = True
- def process(self, pyfile):
- self.download_html()
- if not self.file_exists():
- self.offline()
-
- pyfile.name = self.get_file_name()
- self.download(self.get_file_url())
-
- def download_html(self):
- url = self.pyfile.url
- self._debug("Requesting page: %s" % (repr(url),))
- self.html = self.load(url)
-
- def file_exists(self):
- if self.html is None:
- self.download_html()
-
- if '<title>Veehd</title>' in self.html:
- return False
- return True
-
- def get_file_name(self):
- if self.html is None:
- self.download_html()
-
- match = re.search(r'<title[^>]*>([^<]+) on Veehd</title>', self.html)
- if not match:
- self.fail("video title not found")
- name = match.group(1)
-
- # replace unwanted characters in filename
- if self.getConf('filename_spaces'):
- pattern = '[^0-9A-Za-z\.\ ]+'
- else:
- pattern = '[^0-9A-Za-z\.]+'
-
- name = re.sub('[^0-9A-Za-z\.]+', self.getConf('replacement_char'),
- name)
- return name + '.avi'
+ def process(self, pyfile):
+ self.download_html()
+ if not self.file_exists():
+ self.offline()
+
+ pyfile.name = self.get_file_name()
+ self.download(self.get_file_url())
+
+ def download_html(self):
+ url = self.pyfile.url
+ self._debug("Requesting page: %s" % (repr(url),))
+ self.html = self.load(url)
+
+ def file_exists(self):
+ if self.html is None:
+ self.download_html()
+
+ if '<title>Veehd</title>' in self.html:
+ return False
+ return True
+
+ def get_file_name(self):
+ if self.html is None:
+ self.download_html()
+
+ match = re.search(r'<title[^>]*>([^<]+) on Veehd</title>', self.html)
+ if not match:
+ self.fail("video title not found")
+ name = match.group(1)
+
+ # replace unwanted characters in filename
+ if self.getConf('filename_spaces'):
+ pattern = '[^0-9A-Za-z\.\ ]+'
+ else:
+ pattern = '[^0-9A-Za-z\.]+'
+
+ name = re.sub(pattern, self.getConf('replacement_char'),
+ name)
+ return name + '.avi'
- def get_file_url(self):
- """ returns the absolute downloadable filepath
- """
- if self.html is None:
- self.download_html()
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ if self.html is None:
+ self.download_html()
- match = re.search(r'<embed type="video/divx" '
- r'src="(http://([^/]*\.)?veehd\.com/dl/[^"]+)"',
- self.html)
- if not match:
- self.fail("embedded video url not found")
- file_url = match.group(1)
+ match = re.search(r'<embed type="video/divx" '
+ r'src="(http://([^/]*\.)?veehd\.com/dl/[^"]+)"',
+ self.html)
+ if not match:
+ self.fail("embedded video url not found")
+ file_url = match.group(1)
- return file_url
+ return file_url
diff --git a/module/plugins/hoster/WarserverCz.py b/module/plugins/hoster/WarserverCz.py
index 423170319..b256f8d1b 100644
--- a/module/plugins/hoster/WarserverCz.py
+++ b/module/plugins/hoster/WarserverCz.py
@@ -16,19 +16,55 @@
@author: zoidberg
"""
+#similar to coolshare.cz (down)
+
import re
-from module.plugins.hoster.CoolshareCz import CoolshareCz
-from module.plugins.internal.SimpleHoster import create_getInfo
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.network.HTTPRequest import BadHeader
+from module.utils import html_unescape
-class WarserverCz(CoolshareCz):
+class WarserverCz(SimpleHoster):
__name__ = "WarserverCz"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?warserver.cz/stahnout/(?P<ID>\d+)/.+"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """Warserver.cz"""
__author_name__ = ("zoidberg")
FILE_NAME_PATTERN = r'<h1.*?>(?P<N>[^<]+)</h1>'
+ FILE_SIZE_PATTERN = r'<li>Velikost: <strong>(?P<S>[^<]+)</strong>'
+ FILE_OFFLINE_PATTERN = r'<h1>Soubor nenalezen</h1>'
+
+ PREMIUM_URL_PATTERN = r'href="(http://[^/]+/dwn-premium.php.*?)"'
+ DOMAIN = "http://csd01.coolshare.cz"
+
DOMAIN = "http://s01.warserver.cz"
+
+ def handleFree(self):
+ try:
+ self.download("%s/dwn-free.php?fid=%s" % (self.DOMAIN, self.file_info['ID']))
+ except BadHeader, e:
+ self.logError(e)
+ if e.code == 403:
+ self.longWait(60,60)
+ else: raise
+ self.checkDownloadedFile()
+
+ def handlePremium(self):
+ found = re.search(self.PREMIUM_URL_PATTERN, self.html)
+ if not found: self.parseError("Premium URL")
+ url = html_unescape(found.group(1))
+ self.logDebug("Premium URL: " + url)
+ if not url.startswith("http://"): self.resetAccount()
+ self.download(url)
+ self.checkDownloadedFile()
+
+ def checkDownloadedFile(self):
+ check = self.checkDownload({
+ "offline": ">404 Not Found<"
+ })
+
+ if check == "offline":
+ self.offline()
getInfo = create_getInfo(WarserverCz) \ No newline at end of file
diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py
index b60fda7e4..195e65a93 100644
--- a/module/plugins/hoster/WebshareCz.py
+++ b/module/plugins/hoster/WebshareCz.py
@@ -24,7 +24,7 @@ class WebshareCz(SimpleHoster):
__name__ = "WebshareCz"
__type__ = "hoster"
__pattern__ = r"http://(\w+\.)?webshare.cz/(stahnout/)?(?P<ID>\w{10})-.+"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """WebShare.cz"""
__author_name__ = ("zoidberg")
@@ -33,6 +33,9 @@ class WebshareCz(SimpleHoster):
FILE_OFFLINE_PATTERN = r'<h3>Soubor ".*?" nebyl nalezen.</h3>'
DOWNLOAD_LINK_PATTERN = r'id="download_link" href="(?P<url>.*?)"'
+
+ def setup(self):
+ self.multiDL = True
def handleFree(self):
url_a = re.search(r"(var l.*)", self.html).group(1)
diff --git a/module/plugins/hoster/X7To.py b/module/plugins/hoster/X7To.py
index 2ba534cff..79adf2a3f 100644
--- a/module/plugins/hoster/X7To.py
+++ b/module/plugins/hoster/X7To.py
@@ -13,7 +13,7 @@ class X7To(Hoster):
__name__ = "X7To"
__type__ = "hoster"
__pattern__ = r"http://(?:www.)?x7.to/"
- __version__ = "0.2"
+ __version__ = "0.3"
__description__ = """X7.To File Download Hoster"""
__author_name__ = ("ernieb")
__author_mail__ = ("ernieb")
@@ -54,40 +54,40 @@ class X7To(Hoster):
# find file id
file_id = re.search(r"var dlID = '(.*?)'", self.html)
if not file_id:
- self.fail("Free download id not found")
-
- file_url = "http://x7.to/james/ticket/dl/" + file_id.group(1)
- self.logDebug("download id %s" % file_id.group(1))
-
- self.html = self.load(file_url, ref=False, decode=True)
-
- # deal with errors
- if "limit-dl" in self.html:
- self.logDebug("Limit reached ... waiting")
- self.setWait(900,True)
- self.wait()
- self.retry()
-
- if "limit-parallel" in self.html:
- self.fail("Cannot download in parallel")
-
- # no waiting required, go to download
- waitCheck = re.search(r"wait:(\d*),", self.html)
- if waitCheck:
- waitCheck = int(waitCheck.group(1))
- self.setWait(waitCheck)
- self.wait()
-
- urlCheck = re.search(r"url:'(.*?)'", self.html)
- url = None
- if urlCheck:
- url = urlCheck.group(1)
- self.logDebug("free url found %s" % url)
-
- if url:
- try:
- self.download(url)
- except:
- self.logDebug("downloading url failed: %s" % url)
- else:
- self.fail("Free download url found")
+ self.fail("Free download id not found")
+
+ file_url = "http://x7.to/james/ticket/dl/" + file_id.group(1)
+ self.logDebug("download id %s" % file_id.group(1))
+
+ self.html = self.load(file_url, ref=False, decode=True)
+
+ # deal with errors
+ if "limit-dl" in self.html:
+ self.logDebug("Limit reached ... waiting")
+ self.setWait(900,True)
+ self.wait()
+ self.retry()
+
+ if "limit-parallel" in self.html:
+ self.fail("Cannot download in parallel")
+
+ # no waiting required, go to download
+ waitCheck = re.search(r"wait:(\d*),", self.html)
+ if waitCheck:
+ waitCheck = int(waitCheck.group(1))
+ self.setWait(waitCheck)
+ self.wait()
+
+ urlCheck = re.search(r"url:'(.*?)'", self.html)
+ url = None
+ if urlCheck:
+ url = urlCheck.group(1)
+ self.logDebug("free url found %s" % url)
+
+ if url:
+ try:
+ self.download(url)
+ except:
+ self.logDebug("downloading url failed: %s" % url)
+ else:
+ self.fail("Free download url found")
diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py
index 8e213e9bf..1120a2a8b 100644
--- a/module/plugins/hoster/XFileSharingPro.py
+++ b/module/plugins/hoster/XFileSharingPro.py
@@ -3,7 +3,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
- or (at your option) any later version.
+ 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
@@ -23,6 +23,7 @@ from urlparse import urlparse
from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError
from module.plugins.ReCaptcha import ReCaptcha
+from module.plugins.internal.CaptchaService import SolveMedia, AdsCaptcha
from module.utils import html_unescape
class XFileSharingPro(SimpleHoster):
@@ -34,7 +35,7 @@ class XFileSharingPro(SimpleHoster):
__name__ = "XFileSharingPro"
__type__ = "hoster"
__pattern__ = r"^unmatchable$"
- __version__ = "0.11"
+ __version__ = "0.17"
__description__ = """XFileSharingPro common hoster base"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -42,7 +43,7 @@ class XFileSharingPro(SimpleHoster):
FILE_NAME_PATTERN = r'<input type="hidden" name="fname" value="(?P<N>[^"]+)"'
FILE_SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[^<]+)\)</font>'
FILE_INFO_PATTERN = r'<tr><td align=right><b>Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>\s*.*?<small>\((?P<S>[^<]+)\)</small>'
- FILE_OFFLINE_PATTERN = r'<(b|h2)>File Not Found</(b|h2)>'
+ FILE_OFFLINE_PATTERN = r'<(b|h[1-6])>File Not Found</(b|h[1-6])>'
WAIT_PATTERN = r'<span id="countdown_str">.*?>(\d+)</span>'
LONG_WAIT_PATTERN = r'(?P<H>\d+(?=\s*hour))?.*?(?P<M>\d+(?=\s*minute))?.*?(?P<S>\d+(?=\s*second))?'
@@ -51,21 +52,20 @@ class XFileSharingPro(SimpleHoster):
CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)'
RECAPTCHA_URL_PATTERN = r'http://[^"\']+?recaptcha[^"\']+?\?k=([^"\']+)"'
CAPTCHA_DIV_PATTERN = r'<b>Enter code.*?<div.*?>(.*?)</div>'
- ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)</'
-
+ SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"'
+ ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)</'
+
def setup(self):
- self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern']
- self.multiDL = True
- self.chunkLimit = 1
+ if self.__name__ == "XFileSharingPro":
+ self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern']
+ self.multiDL = True
+ else:
+ self.resumeDownload = self.multiDL = self.premium
+
+ self.chunkLimit = 1
def process(self, pyfile):
- if not hasattr(self, "HOSTER_NAME"):
- self.HOSTER_NAME = re.search(self.__pattern__, self.pyfile.url).group(1)
- if not hasattr(self, "DIRECT_LINK_PATTERN"):
- self.DIRECT_LINK_PATTERN = r'(http://(\w+\.%s|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME
-
- self.captcha = self.errmsg = None
- self.passwords = self.getPassword().splitlines()
+ self.prepare()
if not re.match(self.__pattern__, self.pyfile.url):
if self.premium:
@@ -78,58 +78,74 @@ class XFileSharingPro(SimpleHoster):
self.file_info = self.getFileInfo()
except PluginParseError:
self.file_info = None
-
- self.req.http.lastURL = self.pyfile.url
-
- self.req.http.c.setopt(FOLLOWLOCATION, 0)
- self.html = self.load(self.pyfile.url, cookies = True, decode = True)
- self.header = self.req.http.header
- self.req.http.c.setopt(FOLLOWLOCATION, 1)
- self.location = None
- found = re.search("Location\s*:\s*(.*)", self.header, re.I)
- if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)):
- self.location = found.group(1).strip()
-
+ self.location = self.getDirectDownloadLink()
+
if not self.file_info:
pyfile.name = html_unescape(unquote(urlparse(self.location if self.location else pyfile.url).path.split("/")[-1]))
-
- if self.location:
+
+ if self.location:
self.startDownload(self.location)
elif self.premium:
self.handlePremium()
else:
self.handleFree()
+ def prepare(self):
+ """ Initialize important variables """
+ if not hasattr(self, "HOSTER_NAME"):
+ self.HOSTER_NAME = re.search(self.__pattern__, self.pyfile.url).group(1)
+ if not hasattr(self, "DIRECT_LINK_PATTERN"):
+ self.DIRECT_LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME
+
+ self.captcha = self.errmsg = None
+ self.passwords = self.getPassword().splitlines()
+
+ def getDirectDownloadLink(self):
+ """ Get download link for premium users with direct download enabled """
+ self.req.http.lastURL = self.pyfile.url
+
+ self.req.http.c.setopt(FOLLOWLOCATION, 0)
+ self.html = self.load(self.pyfile.url, cookies = True, decode = True)
+ self.header = self.req.http.header
+ self.req.http.c.setopt(FOLLOWLOCATION, 1)
+
+ location = None
+ found = re.search("Location\s*:\s*(.*)", self.header, re.I)
+ if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)):
+ location = found.group(1).strip()
+
+ return location
+
def handleFree(self):
url = self.getDownloadLink()
self.logDebug("Download URL: %s" % url)
self.startDownload(url)
-
+
def getDownloadLink(self):
for i in range(5):
self.logDebug("Getting download link: #%d" % i)
data = self.getPostParameters()
-
+
self.req.http.c.setopt(FOLLOWLOCATION, 0)
self.html = self.load(self.pyfile.url, post = data, ref = True, decode = True)
self.header = self.req.http.header
- self.req.http.c.setopt(FOLLOWLOCATION, 1)
-
+ self.req.http.c.setopt(FOLLOWLOCATION, 1)
+
found = re.search("Location\s*:\s*(.*)", self.header, re.I)
- if found:
+ if found:
break
-
+
found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S)
- if found:
- break
+ if found:
+ break
else:
- if captcha in self.err:
+ if self.errmsg and 'captcha' in self.errmsg:
self.fail("No valid captcha code entered")
else:
self.fail("Download link not found")
-
+
return found.group(1)
def handlePremium(self):
@@ -137,7 +153,7 @@ class XFileSharingPro(SimpleHoster):
found = re.search(self.DIRECT_LINK_PATTERN, self.html)
if not found: self.parseError('DIRECT LINK')
self.startDownload(found.group(1))
-
+
def handleOverriden(self):
#only tested with easybytez.com
self.html = self.load("http://www.%s/" % self.HOSTER_NAME)
@@ -161,8 +177,8 @@ class XFileSharingPro(SimpleHoster):
elif inputs['st'] == 'Can not leech file':
self.retry(max_tries=20, wait_time=180, reason=inputs['st'])
else:
- self.fail(inputs['st'])
-
+ self.fail(inputs['st'])
+
#get easybytez.com link for uploaded file
found = re.search(self.OVR_DOWNLOAD_LINK_PATTERN, self.html)
if not found: self.parseError('DIRECT LINK (OVR)')
@@ -170,6 +186,7 @@ class XFileSharingPro(SimpleHoster):
self.retry()
def startDownload(self, link):
+ link = link.strip()
if self.captcha: self.correctCaptcha()
self.logDebug('DIRECT LINK: %s' % link)
self.download(link)
@@ -184,65 +201,69 @@ class XFileSharingPro(SimpleHoster):
wait_time = sum([int(v) * {"hour": 3600, "minute": 60, "second": 1}[u] for v, u in re.findall('(\d+)\s*(hour|minute|second)?', self.errmsg)])
self.setWait(wait_time, True)
self.wait()
+ elif 'captcha' in self.errmsg:
+ self.invalidCaptcha()
+ elif 'premium' in self.errmsg and 'require' in self.errmsg:
+ self.fail("File can be downloaded by premium users only")
elif 'limit' in self.errmsg:
self.setWait(3600, True)
self.wait()
self.retry(25)
- elif 'captcha' in self.errmsg:
- self.invalidCaptcha()
- elif 'countdown' or 'Expired session' in self.errmsg:
+ elif 'countdown' in self.errmsg or 'Expired session' in self.errmsg:
self.retry(3)
elif 'maintenance' in self.errmsg:
self.tempOffline()
elif 'download files up to' in self.errmsg:
self.fail("File too large for free download")
- elif 'requires premium' in self.errmsg:
- self.fail("File can be downloaded by premium users only")
else:
self.fail(self.errmsg)
-
+
else:
self.errmsg = None
-
+
return self.errmsg
def getPostParameters(self):
for i in range(3):
if not self.errmsg: self.checkErrors()
- action, inputs = self.parseHtmlForm('F1')
- if not inputs:
- action, inputs = self.parseHtmlForm("action=(''|\"\")")
- if not inputs:
+ if hasattr(self,"FORM_PATTERN"):
+ action, inputs = self.parseHtmlForm(self.FORM_PATTERN)
+ else:
+ action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")})
+
+ if not inputs:
+ action, inputs = self.parseHtmlForm('F1')
+ if not inputs:
if self.errmsg:
self.retry()
else:
self.parseError("Form not found")
-
+
self.logDebug(self.HOSTER_NAME, inputs)
-
- if 'op' in inputs and inputs['op'] in ('download2', 'download3'):
+
+ if 'op' in inputs and inputs['op'] in ('download2', 'download3'):
if "password" in inputs:
if self.passwords:
inputs['password'] = self.passwords.pop(0)
else:
self.fail("No or invalid passport")
-
- if not self.premium:
+
+ if not self.premium:
found = re.search(self.WAIT_PATTERN, self.html)
if found:
wait_time = int(found.group(1)) + 1
self.setWait(wait_time, False)
else:
wait_time = 0
-
+
self.captcha = self.handleCaptcha(inputs)
if wait_time: self.wait()
-
+
self.errmsg = None
return inputs
-
+
else:
inputs['referer'] = self.pyfile.url
@@ -257,7 +278,7 @@ class XFileSharingPro(SimpleHoster):
self.errmsg = None
else: self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN'))
-
+
def handleCaptcha(self, inputs):
found = re.search(self.RECAPTCHA_URL_PATTERN, self.html)
if found:
@@ -273,14 +294,21 @@ class XFileSharingPro(SimpleHoster):
inputs['code'] = self.decryptCaptcha(captcha_url)
return 2
else:
- found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.S)
+ found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.S)
if found:
captcha_div = found.group(1)
- self.logDebug(captcha_div)
+ self.logDebug(captcha_div)
numerals = re.findall('<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', html_unescape(captcha_div))
inputs['code'] = "".join([a[1] for a in sorted(numerals, key = lambda num: int(num[0]))])
- self.logDebug("CAPTCHA", inputs['code'], numerals)
- return 3
+ self.logDebug("CAPTCHA", inputs['code'], numerals)
+ return 3
+ else:
+ found = re.search(self.SOLVEMEDIA_PATTERN, self.html)
+ if found:
+ captcha_key = found.group(1)
+ captcha = SolveMedia(self)
+ inputs['adcopy_challenge'], inputs['adcopy_response'] = captcha.challenge(captcha_key)
+ return 4
return 0
-
-getInfo = create_getInfo(XFileSharingPro) \ No newline at end of file
+
+getInfo = create_getInfo(XFileSharingPro)
diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py
new file mode 100644
index 000000000..0779a78e6
--- /dev/null
+++ b/module/plugins/hoster/XHamsterCom.py
@@ -0,0 +1,120 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+from module.plugins.Hoster import Hoster
+from urllib import unquote
+from module.common.json_layer import json_loads
+
+def clean_json(json_expr):
+ json_expr = re.sub('[\n\r]', '', json_expr)
+ json_expr = re.sub(' +', '', json_expr)
+ json_expr = re.sub('\'','"', json_expr)
+
+ return json_expr
+
+class XHamsterCom(Hoster):
+ __name__ = "XHamsterCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?xhamster\.com/movies/.+"
+ __version__ = "0.1"
+ __config__ = [("type", ".mp4;.flv", "Preferred type", ".mp4")]
+ __description__ = """XHamster.com Video Download Hoster"""
+
+ def setup(self):
+ self.html = None
+
+ def process(self, pyfile):
+ self.pyfile = pyfile
+
+ if not self.file_exists():
+ self.offline()
+
+ if self.getConfig("type"):
+ self.desired_fmt = self.getConf("type")
+
+ self.pyfile.name = self.get_file_name() + self.desired_fmt
+ self.download(self.get_file_url())
+
+ def download_html(self):
+ url = self.pyfile.url
+ self.html = self.load(url)
+
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ if self.html is None:
+ self.download_html()
+
+ flashvar_pattern = re.compile('flashvars = ({.*?});', re.DOTALL)
+ json_flashvar=flashvar_pattern.search(self.html)
+
+ if json_flashvar is None:
+ self.fail("Parse error (flashvars)")
+
+ j = clean_json(json_flashvar.group(1))
+ flashvars = json_loads(j)
+
+ if flashvars["srv"]:
+ srv_url = flashvars["srv"] + '/'
+ else:
+ self.fail("Parse error (srv_url)")
+
+ if flashvars["url_mode"]:
+ url_mode = flashvars["url_mode"]
+ else:
+ self.fail("Parse error (url_mode)")
+
+
+ if self.desired_fmt == ".mp4":
+ file_url = re.search(r"<a href=\"" + srv_url + "(.+?)\"", self.html)
+ if file_url is None:
+ self.fail("Parse error (file_url)")
+ file_url=file_url.group(1)
+ long_url = srv_url + file_url
+ self.logDebug(_("long_url: %s") % long_url)
+ else:
+ if flashvars["file"]:
+ file_url = unquote(flashvars["file"])
+ else:
+ self.fail("Parse error (file_url)")
+
+ if url_mode=='3':
+ long_url = file_url
+ self.logDebug(_("long_url: %s") % long_url)
+ else:
+ long_url = srv_url + "key=" + file_url
+ self.logDebug(_("long_url: %s") % long_url)
+
+ return long_url
+
+
+ def get_file_name(self):
+ if self.html is None:
+ self.download_html()
+
+ file_name_pattern = r"<title>(.*?) - xHamster\.com</title>"
+ file_name = re.search(file_name_pattern, self.html)
+ if file_name is None:
+ file_name_pattern = r"<h1 >(.*)</h1>"
+ file_name = re.search(file_name_pattern, self.html)
+ if file_name is None:
+ file_name_pattern = r"http://[www.]+xhamster\.com/movies/.*/(.*?)\.html?"
+ file_name = re.search(file_name_pattern, self.pyfile.url)
+ if file_name is None:
+ file_name_pattern = r"<div id=\"element_str_id\" style=\"display:none;\">(.*)</div>"
+ file_name = re.search(file_name_pattern, self.html)
+ if file_name is None:
+ return "Unknown"
+
+ return file_name.group(1)
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if self.html is None:
+ self.download_html()
+ if re.search(r"(.*Video not found.*)", self.html) is not None:
+ return False
+ else:
+ return True
diff --git a/module/plugins/hoster/XvidstageCom.py b/module/plugins/hoster/XvidstageCom.py
new file mode 100644
index 000000000..14079df43
--- /dev/null
+++ b/module/plugins/hoster/XvidstageCom.py
@@ -0,0 +1,105 @@
+# -*- coding: utf-8 -*-
+
+"""
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+ @author: 4Christopher
+"""
+
+from module.plugins.Hoster import Hoster
+from module.network.RequestFactory import getURL
+import re
+import HTMLParser
+
+def setup(self):
+ self.wantReconnect = False
+ self.resumeDownload = True
+ self.multiDL = True
+
+def getInfo(urls):
+ result = []
+
+ for url in urls:
+ result.append(parseFileInfo(url, getInfoMode = True))
+ yield result
+
+def parseFileInfo(url, getInfoMode = False):
+ html = getURL(url)
+ info = {"name" : url, "size" : 0, "status" : 3}
+ try:
+ info['name'] = re.search(r'(?:Filename|Dateiname):</b></td><td nowrap[^>]*?>(.*?)<', html).group(1)
+ info['size'] = re.search(r'(?:Size|Größe):</b></td><td>.*? <small>\((\d+?) bytes\)', html).group(1)
+ except: ## The file is offline
+ info['status'] = 1
+ else:
+ info['status'] = 2
+
+ if getInfoMode:
+ return info['name'], info['size'], info['status'], url
+ else:
+ return info['name'], info['size'], info['status'], html
+
+class XvidstageCom(Hoster):
+ __name__ = 'XvidstageCom'
+ __version__ = '0.3'
+ __pattern__ = r'http://(?:www.)?xvidstage.com/(?P<id>[0-9A-Za-z]+)'
+ __type__ = 'hoster'
+ __description__ = """A Plugin that allows you to download files from http://xvidstage.com"""
+ __author_name__ = ('4Christopher')
+ __author_mail__ = ('4Christopher@gmx.de')
+
+
+ def process(self, pyfile):
+ pyfile.name, pyfile.size, pyfile.status, self.html = parseFileInfo(pyfile.url)
+ self.logDebug('Name: %s' % pyfile.name)
+ if pyfile.status == 1: ## offline
+ self.fail()
+ self.id = re.search(self.__pattern__, pyfile.url).group('id')
+
+ wait_sec = int(re.search(r'countdown_str">.+?>(\d+?)<', self.html).group(1))
+ self.setWait(wait_sec, reconnect=False)
+ self.logDebug('Waiting %d seconds before submitting the captcha' % wait_sec)
+ self.wait()
+
+ rand = re.search(r'<input type="hidden" name="rand" value="(.*?)">', self.html).group(1)
+ self.logDebug('rand: %s, id: %s' % (rand, self.id))
+ self.html = self.req.load(pyfile.url, post={'op': 'download2', 'id' : self.id, 'rand' : rand, 'code': self.get_captcha()})
+ file_url = re.search(r'<a href="(?P<url>.*?)">(?P=url)</a>', self.html).group('url')
+ try:
+ hours_file_available = int(re.search(r'This direct link will be available for your IP next (?P<hours>\d+?) hours', self.html).group('hours'))
+ self.logDebug('You have %d hours to download this file with your current IP address.' % hours_file_available)
+ except:
+ self.logDebug('Failed')
+ self.logDebug('Download file: %s' % file_url)
+ self.download(file_url)
+ check = self.checkDownload({'empty': re.compile(r'^$')})
+
+ if check == 'empty':
+ self.logInfo('Downloaded File was empty')
+ # self.retry()
+
+ def get_captcha(self):
+ ## <span style='position:absolute;padding-left:7px;padding-top:6px;'>&#49; …
+ cap_chars = {}
+ for pad_left, char in re.findall(r"position:absolute;padding-left:(\d+?)px;.*?;'>(.*?)<", self.html):
+ cap_chars[int(pad_left)] = char
+
+ h = HTMLParser.HTMLParser()
+ ## Sorting after padding-left
+ captcha = ''
+ for pad_left in sorted(cap_chars):
+ captcha += h.unescape(cap_chars[pad_left])
+
+ self.logDebug('The captcha is: %s' % captcha)
+ return captcha
diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py
index 5926cc227..901225944 100644
--- a/module/plugins/hoster/YibaishiwuCom.py
+++ b/module/plugins/hoster/YibaishiwuCom.py
@@ -24,7 +24,7 @@ class YibaishiwuCom(SimpleHoster):
__name__ = "YibaishiwuCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?(?:u\.)?115.com/file/(?P<ID>\w+)"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """115.com"""
__author_name__ = ("zoidberg")
@@ -45,10 +45,10 @@ class YibaishiwuCom(SimpleHoster):
try:
url = mirror['url'].replace('\\','')
self.logDebug("Trying URL: " + url)
- header = self.download(url)
+ self.download(url)
break
except:
continue
else: self.fail('No working link found')
-getInfo = create_getInfo(YibaishiwuCom) \ No newline at end of file
+getInfo = create_getInfo(YibaishiwuCom)
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py
index 3ba40e937..a9fed5638 100644
--- a/module/plugins/hoster/YoutubeCom.py
+++ b/module/plugins/hoster/YoutubeCom.py
@@ -10,32 +10,45 @@ from module.plugins.Hoster import Hoster
class YoutubeCom(Hoster):
__name__ = "YoutubeCom"
__type__ = "hoster"
- __pattern__ = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*"
- __version__ = "0.25"
- __config__ = [("quality", "sd;hd;fullhd", "Quality Setting", "hd"),
- ("fmt", "int", "FMT Number 0-45", 0),
+ __pattern__ = r"(http|https)://(www\.)?(de\.)?\youtube\.com/watch\?v=.*"
+ __version__ = "0.29"
+ __config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting", "hd"),
+ ("fmt", "int", "FMT/ITAG Number (5-102, 0 for auto)", 0),
(".mp4", "bool", "Allow .mp4", True),
(".flv", "bool", "Allow .flv", True),
(".webm", "bool", "Allow .webm", False),
- (".3gp", "bool", "Allow .3gp", False)]
+ (".3gp", "bool", "Allow .3gp", False),
+ ("3d", "bool", "Prefer 3D", False)]
__description__ = """Youtube.com Video Download Hoster"""
- __author_name__ = ("spoob")
- __author_mail__ = ("spoob@pyload.org")
-
- # name, width, height, quality ranking
- formats = {17: (".3gp", 176, 144, 0),
- 5: (".flv", 400, 240, 1),
- 18: (".mp4", 480, 360, 2),
- 43: (".webm", 640, 360, 3),
- 34: (".flv", 640, 360, 4),
- 44: (".webm", 854, 480, 5),
- 35: (".flv", 854, 480, 6),
- 45: (".webm", 1280, 720, 7),
- 22: (".mp4", 1280, 720, 8),
- 37: (".mp4", 1920, 1080, 9),
- 38: (".mp4", 4096, 3072, 10),
+ __author_name__ = ("spoob", "zoidberg")
+ __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz")
+
+ # name, width, height, quality ranking, 3D
+ formats = {5: (".flv", 400, 240, 1, False),
+ 6: (".flv", 640, 400, 4, False),
+ 17: (".3gp", 176, 144, 0, False),
+ 18: (".mp4", 480, 360, 2, False),
+ 22: (".mp4", 1280, 720, 8, False),
+ 43: (".webm", 640, 360, 3, False),
+ 34: (".flv", 640, 360, 4, False),
+ 35: (".flv", 854, 480, 6, False),
+ 36: (".3gp", 400, 240, 1, False),
+ 37: (".mp4", 1920, 1080, 9, False),
+ 38: (".mp4", 4096, 3072, 10, False),
+ 44: (".webm", 854, 480, 5, False),
+ 45: (".webm", 1280, 720, 7, False),
+ 46: (".webm", 1920, 1080, 9, False),
+ 82: (".mp4", 640, 360, 3, True),
+ 83: (".mp4", 400, 240, 1, True),
+ 84: (".mp4", 1280, 720, 8, True),
+ 85: (".mp4", 1920, 1080, 9, True),
+ 100: (".webm", 640, 360, 3, True),
+ 101: (".webm", 640, 360, 4, True),
+ 102: (".webm", 1280, 720, 8, True)
}
+ def setup(self):
+ self.resumeDownload = self.multiDL = True
def process(self, pyfile):
html = self.load(pyfile.url, decode=True)
@@ -45,56 +58,61 @@ class YoutubeCom(Hoster):
if "We have been receiving a large volume of requests from your network." in html:
self.tempOffline()
-
- #videoId = pyfile.url.split("v=")[1].split("&")[0]
- #videoHash = re.search(r'&amp;t=(.+?)&', html).group(1)
-
- file_name_pattern = '<meta name="title" content="(.+?)">'
-
- quality = self.getConf("quality")
- desired_fmt = 18
-
- if quality == "sd":
- desired_fmt = 18
- elif quality == "hd":
- desired_fmt = 22
- elif quality == "fullhd":
- desired_fmt = 37
-
- if self.getConfig("fmt"):
- desired_fmt = self.getConf("fmt")
-
- flashvars = re.search(r'flashvars=\\"(.*?)\\"', html)
- flashvars = unquote(flashvars.group(1))
-
- fmts = re.findall(r'url=(.*?)%3B.*?itag=(\d+)', flashvars)
- fmt_dict = {}
- for url, fmt in fmts:
- fmt = int(fmt)
- fmt_dict[fmt] = unquote(url)
-
- self.logDebug("Found links: %s" % fmt_dict)
- for fmt in fmt_dict.keys():
- if fmt not in self.formats:
- self.logDebug("FMT not supported: %s" % fmt)
- del fmt_dict[fmt]
-
- allowed = lambda x: self.getConfig(self.formats[x][0])
- sel = lambda x: self.formats[x][3] #select quality index
- comp = lambda x, y: abs(sel(x) - sel(y))
-
- #return fmt nearest to quali index
- fmt = reduce(lambda x, y: x if comp(x, desired_fmt) <= comp(y, desired_fmt) and
- sel(x) > sel(y) and
- allowed(x) else y, fmt_dict.keys())
+ #get config
+ use3d = self.getConf("3d")
+ if use3d:
+ quality = {"sd":82,"hd":84,"fullhd":85,"240p":83,"360p":82,"480p":82,"720p":84,"1080p":85,"3072p":85}
+ else:
+ quality = {"sd":18,"hd":22,"fullhd":37,"240p":5,"360p":18,"480p":35,"720p":22,"1080p":37,"3072p":38}
+ desired_fmt = self.getConf("fmt")
+ if desired_fmt and desired_fmt not in self.formats:
+ self.logWarning("FMT %d unknown - using default." % desired_fmt)
+ desired_fmt = 0
+ if not desired_fmt:
+ desired_fmt = quality.get(self.getConf("quality"), 18)
+
+ #parse available streams
+ streams = re.search(r'"url_encoded_fmt_stream_map": "(.*?)",', html).group(1)
+ streams = [x.split('\u0026') for x in streams.split(',')]
+ streams = [dict((y.split('=',1)) for y in x) for x in streams]
+ streams = [(int(x['itag']), "%s&signature=%s" % (unquote(x['url']), x['sig'])) for x in streams]
+ #self.logDebug("Found links: %s" % streams)
+ self.logDebug("AVAILABLE STREAMS: %s" % [x[0] for x in streams])
+
+ #build dictionary of supported itags (3D/2D)
+ allowed = lambda x: self.getConfig(self.formats[x][0])
+ streams = [x for x in streams if x[0] in self.formats and allowed(x[0])]
+ if not streams:
+ self.fail("No available stream meets your preferences")
+ fmt_dict = dict([x for x in streams if self.formats[x[0]][4] == use3d] or streams)
+
+ self.logDebug("DESIRED STREAM: ITAG:%d (%s) %sfound, %sallowed" %
+ (desired_fmt,
+ "%s %dx%d Q:%d 3D:%s" % self.formats[desired_fmt],
+ "" if desired_fmt in fmt_dict else "NOT ",
+ "" if allowed(desired_fmt) else "NOT ")
+ )
+
+ #return fmt nearest to quality index
+ if desired_fmt in fmt_dict and allowed(desired_fmt):
+ fmt = desired_fmt
+ else:
+ sel = lambda x: self.formats[x][3] #select quality index
+ comp = lambda x, y: abs(sel(x) - sel(y))
+
+ self.logDebug("Choosing nearest fmt: %s" % [(x, allowed(x), comp(x, desired_fmt)) for x in fmt_dict.keys()])
+ fmt = reduce(lambda x, y: x if comp(x, desired_fmt) <= comp(y, desired_fmt) and
+ sel(x) > sel(y) else y, fmt_dict.keys())
- self.logDebug("Choose fmt: %s" % fmt)
+ self.logDebug("Chosen fmt: %s" % fmt)
+ url = fmt_dict[fmt]
+ self.logDebug("URL: %s" % url)
- file_suffix = ".flv"
- if fmt in self.formats:
- file_suffix = self.formats[fmt][0]
+ #set file name
+ file_suffix = self.formats[fmt][0] if fmt in self.formats else ".flv"
+ file_name_pattern = '<meta name="title" content="(.+?)">'
name = re.search(file_name_pattern, html).group(1).replace("/", "") + file_suffix
pyfile.name = html_unescape(name)
-
- self.download(fmt_dict[fmt])
+
+ self.download(url) \ No newline at end of file
diff --git a/module/plugins/hoster/ZShareNet.py b/module/plugins/hoster/ZShareNet.py
deleted file mode 100644
index 6ef456d97..000000000
--- a/module/plugins/hoster/ZShareNet.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-import random
-
-from module.utils import parseFileSize
-from module.plugins.Hoster import Hoster
-
-class ZShareNet(Hoster):
- __name__ = "ZShareNet"
- __type__ = "hoster"
- __pattern__ = r"http://[\w\.]*?zshare\.net/(download|video|image|audio|flash)/.*"
- __version__ = "0.2"
- __description__ = """ZShareNet Download Hoster"""
- __author_name__ = ("espes","Cptn Sandwich")
-
- def setup(self):
- self.multiDL = False
- self.html = None
-
- def process(self, pyfile):
- self.pyfile = pyfile
-
- self.pyfile.url = re.sub("(video|image|audio|flash)","download",self.pyfile.url)
-
- self.html = self.load(pyfile.url)
- if "File Not Found" in self.html:
- self.offline()
-
- filenameMatch = re.search("File Name:.*?<font color=\"#666666\".*?>(.*?)</font>", self.html, re.DOTALL)
- filesizeMatch = re.search("File Size:.*?<font color=\"#666666\".*?>([^<]+)</font>", self.html, re.DOTALL)
- if not filenameMatch or not filesizeMatch:
- self.offline()
- filename = filenameMatch.group(1)
- filesize = filesizeMatch.group(1)
- if filename.strip() == "":
- self.offline()
-
- pyfile.name = filename
-
- pyfile.size = parseFileSize(filesize)
-
- if '<input name="download"' not in self.html:
- self.fail("No download form")
-
- self.html = self.load(pyfile.url, post={
- "download": 1,
- "imageField.x": random.randrange(160),
- "imageField.y": random.randrange(60)})
-
- dllinkMatch = re.search("var link_enc\\=new Array\\(\\'(.*?)\\'\\)", self.html)
- if dllinkMatch:
- dllink = re.sub("\\'\\,\\'", "", dllinkMatch.group(1))
- else:
- self.fail("Plugin defect")
-
- self.setWait(51)
- self.wait()
-
- self.download(dllink)
- check = self.checkDownload({
- "unav": "/images/download.gif",
- "404": "404 - Not Found"
- })
- #print check
- if check == "unav":
- self.fail("Plugin defect")
- elif check == "404":
- self.offline()