diff options
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/AlldebridCom.py | 37 | ||||
-rw-r--r-- | module/plugins/hoster/DataHu.py | 53 | ||||
-rw-r--r-- | module/plugins/hoster/DebridItaliaCom.py | 29 | ||||
-rw-r--r-- | module/plugins/hoster/EgoFilesCom.py | 36 | ||||
-rw-r--r-- | module/plugins/hoster/FilerNet.py | 103 | ||||
-rw-r--r-- | module/plugins/hoster/OneFichierCom.py | 5 | ||||
-rw-r--r-- | module/plugins/hoster/PutlockerCom.py | 157 | ||||
-rw-r--r-- | module/plugins/hoster/RarefileNet.py | 20 | ||||
-rw-r--r-- | module/plugins/hoster/UploadedTo.py | 53 | ||||
-rw-r--r-- | module/plugins/hoster/YoutubeCom.py | 2 |
10 files changed, 325 insertions, 170 deletions
diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index fe58ff0a7..efc96ff28 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -1,19 +1,16 @@ -#!/usr/nv python
# -*- coding: utf-8 -*-
import re
-from urllib import quote, unquote
+from urllib import unquote
from random import randrange
-from os import stat
-
from module.plugins.Hoster import Hoster
from module.common.json_layer import json_loads
-from module.utils import parseFileSize, fs_encode
+from module.utils import parseFileSize
class AlldebridCom(Hoster):
__name__ = "AlldebridCom"
- __version__ = "0.3"
+ __version__ = "0.31"
__type__ = "hoster"
__pattern__ = r"https?://.*alldebrid\..*"
@@ -27,7 +24,7 @@ class AlldebridCom(Hoster): except IndexError:
name = "Unknown_Filename..."
if name.endswith("..."): #incomplete filename, append random stuff
- name += "%s.tmp" % randrange(100,999)
+ name += "%s.tmp" % randrange(100, 999)
return name
def init(self):
@@ -35,10 +32,9 @@ class AlldebridCom(Hoster): self.chunkLimit = 3
self.resumeDownload = True
-
- def process(self, pyfile):
+ def process(self, pyfile):
if not self.account:
- self.logError(_("Please enter your AllDebrid account or deactivate this plugin"))
+ self.logError("Please enter your AllDebrid account or deactivate this plugin")
self.fail("No AllDebrid account provided")
self.log.debug("AllDebrid: Old URL: %s" % pyfile.url)
@@ -46,14 +42,13 @@ class AlldebridCom(Hoster): new_url = pyfile.url
else:
password = self.getPassword().splitlines()
- if not password: password = ""
- else: password = password[0]
+ password = "" if not password else password[0]
- url = "http://www.alldebrid.com/service.php?link=%s&json=true&pw=%s" %(pyfile.url, password)
+ url = "http://www.alldebrid.com/service.php?link=%s&json=true&pw=%s" % (pyfile.url, password)
page = self.load(url)
data = json_loads(page)
-
- self.log.debug("Json data: %s" % str(data))
+
+ self.logDebug("Json data: %s" % str(data))
if data["error"]:
if data["error"] == "This link isn't available on the hoster website.":
@@ -72,7 +67,7 @@ class AlldebridCom(Hoster): else:
new_url = new_url.replace("https://", "http://")
- self.log.debug("AllDebrid: New URL: %s" % new_url)
+ self.logDebug("AllDebrid: New URL: %s" % new_url)
if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"):
#only use when name wasnt already set
@@ -80,12 +75,10 @@ class AlldebridCom(Hoster): self.download(new_url, disposition=True)
- check = self.checkDownload(
- {"error": "<title>An error occured while processing your request</title>","empty": re.compile(r"^$")})
+ check = self.checkDownload({"error": "<title>An error occured while processing your request</title>",
+ "empty": re.compile(r"^$")})
if check == "error":
self.retry(reason="An error occured while generating link.", wait_time=60)
- else:
- if check == "empty":
- self.retry(reason="Downloaded File was empty.", wait_time=60)
-
+ elif check == "empty":
+ self.retry(reason="Downloaded File was empty.", wait_time=60)
diff --git a/module/plugins/hoster/DataHu.py b/module/plugins/hoster/DataHu.py new file mode 100644 index 000000000..7abd93d1f --- /dev/null +++ b/module/plugins/hoster/DataHu.py @@ -0,0 +1,53 @@ +# -*- 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/>. # +############################################################################ + +# Test links (random.bin): +# http://data.hu/get/6381232/random.bin + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class DataHu(SimpleHoster): + __name__ = "DataHu" + __type__ = "hoster" + __pattern__ = r"http://(www\.)?data.hu/get/\w+" + __version__ = "0.01" + __description__ = """Data.hu Download Hoster""" + __author_name__ = ("crash", "stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + FILE_INFO_PATTERN = ur'<title>(?P<N>.*) \((?P<S>[^)]+)\) let\xf6lt\xe9se</title>' + FILE_OFFLINE_PATTERN = ur'Az adott f\xe1jl nem l\xe9tezik' + DIRECT_LINK_PATTERN = r'<div class="download_box_button"><a href="([^"]+)">' + + def handleFree(self): + self.resumeDownload = True + self.html = self.load(self.pyfile.url, decode=True) + + m = re.search(self.DIRECT_LINK_PATTERN, self.html) + if m: + url = m.group(1) + self.logDebug('Direct link: ' + url) + else: + self.parseError('Unable to get direct link') + + self.download(url, disposition=True) + + +getInfo = create_getInfo(DataHu) diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index 5142bbdf7..470c4ae5d 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -1,5 +1,20 @@ # -*- coding: utf-8 -*- +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see <http://www.gnu.org/licenses/>. # +############################################################################ + import re from module.plugins.Hoster import Hoster @@ -7,7 +22,7 @@ from module.plugins.Hoster import Hoster class DebridItaliaCom(Hoster): __name__ = "DebridItaliaCom" - __version__ = "0.01" + __version__ = "0.03" __type__ = "hoster" __pattern__ = r"https?://.*debriditalia\.com" __description__ = """Debriditalia.com hoster plugin""" @@ -31,8 +46,16 @@ class DebridItaliaCom(Hoster): page = self.load(url) self.logDebug("XML data: %s" % page) - new_url = re.search(r'<a href="(?:[^"]+)">(?P<direct>[^<]+)</a>', page).group('direct') + if 'File not available' in page: + self.fail('File not available') + else: + 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 + self.download(new_url, disposition=True) + + check = self.checkDownload({"empty": re.compile(r"^$")}) + + if check == "empty": + self.retry(5, 120, 'Empty file downloaded') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index b27abb416..ad278e60f 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -1,15 +1,34 @@ # -*- 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/>. #
+############################################################################
+
+# Test link (random.bin):
+# http://egofiles.com/mOZfMI1WLZ6HBkGG/random.bin
+
+import re
+
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"
+ __version__ = "0.11"
__description__ = """Egofiles.com Download Hoster"""
__author_name__ = ("stickell")
__author_mail__ = ("l.stickell@yahoo.it")
@@ -25,8 +44,15 @@ class EgoFilesCom(SimpleHoster): # Set English language
self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True)
+ def process(self, pyfile):
+ if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()):
+ self.handlePremium()
+ else:
+ self.handleFree()
+
def handleFree(self):
self.html = self.load(self.pyfile.url, decode=True)
+ self.getFileInfo()
# Wait time between free downloads
if 'For next free download you have to wait' in self.html:
@@ -56,7 +82,7 @@ class EgoFilesCom(SimpleHoster): if not downloadURL:
self.fail("No Download url retrieved/all captcha attempts failed")
- self.download(downloadURL)
+ self.download(downloadURL, disposition=True)
def handlePremium(self):
header = self.load(self.pyfile.url, just_header=True)
@@ -65,11 +91,13 @@ class EgoFilesCom(SimpleHoster): self.download(header['location'])
else:
self.html = self.load(self.pyfile.url, decode=True)
+ self.getFileInfo()
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'))
+ self.download(m.group('link'), disposition=True)
+
getInfo = create_getInfo(EgoFilesCom)
diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py new file mode 100644 index 000000000..9693723f9 --- /dev/null +++ b/module/plugins/hoster/FilerNet.py @@ -0,0 +1,103 @@ +# -*- 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/>. # +############################################################################ + +# Test links (random.bin): +# http://filer.net/get/ivgf5ztw53et3ogd +# http://filer.net/get/hgo14gzcng3scbvv + +import pycurl +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.ReCaptcha import ReCaptcha + + +class FilerNet(SimpleHoster): + __name__ = "FilerNet" + __type__ = "hoster" + __pattern__ = r"https?://(www\.)?filer\.net/get/(\w+)" + __version__ = "0.01" + __description__ = """Filer.net Download Hoster""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + FILE_INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>\w+)</small></h1>' + FILE_OFFLINE_PATTERN = r'Nicht gefunden' + RECAPTCHA_KEY = '6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V' + + def process(self, pyfile): + self.req.setOption("timeout", 120) + self.html = self.load(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES) + + # Wait between downloads + m = re.search(r'musst du <span id="time">(\d+)</span> Sekunden warten', self.html) + if m: + waittime = int(m.group(1)) + self.retry(3, waittime, 'Wait between free downloads') + + self.getFileInfo() + if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): + self.handlePremium() + else: + self.handleFree() + + def handleFree(self): + self.html = self.load(self.pyfile.url, decode=True) + + inputs = self.parseHtmlForm(input_names='token')[1] + if 'token' not in inputs: + self.parseError('Unable to detect token') + token = inputs['token'] + self.logDebug('Token: ' + token) + + self.html = self.load(self.pyfile.url, post={'token': token}, decode=True) + + inputs = self.parseHtmlForm(input_names='hash')[1] + if 'hash' not in inputs: + self.parseError('Unable to detect hash') + hash_data = inputs['hash'] + self.logDebug('Hash: ' + hash_data) + + 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, + 'hash': hash_data} + + # Workaround for 0.4.9 just_header issue. In 0.5 clean the code using just_header + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) + self.load(self.pyfile.url, post=post_data) + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) + + if 'location' in self.req.http.header: + location = re.search(r'location: (\S+)', self.req.http.header).group(1) + downloadURL = 'http://filer.net' + location + self.correctCaptcha() + break + else: + self.logInfo('Wrong captcha') + self.invalidCaptcha() + + if not downloadURL: + self.fail("No Download url retrieved/all captcha attempts failed") + + self.download(downloadURL, disposition=True) + + +getInfo = create_getInfo(FilerNet) diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 46323d829..7b87bbe71 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -7,11 +7,10 @@ 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.45" + __version__ = "0.46" __description__ = """1fichier.com download hoster""" __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") + __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>' diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py index ca5336231..9eff0dc2b 100644 --- a/module/plugins/hoster/PutlockerCom.py +++ b/module/plugins/hoster/PutlockerCom.py @@ -1,4 +1,5 @@ # -*- 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 @@ -16,114 +17,60 @@ @author: jeix """ +# http://www.putlocker.com/file/83C174C844583CF7 + import re -from module.plugins.Hoster import Hoster -from module.network.RequestFactory import getURL - -def getInfo(urls): - result = [] - - for url in urls: - - html = getURL(url) - if re.search(PutlockerCom.PATTERN_OFFLINE, html): - result.append((url, 0, 1, url)) - else: - name = re.search(PutlockerCom.PATTERN_FILENAME_1, html) - if name is None: - name = re.search(PutlockerCom.PATTERN_FILENAME_2, html) - if name is None: - result.append((url, 0, 1, url)) - continue - - name = name.group(1) - - # size = re.search(PutlockerCom.PATTERN_FILESIZE, html) - # if size is None: - # result.append((url, 0, 1, url)) - # continue - - # size = size.group(1) - - result.append((name, 0, 2, url)) - yield result - -class PutlockerCom(Hoster): + +from module.plugins.internal.SimpleHoster import SimpleHoster + + +class PutlockerCom(SimpleHoster): __name__ = "PutlockerCom" __type__ = "hoster" __pattern__ = r'http://(www\.)?putlocker\.com/(file|embed)/[A-Z0-9]+' - __version__ = "0.21" + __version__ = "0.24" __description__ = """Putlocker.Com""" - __author_name__ = ("jeix") - - PATTERN_OFFLINE = r"This file doesn't exist, or has been removed." - PATTERN_FILENAME_1 = "site-content.*?<h1>(.*?)<strong" - PATTERN_FILENAME_2 = "<title>(.*?) \|" - PATTERN_FILESIZE = "site-content.*?<h1>.*?<strong>\\((.*?)\\)" - - - 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.putlocker.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_1, self.html) - if name is None: - name = re.search(self.PATTERN_FILENAME_2, self.html) - # if name is None: - # self.fail("%s: Plugin broken." % self.__name__) - - return name.group(1) - + __author_name__ = ("jeix", "stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + FILE_OFFLINE_PATTERN = r"This file doesn't exist, or has been removed." + FILE_INFO_PATTERN = r'site-content">\s*<h1>(?P<N>.+)<strong>\( (?P<S>[^)]+) \)</strong></h1>' + + def handleFree(self): + self.html = self.load(self.pyfile.url, decode=True) + + link = self._getLink() + if not link.startswith('http://'): + link = "http://www.putlocker.com" + link + self.download(link, disposition=True) + def _getLink(self): - self.hash = re.search("<input type=\"hidden\" value=\"([a-z0-9]+)\" name=\"hash\">", self.html) - # if self.hash is None: - # self.fail("%s: Plugin broken." % self.__name__) - - self.param = "hash=" + self.hash.group(1) + "&confirm=Continue+as+Free+User" - self.html2 = self.load(self.pyfile.url, post=self.param) - if ">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html2 or "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html2: - self.waittime = 2 * 60 * 60 - self.retry(wait_time=self.waittime, reason="Waiting %s seconds" % self.waittime) - - self.link = re.search("<a href=\"/gopro\\.php\">Tired of ads and waiting\\? Go Pro\\!</a>[\t\n\rn ]+</div>[\t\n\rn ]+<a href=\"(/.*?)\"", self.html2) - if self.link is None: - self.link = re.search("\"(/get_file\\.php\\?download=[A-Z0-9]+\\&key=[a-z0-9]+)\"", self.html2) - - if self.link is None: - 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)) - self.link = re.search("media:content url=\"(http://.*?)\"", self.html3) - if self.link is None: - self.link = re.search("\"(http://media\\-b\\d+\\.putlocker\\.com/download/\\d+/.*?)\"", self.html3) - - # if link is None: - # self.fail("%s: Plugin broken." % self.__name__) - - return self.link.group(1).replace("&", "&") - - + hash_data = re.search(r'<input type="hidden" value="([a-z0-9]+)" name="hash">', self.html) + if not hash_data: + self.parseError('Unable to detect hash') + + post_data = {"hash": hash_data.group(1), "confirm": "Continue+as+Free+User"} + self.html = self.load(self.pyfile.url, post=post_data) + if ">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html or \ + "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html: + self.retry(wait_time=2 * 60 * 60, reason="Download limit exceeded or server disabled") + + patterns = (r'(/get_file\.php\?id=[A-Z0-9]+&key=[A-Za-z0-9=]+&original=1)', + r"(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+)", + r"(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+&original=1)", + r'<a href="/gopro\.php">Tired of ads and waiting\? Go Pro!</a>[\t\n\rn ]+</div>[\t\n\rn ]+<a href="(/.*?)"') + for pattern in patterns: + link = re.search(pattern, self.html) + if link: + break + else: + link = re.search(r"playlist: '(/get_file\.php\?stream=[A-Za-z0-9=]+)'", self.html) + if link: + self.html = self.load("http://www.putlocker.com" + link.group(1)) + link = re.search(r'media:content url="(http://.*?)"', self.html) + if not link: + link = re.search("\"(http://media\\-b\\d+\\.putlocker\\.com/download/\\d+/.*?)\"", self.html) + else: + self.parseError('Unable to detect a download link') + + return link.group(1).replace("&", "&") diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py index 7c5543cc8..a0f5930b5 100644 --- a/module/plugins/hoster/RarefileNet.py +++ b/module/plugins/hoster/RarefileNet.py @@ -1,30 +1,34 @@ # -*- coding: utf-8 -*- + import re + from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo from module.utils import html_unescape + class RarefileNet(XFileSharingPro): __name__ = "RarefileNet" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*rarefile.net/\w{12}" - __version__ = "0.02" + __version__ = "0.03" __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>.+?) ' + DIRECT_LINK_PATTERN = r'<a href="(?P<link>[^"]+)">(?P=link)</a>' HOSTER_NAME = "rarefile.net" - + def setup(self): - self.resumeDownload = self.multiDL = self.premium - + 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) - 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) + self.logDebug("CAPTCHA", inputs['code'], numerals) return 3 -getInfo = create_getInfo(RarefileNet)
\ No newline at end of file +getInfo = create_getInfo(RarefileNet) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index a2134ecb5..5d8c9a5ac 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -11,34 +11,37 @@ from module.plugins.ReCaptcha import ReCaptcha key = "bGhGMkllZXByd2VEZnU5Y2NXbHhYVlZ5cEE1bkEzRUw=".decode('base64') + def getID(url): """ returns id from file url""" - m = re.match(r"http://[\w\.-]*?(uploaded\.(to|net)(/file/|/?\?id=|.*?&id=)|ul\.to/)(?P<ID>\w+)", url) + m = re.match(r"http://[\w\.-]*?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=)(?P<ID>\w+)", url) return m.group('ID') + def getAPIData(urls): - post = {"apikey" : key} + post = {"apikey": key} - idMap = {} + idMap = {} - for i, url in enumerate(urls): - id = getID(url) - post["id_%s" % i] = id - idMap[id] = url + for i, url in enumerate(urls): + id = getID(url) + post["id_%s" % i] = id + idMap[id] = url - api = unicode(getURL("http://uploaded.net/api/filemultiple", post=post, decode=False), 'iso-8859-1') + api = unicode(getURL("http://uploaded.net/api/filemultiple", post=post, decode=False), 'iso-8859-1') - result = {} + result = {} - if api: - for line in api.splitlines(): - data = line.split(",", 4) - if data[1] in idMap: - result[data[1]] = (data[0], data[2], data[4], data[3], idMap[data[1]]) + if api: + for line in api.splitlines(): + data = line.split(",", 4) + if data[1] in idMap: + result[data[1]] = (data[0], data[2], data[4], data[3], idMap[data[1]]) - return result + return result -def parseFileInfo(self, url = '', html = ''): + +def parseFileInfo(self, url='', html=''): if not html and hasattr(self, "html"): html = self.html name, size, status, found, fileid = url, 0, 3, None, None @@ -54,6 +57,7 @@ def parseFileInfo(self, url = '', html = ''): return name, size, status, fileid + def getInfo(urls): for chunk in chunks(urls, 80): result = [] @@ -74,7 +78,7 @@ class UploadedTo(Hoster): __name__ = "UploadedTo" __type__ = "hoster" __pattern__ = r"http://[\w\.-]*?(uploaded\.(to|net)(/file/|/?\?id=|.*?&id=)|ul\.to/)\w+" - __version__ = "0.64" + __version__ = "0.65" __description__ = """Uploaded.net Download Hoster""" __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") @@ -88,7 +92,7 @@ class UploadedTo(Hoster): self.multiDL = False self.resumeDownload = False self.url = False - self.chunkLimit = 1 # critical problems with more chunks + self.chunkLimit = 1 # critical problems with more chunks if self.account: self.premium = self.account.getAccountInfo(self.user)["premium"] if self.premium: @@ -108,7 +112,7 @@ class UploadedTo(Hoster): if not api: self.logWarning("No response for API call") - self.html = unicode(self.load(pyfile.url, decode = False), 'iso-8859-1') + self.html = unicode(self.load(pyfile.url, decode=False), 'iso-8859-1') name, size, status, self.fileID = parseFileInfo(self) self.logDebug(name, size, status, self.fileID) if status == 1: @@ -140,8 +144,9 @@ class UploadedTo(Hoster): def handlePremium(self): info = self.account.getAccountInfo(self.user, True) - self.log.debug("%(name)s: Use Premium Account (%(left)sGB left)" % {"name" :self.__name__, "left" : info["trafficleft"]/1024/1024}) - if int(self.data[1])/1024 > info["trafficleft"]: + self.log.debug("%(name)s: Use Premium Account (%(left)sGB left)" % {"name": self.__name__, + "left": info["trafficleft"] / 1024 / 1024}) + if int(self.data[1]) / 1024 > info["trafficleft"]: self.log.info(_("%s: Not enough traffic left" % self.__name__)) self.account.empty(self.user) self.resetAccount() @@ -185,7 +190,7 @@ class UploadedTo(Hoster): #self.req.lastURL = str(self.url) re_captcha = ReCaptcha(self) challenge, result = re_captcha.challenge(challengeId.group(1)) - options = {"recaptcha_challenge_field" : challenge, "recaptcha_response_field": result} + options = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": result} self.wait() result = self.load(url, post=options) @@ -193,13 +198,13 @@ class UploadedTo(Hoster): if "limit-size" in result: self.fail("File too big for free download") - elif "limit-slot" in result: # Temporary restriction so just wait a bit + elif "limit-slot" in result: # Temporary restriction so just wait a bit self.setWait(30 * 60, True) self.wait() self.retry() elif "limit-parallel" in result: self.fail("Cannot download in parallel") - elif self.DL_LIMIT_PATTERN in result: # limit-dl + elif self.DL_LIMIT_PATTERN in result: # limit-dl self.setWait(60 * 60, True) self.wait() self.retry() diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 8b8764367..2fb1e5264 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -34,7 +34,7 @@ class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" __pattern__ = r"(http|https)://(www\.)?(de\.)?\youtube\.com/watch\?v=.*" - __version__ = "0.29" + __version__ = "0.30" __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), |