summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/accounts/RapidshareCom.py7
-rw-r--r--module/plugins/container/LinkList.py23
-rw-r--r--module/plugins/hooks/LinkdecrypterCom.py4
-rw-r--r--module/plugins/hoster/BasePlugin.py4
-rw-r--r--module/plugins/hoster/ExtabitCom.py87
-rw-r--r--module/plugins/hoster/LetitbitNet.py30
-rw-r--r--module/plugins/hoster/NetloadIn.py6
-rw-r--r--module/plugins/hoster/RapidshareCom.py16
8 files changed, 101 insertions, 76 deletions
diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py
index e69f17e62..15722e099 100644
--- a/module/plugins/accounts/RapidshareCom.py
+++ b/module/plugins/accounts/RapidshareCom.py
@@ -21,7 +21,7 @@ from module.plugins.Account import Account
class RapidshareCom(Account):
__name__ = "RapidshareCom"
- __version__ = "0.21"
+ __version__ = "0.22"
__type__ = "account"
__description__ = """Rapidshare.com account plugin"""
__author_name__ = ("mkaay")
@@ -41,8 +41,11 @@ class RapidshareCom(Account):
continue
k, v = t.split("=")
info[k] = v
+
+ validuntil = int(info["billeduntil"])
+ premium = True if validuntil else False
- tmp = {"validuntil":int(info["billeduntil"]), "trafficleft":-1, "maxtraffic":-1}
+ tmp = {"premium": premium, "validuntil": validuntil, "trafficleft":-1, "maxtraffic":-1}
return tmp
diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py
index b9eb4b972..fefeaf486 100644
--- a/module/plugins/container/LinkList.py
+++ b/module/plugins/container/LinkList.py
@@ -1,21 +1,32 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
+import codecs
+from module.utils import fs_encode
from module.plugins.Container import Container
class LinkList(Container):
__name__ = "LinkList"
- __version__ = "0.11"
+ __version__ = "0.12"
__pattern__ = r".+\.txt$"
__description__ = """Read Link Lists in txt format"""
- __config__ = [("clear", "bool", "Clear Linklist after adding", False)]
+ __config__ = [("clear", "bool", "Clear Linklist after adding", False),
+ ("encoding", "string", "File encoding (default utf-8)", "")]
__author_name__ = ("spoob", "jeix")
__author_mail__ = ("spoob@pyload.org", "jeix@hasnomail.com")
-
def decrypt(self, pyfile):
- txt = open(pyfile.url, 'r')
+ try:
+ file_enc = codecs.lookup(self.getConfig("encoding")).name
+ except:
+ file_enc = "utf-8"
+
+ print repr(pyfile.url)
+ print pyfile.url
+
+ file_name = fs_encode(pyfile.url)
+
+ txt = codecs.open(file_name, 'r', file_enc)
links = txt.readlines()
curPack = "Parsed links from %s" % pyfile.name
@@ -48,7 +59,7 @@ class LinkList(Container):
if self.getConfig("clear"):
try:
- txt = open(pyfile.url, 'wb')
+ txt = open(file_name, 'wb')
txt.close()
except:
self.log.warning(_("LinkList could not be cleared."))
diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py
index 90a42150b..9192ca1a9 100644
--- a/module/plugins/hooks/LinkdecrypterCom.py
+++ b/module/plugins/hooks/LinkdecrypterCom.py
@@ -24,7 +24,7 @@ from module.utils import remove_chars
class LinkdecrypterCom(Hook):
__name__ = "LinkdecrypterCom"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """linkdecrypter.com - regexp loader"""
__config__ = [ ("activated", "bool", "Activated" , "True") ]
__author_name__ = ("zoidberg")
@@ -43,7 +43,7 @@ class LinkdecrypterCom(Hook):
self.logError(_("Crypter list is empty"))
return
- regexp = r"http://(\w\.)*(%s).*" % "|".join(online)
+ regexp = r"http://([^.]+\.)*?(%s)/.*" % "|".join(online)
dict = self.core.pluginManager.crypterPlugins[self.__name__]
dict["pattern"] = regexp
diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py
index 2de47940d..f1e3006d0 100644
--- a/module/plugins/hoster/BasePlugin.py
+++ b/module/plugins/hoster/BasePlugin.py
@@ -12,7 +12,7 @@ class BasePlugin(Hoster):
__name__ = "BasePlugin"
__type__ = "hoster"
__pattern__ = r"^unmatchable$"
- __version__ = "0.14"
+ __version__ = "0.15"
__description__ = """Base Plugin when any other didnt fit"""
__author_name__ = ("RaNaN")
__author_mail__ = ("RaNaN@pyload.org")
@@ -71,7 +71,7 @@ class BasePlugin(Hoster):
else:
url = pyfile.url
- name = html_unescape(urlparse(url).path.split("/")[-1])
+ name = html_unescape(unquote(urlparse(url).path.split("/")[-1]))
if 'content-disposition' in header:
self.logDebug("Content-Disposition: " + header['content-disposition'])
diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py
index 1cbc997f0..a23feb3a9 100644
--- a/module/plugins/hoster/ExtabitCom.py
+++ b/module/plugins/hoster/ExtabitCom.py
@@ -18,64 +18,63 @@
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.ReCaptcha import ReCaptcha
+from module.common.json_layer import json_loads
class ExtabitCom(SimpleHoster):
__name__ = "ExtabitCom"
__type__ = "hoster"
- __pattern__ = r"http://(www\.)?extabit\.com/[a-zA-Z0-9-._ ]{11}B"
- __version__ = "0.1"
- __description__ = """UniBytes.com"""
+ __pattern__ = r"http://(\w+\.)*extabit\.com/(file|go)/(?P<ID>\w+)"
+ __version__ = "0.2"
+ __description__ = """Extabit.com"""
__author_name__ = ("zoidberg")
FILE_NAME_PATTERN = r'<th>File:</th>\s*<td class="col-fileinfo">\s*<div title="(?P<N>[^"]+)">'
FILE_SIZE_PATTERN = r'<th>Size:</th>\s*<td class="col-fileinfo">(?P<S>[^<]+)</td>'
-
- DOMAIN = 'http://www.unibytes.com'
+ FILE_OFFLINE_PATTERN = r'<h1>File not found</h1>'
+ TEMP_OFFLINE_PATTERN = r">(File is temporary unavailable|No download mirror)<"
- WAIT_PATTERN = r'Wait for <span id="slowRest">(\d+)</span> sec'
- DOWNLOAD_LINK_PATTERN = r'<a href="([^"]+)">Download</a>'
+ DOWNLOAD_LINK_PATTERN = r'"(http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)"'
- def handleFree(self):
- action, post_data = self.parseHtmlForm('id="startForm"')
- self.req.http.c.setopt(FOLLOWLOCATION, 0)
-
- for i in range(8):
- self.logDebug(action, post_data)
- self.html = self.load(self.DOMAIN + action, post = post_data)
-
- found = re.search(r'location:\s*(\S+)', self.req.http.header, re.I)
- if found:
- url = found.group(1)
- break
+ def handleFree(self):
+ if r">Only premium users can download this file" in self.html:
+ self.fail("Only premium users can download this file")
+
+ m = re.search(r"Next free download from your ip will be available in <b>(\d+)\s*minutes", self.html)
+ if m:
+ self.setWait(int(m.group(1)) * 60, True)
+ self.wait()
+ elif "The daily downloads limit from your IP is exceeded" in self.html:
+ self.setWait(3600, True)
+ self.wait()
+
+ m = re.search(r'recaptcha/api/challenge\?k=(\w+)', self.html)
+ if m:
+ recaptcha = ReCaptcha(self)
+ captcha_key = m.group(1)
- if '>Somebody else is already downloading using your IP-address<' in self.html:
- self.setWait(600, True)
- self.wait()
- self.retry()
-
- if post_data['step'] == 'last':
- found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html)
- if found:
- url = found.group(1)
+ for i in range(5):
+ get_data = {"type": "recaptcha"}
+ get_data["challenge"], get_data["capture"] = recaptcha.challenge(captcha_key)
+ response = json_loads(self.load("http://extabit.com/file/%s/" % (self.file_info['ID']), get = get_data))
+ if "ok" in response:
self.correctCaptcha()
break
else:
self.invalidCaptcha()
-
- last_step = post_data['step']
- action, post_data = self.parseHtmlForm('id="stepForm"')
-
- if last_step == 'timer':
- found = re.search(self.WAIT_PATTERN, self.html)
- self.setWait(int(found.group(1)) if found else 60, False)
- self.wait()
- elif last_step in ('captcha', 'last'):
- post_data['captcha'] = self.decryptCaptcha(self.DOMAIN + '/captcha.jpg')
+ else:
+ self.fail("Invalid captcha")
else:
- self.fail("No valid captcha code entered")
-
- self.logDebug('Download link: ' + url)
- self.req.http.c.setopt(FOLLOWLOCATION, 1)
- self.download(url)
+ self.parseError('Captcha')
+
+ if not "href" in response: self.parseError('JSON')
+
+ self.html = self.load("http://extabit.com/file/%s%s" % (self.file_info['ID'], response['href']))
+ m = re.search(self.DOWNLOAD_LINK_PATTERN, self.html)
+ if not m:
+ self.parseError('Download URL')
+ url = m.group(1)
+ self.logDebug("Download URL: " + url)
+ self.download(url)
-getInfo = create_getInfo(UnibytesCom) \ No newline at end of file
+getInfo = create_getInfo(ExtabitCom) \ No newline at end of file
diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py
index 475f0931b..aed35e71b 100644
--- a/module/plugins/hoster/LetitbitNet.py
+++ b/module/plugins/hoster/LetitbitNet.py
@@ -19,12 +19,13 @@
import re
from random import random
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.common.json_layer import json_loads
class LetitbitNet(SimpleHoster):
__name__ = "LetitbitNet"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*letitbit.net/download/.*"
- __version__ = "0.14"
+ __version__ = "0.15"
__description__ = """letitbit.net"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -61,21 +62,36 @@ class LetitbitNet(SimpleHoster):
self.parseError("page 3 / js")
response = self.load(ajax_check_url, post = inputs, cookies = True)
- if response != '1': self.fail('Unknown response (ajax_check_url)')
+ if response != '1': self.parseError('Unknown response - ajax_check_url')
for i in range(5):
captcha = self.decryptCaptcha('%s/captcha_new.php?rand=%d' % (captcha_url, random() * 100000), cookies = True)
response = self.load(captcha_url + '/ajax/check_captcha.php', post = {"code": captcha}, cookies = True)
self.logDebug(response)
- if response.startswith('http://'):
- download_url = response
- self.correctCaptcha()
+ if not response:
+ self.invalidCaptcha()
+ elif response.startswith('['):
+ urls = json_loads(response)
+ break
+ elif response.startswith('http://'):
+ urls = [response]
break
else:
- self.invalidCaptcha()
+ self.parseError("Unknown response - captcha check")
+
else:
self.fail("No valid captcha solution received")
- self.download(download_url)
+ self.correctCaptcha()
+
+ for download_url in urls:
+ try:
+ self.logDebug("Download URL", download_url)
+ self.download(download_url)
+ break
+ except Exception, e:
+ self.logError(e)
+ else:
+ self.fail("Download did not finish correctly")
getInfo = create_getInfo(LetitbitNet) \ No newline at end of file
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index 94d3f65c4..83a25bcfb 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -55,14 +55,14 @@ class NetloadIn(Hoster):
__name__ = "NetloadIn"
__type__ = "hoster"
__pattern__ = r"http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)"
- __version__ = "0.35"
+ __version__ = "0.36"
__description__ = """Netload.in Download Hoster"""
__author_name__ = ("spoob", "RaNaN", "Gregy")
__author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "gregy@gregy.cz")
def setup(self):
self.multiDL = False
- if self.account:
+ if self.premium:
self.multiDL = True
self.chunkLimit = -1
self.resumeDownload = True
@@ -79,7 +79,7 @@ class NetloadIn(Hoster):
if self.api_data and self.api_data["filename"]:
self.pyfile.name = self.api_data["filename"]
- if self.account:
+ if self.premium:
self.log.debug("Netload: Use Premium Account")
return True
diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py
index 0d927c525..8b31dd42c 100644
--- a/module/plugins/hoster/RapidshareCom.py
+++ b/module/plugins/hoster/RapidshareCom.py
@@ -50,7 +50,7 @@ class RapidshareCom(Hoster):
__name__ = "RapidshareCom"
__type__ = "hoster"
__pattern__ = r"https?://[\w\.]*?rapidshare.com/(?:files/(?P<id>\d*?)/(?P<name>[^?]+)|#!download\|(?:\w+)\|(?P<id_new>\d+)\|(?P<name_new>[^|]+))"
- __version__ = "1.37"
+ __version__ = "1.38"
__description__ = """Rapidshare.com Download Hoster"""
__config__ = [["server", "Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera", "Preferred Server", "None"]]
__author_name__ = ("spoob", "RaNaN", "mkaay")
@@ -60,17 +60,14 @@ class RapidshareCom(Hoster):
self.html = None
self.no_download = True
self.api_data = None
- self.multiDL = False
self.offset = 0
self.dl_dict = {}
self.id = None
self.name = None
-
- if self.account:
- self.multiDL = True
- self.chunkLimit = -1
- self.resumeDownload = True
+
+ self.chunkLimit = -1 if self.premium else 1
+ self.multiDL = self.resumeDownload = self.premium
def process(self, pyfile):
self.url = self.pyfile.url
@@ -90,7 +87,7 @@ class RapidshareCom(Hoster):
if self.api_data["status"] == "1":
self.pyfile.name = self.get_file_name()
- if self.account:
+ if self.premium:
self.handlePremium()
else:
self.handleFree()
@@ -225,5 +222,4 @@ class RapidshareCom(Hoster):
def get_file_name(self):
if self.api_data["filename"]:
return self.api_data["filename"]
- return self.url.split("/")[-1]
-
+ return self.url.split("/")[-1] \ No newline at end of file