summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/accounts/FastshareCz.py6
-rw-r--r--module/plugins/accounts/UploadheroCom.py8
-rw-r--r--module/plugins/crypter/FilestubeCom.py31
-rw-r--r--module/plugins/hoster/FastshareCz.py6
-rw-r--r--module/plugins/hoster/NetloadIn.py9
-rw-r--r--module/plugins/hoster/RyushareCom.py8
-rw-r--r--module/plugins/hoster/UploadheroCom.py12
-rw-r--r--module/plugins/hoster/XFileSharingPro.py10
-rw-r--r--module/plugins/internal/SimpleCrypter.py15
9 files changed, 75 insertions, 30 deletions
diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py
index 69bbb0827..c047ff766 100644
--- a/module/plugins/accounts/FastshareCz.py
+++ b/module/plugins/accounts/FastshareCz.py
@@ -24,16 +24,18 @@ from module.utils import parseFileSize
class FastshareCz(Account):
__name__ = "FastshareCz"
- __version__ = "0.02"
+ __version__ = "0.03"
__type__ = "account"
__description__ = """fastshare.cz account plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+ CREDIT_PATTERN = r'(?:Kredit|Credit)\s*</td>\s*<td[^>]*>([\d. \w]+)&nbsp;'
+
def loadAccountInfo(self, user, req):
html = req.load("http://www.fastshare.cz/user", decode=True)
- found = re.search(r'(?:Kredit|Credit)\s*: </td><td>(.+?)&nbsp;', html)
+ found = re.search(self.CREDIT_PATTERN, html)
if found:
trafficleft = parseFileSize(found.group(1)) / 1024
premium = True if trafficleft else False
diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py
index 0e64a3ff5..12463f285 100644
--- a/module/plugins/accounts/UploadheroCom.py
+++ b/module/plugins/accounts/UploadheroCom.py
@@ -10,9 +10,9 @@ from module.plugins.Account import Account
class UploadheroCom(Account):
__name__ = "UploadheroCom"
- __version__ = "0.1"
+ __version__ = "0.2"
__type__ = "account"
- __description__ = """Uploadhero.com account plugin"""
+ __description__ = """Uploadhero.co account plugin"""
__author_name__ = ("mcmyst")
__author_mail__ = ("mcmyst@hotmail.fr")
@@ -20,7 +20,7 @@ class UploadheroCom(Account):
premium_pattern = re.compile('Il vous reste <span class="bleu">([0-9]+)</span> jours premium.')
data = self.getAccountData(user)
- page = req.load("http://uploadhero.com/my-account")
+ page = req.load("http://uploadhero.co/my-account")
if premium_pattern.search(page):
end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(page).group(1)))
@@ -32,7 +32,7 @@ class UploadheroCom(Account):
return account_info
def login(self, user, data, req):
- page = req.load("http://uploadhero.com/lib/connexion.php",
+ page = req.load("http://uploadhero.co/lib/connexion.php",
post={"pseudo_login": user, "password_login": data["password"]})
if "mot de passe invalide" in page:
diff --git a/module/plugins/crypter/FilestubeCom.py b/module/plugins/crypter/FilestubeCom.py
new file mode 100644
index 000000000..1e5712cb5
--- /dev/null
+++ b/module/plugins/crypter/FilestubeCom.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+
+############################################################################
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU Affero General Public License as #
+# published by the Free Software Foundation, either version 3 of the #
+# License, or (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU Affero General Public License for more details. #
+# #
+# You should have received a copy of the GNU Affero General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+############################################################################
+
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
+
+
+class FilestubeCom(SimpleCrypter):
+ __name__ = "FilestubeCom"
+ __type__ = "crypter"
+ __pattern__ = r"http://(?:w{3}.)?filestube\.com/\w+"
+ __version__ = "0.01"
+ __description__ = """Filestube.com Plugin"""
+ __author_name__ = ("stickell")
+ __author_mail__ = ("l.stickell@yahoo.it")
+
+ LINK_PATTERN = r"link_download'\]\); renderGo\('(http://[^)]+)'\);"
+ TITLE_PATTERN = r"<title>(?P<title>.+) download"
diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py
index b44d55a2d..844b8cd59 100644
--- a/module/plugins/hoster/FastshareCz.py
+++ b/module/plugins/hoster/FastshareCz.py
@@ -27,7 +27,7 @@ class FastshareCz(SimpleHoster):
__name__ = "FastshareCz"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?fastshare.cz/\d+/.+"
- __version__ = "0.15"
+ __version__ = "0.17"
__description__ = """FastShare.cz"""
__author_name__ = ("zoidberg", "stickell")
@@ -35,7 +35,7 @@ class FastshareCz(SimpleHoster):
FILE_OFFLINE_PATTERN = ur'<td align=center>Tento soubor byl smazán'
FILE_URL_REPLACEMENTS = [('#.*', '')]
- FREE_URL_PATTERN = ur'<form method=post action=(/free/.*?)><b>Stáhnout FREE.*?<img src="([^"]*)">'
+ FREE_URL_PATTERN = r'action=(/free/.*?)>\s*<img src="([^"]*)"><br'
PREMIUM_URL_PATTERN = r'(http://data\d+\.fastshare\.cz/download\.php\?id=\d+\&[^\s\"\'<>]+)'
NOT_ENOUGH_CREDIC_PATTERN = "Nem.te dostate.n. kredit pro sta.en. tohoto souboru"
@@ -90,7 +90,7 @@ class FastshareCz(SimpleHoster):
url = found.group(1)
self.logDebug("PREMIUM URL: %s" % url)
- self.download(url)
+ self.download(url, disposition=True)
check = self.checkDownload({"credit": re.compile(self.NOT_ENOUGH_CREDIC_PATTERN)})
if check == "credit":
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index d150443f0..6a9ecaccc 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"https?://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)"
- __version__ = "0.44"
+ __version__ = "0.45"
__description__ = """Netload.in Download Hoster"""
__author_name__ = ("spoob", "RaNaN", "Gregy")
__author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "gregy@gregy.cz")
@@ -79,7 +79,12 @@ class NetloadIn(Hoster):
if self.premium:
self.logDebug("Netload: Use Premium Account")
- return True
+ settings = self.load("http://www.netload.in/index.php?id=2&lang=en")
+ if '<option value="2" selected="selected">Direkter Download' in settings:
+ self.logDebug("Using direct download")
+ return True
+ else:
+ self.logDebug("Direct downloads not enabled. Parsing html for a download URL")
if self.download_html():
return True
diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py
index b53614e78..4733015ec 100644
--- a/module/plugins/hoster/RyushareCom.py
+++ b/module/plugins/hoster/RyushareCom.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Test links (random.bin):
-# http://ryushare.com/v3u21arv593q/random.bin
+# http://ryushare.com/denawy6x6tzz/random.bin
import re
@@ -13,7 +13,7 @@ class RyushareCom(XFileSharingPro):
__name__ = "RyushareCom"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*?ryushare.com/\w{11,}"
- __version__ = "0.12"
+ __version__ = "0.13"
__description__ = """ryushare.com hoster plugin"""
__author_name__ = ("zoidberg", "stickell","quareevo")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it","quareevo@arcor.de")
@@ -21,7 +21,7 @@ class RyushareCom(XFileSharingPro):
HOSTER_NAME = "ryushare.com"
WAIT_PATTERN = r'You have to wait ((?P<hour>\d+) hour[s]?, )?((?P<min>\d+) minute[s], )?(?P<sec>\d+) second[s]'
- DIRECT_LINK_PATTERN = r'<a href="([^"]+)">Click here to download</a>'
+ DIRECT_LINK_PATTERN = r'(http://([^/]*?ryushare.com|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)'
SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"'
def setup(self):
@@ -83,7 +83,7 @@ class RyushareCom(XFileSharingPro):
self.fail("You have entered 5 invalid captcha codes")
if 'Click here to download' in self.html:
- m = re.search(self.DIRECT_LINK_PATTERN, self.html)
+ m = re.search(r'<a href="([^"]+)">Click here to download</a>', self.html)
return m.group(1)
getInfo = create_getInfo(RyushareCom)
diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py
index 79bca748e..7b047e028 100644
--- a/module/plugins/hoster/UploadheroCom.py
+++ b/module/plugins/hoster/UploadheroCom.py
@@ -27,12 +27,12 @@ class UploadheroCom(SimpleHoster):
__name__ = "UploadheroCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?uploadhero\.com?/dl/\w+"
- __version__ = "0.14"
- __description__ = """UploadHero.com plugin"""
+ __version__ = "0.15"
+ __description__ = """UploadHero.co plugin"""
__author_name__ = ("mcmyst", "zoidberg")
__author_mail__ = ("mcmyst@hotmail.fr", "zoidberg@mujmail.cz")
- SH_COOKIES = [("http://uploadhero.com", "lang", "en")]
+ SH_COOKIES = [("http://uploadhero.co", "lang", "en")]
FILE_NAME_PATTERN = r'<div class="nom_de_fichier">(?P<N>.*?)</div>'
FILE_SIZE_PATTERN = r'Taille du fichier : </span><strong>(?P<S>.*?)</strong>'
FILE_OFFLINE_PATTERN = r'<p class="titre_dl_2">|<div class="raison"><strong>Le lien du fichier ci-dessus n\'existe plus.'
@@ -43,7 +43,7 @@ class UploadheroCom(SimpleHoster):
IP_WAIT_PATTERN = r'<span id="minutes">(\d+)</span>.*\s*<span id="seconds">(\d+)</span>'
CAPTCHA_PATTERN = r'"(/captchadl\.php\?[a-z0-9]+)"'
- FREE_URL_PATTERN = r'var magicomfg = \'<a href="(http://[^<>"]*?)"|"(http://storage\d+\.uploadhero\.com/\?d=[A-Za-z0-9]+/[^<>"/]+)"'
+ FREE_URL_PATTERN = r'var magicomfg = \'<a href="(http://[^<>"]*?)"|"(http://storage\d+\.uploadhero\.co/\?d=[A-Za-z0-9]+/[^<>"/]+)"'
def handleFree(self):
self.checkErrors()
@@ -51,7 +51,7 @@ class UploadheroCom(SimpleHoster):
found = re.search(self.CAPTCHA_PATTERN, self.html)
if not found:
self.parseError("Captcha URL")
- captcha_url = "http://uploadhero.com" + found.group(1)
+ captcha_url = "http://uploadhero.co" + found.group(1)
for i in range(5):
captcha = self.decryptCaptcha(captcha_url)
@@ -78,7 +78,7 @@ class UploadheroCom(SimpleHoster):
def checkErrors(self):
found = re.search(self.IP_BLOCKED_PATTERN, self.html)
if found:
- self.html = self.load("http://uploadhero.com%s" % found.group(1))
+ self.html = self.load("http://uploadhero.co%s" % found.group(1))
found = re.search(self.IP_WAIT_PATTERN, self.html)
wait_time = (int(found.group(1)) * 60 + int(found.group(2))) if found else 300
diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py
index ec093d28d..e37afc243 100644
--- a/module/plugins/hoster/XFileSharingPro.py
+++ b/module/plugins/hoster/XFileSharingPro.py
@@ -35,7 +35,7 @@ class XFileSharingPro(SimpleHoster):
__name__ = "XFileSharingPro"
__type__ = "hoster"
__pattern__ = r"^unmatchable$"
- __version__ = "0.19"
+ __version__ = "0.21"
__description__ = """XFileSharingPro common hoster base"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
@@ -75,10 +75,6 @@ class XFileSharingPro(SimpleHoster):
else:
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]))
-
# self.load will fail because pyfile.url is a direct link to the download if self.location
# is set so it will be executed only if pyfile.url is not a direct link (location not set).
if not self.location:
@@ -87,6 +83,8 @@ class XFileSharingPro(SimpleHoster):
self.file_info = self.getFileInfo()
except PluginParseError:
self.file_info = None
+ pyfile.name = html_unescape(unquote(urlparse(
+ self.location if self.location else pyfile.url).path.split("/")[-1]))
if self.location:
self.startDownload(self.location)
@@ -100,7 +98,7 @@ class XFileSharingPro(SimpleHoster):
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.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()
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
index 546b920e0..f0fe0b764 100644
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -25,7 +25,7 @@ from module.utils import html_unescape
class SimpleCrypter(Crypter):
__name__ = "SimpleCrypter"
- __version__ = "0.05"
+ __version__ = "0.06"
__pattern__ = None
__type__ = "crypter"
__description__ = """Base crypter plugin"""
@@ -40,6 +40,8 @@ class SimpleCrypter(Crypter):
TITLE_PATTERN: (optional) the group defined by 'title' should be the title
example: <title>Files of: (?P<title>[^<]+) folder</title>
+ If it's impossible to extract the links using the LINK_PATTERN only you can override the getLinks method.
+
If the links are disposed on multiple pages you need to define a pattern:
PAGES_PATTERN: the group defined by 'pages' must be the total number of pages
@@ -55,7 +57,7 @@ class SimpleCrypter(Crypter):
package_name, folder_name = self.getPackageNameAndFolder()
- self.package_links = re.findall(self.LINK_PATTERN, self.html)
+ self.package_links = self.getLinks()
if hasattr(self, 'PAGES_PATTERN') and hasattr(self, 'loadPage'):
self.handleMultiPages()
@@ -67,6 +69,13 @@ class SimpleCrypter(Crypter):
else:
self.fail('Could not extract any links')
+ def getLinks(self):
+ """
+ Returns the links extracted from self.html
+ You should override this only if it's impossible to extract links using only the LINK_PATTERN.
+ """
+ return re.findall(self.LINK_PATTERN, self.html)
+
def getPackageNameAndFolder(self):
if hasattr(self, 'TITLE_PATTERN'):
m = re.search(self.TITLE_PATTERN, self.html)
@@ -89,4 +98,4 @@ class SimpleCrypter(Crypter):
for p in range(2, pages + 1):
self.html = self.loadPage(p)
- self.package_links += re.findall(self.LINK_PATTERN, self.html)
+ self.package_links += self.getLinks()