summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-11-13 21:57:57 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-11-13 21:57:57 +0100
commit94966b3c2a093a79858dd9672ae2380bdc3ccf6e (patch)
treecf634304915a98d122d92916e4fff55749fc8a59 /module/plugins
parentupdate XFileSharingPro & add billionuploads,sendmyway,sharebees plugins (diff)
downloadpyload-94966b3c2a093a79858dd9672ae2380bdc3ccf6e.tar.xz
youtube config options, resume - closed #717, ul.to - closed #716,
netload.in - fix some urls, linkdecrypter - fix crypter list
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hooks/LinkdecrypterCom.py19
-rw-r--r--module/plugins/hoster/NetloadIn.py12
-rw-r--r--module/plugins/hoster/UploadedTo.py13
-rw-r--r--module/plugins/hoster/YoutubeCom.py20
4 files changed, 43 insertions, 21 deletions
diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py
index ac939afd9..a554e05eb 100644
--- a/module/plugins/hooks/LinkdecrypterCom.py
+++ b/module/plugins/hooks/LinkdecrypterCom.py
@@ -24,28 +24,33 @@ from module.utils import remove_chars
class LinkdecrypterCom(Hook):
__name__ = "LinkdecrypterCom"
- __version__ = "0.14"
+ __version__ = "0.15"
__description__ = """linkdecrypter.com - regexp loader"""
__config__ = [ ("activated", "bool", "Activated" , "True") ]
__author_name__ = ("zoidberg")
-
+
def coreReady(self):
page = getURL("http://linkdecrypter.com/")
m = re.search(r'<b>Supported</b>: <i>([^+<]*)', page)
if not m:
self.logError(_("Crypter list not found"))
return
-
- online = m.group(1).split(', ')
+
builtin = [ name.lower() for name in self.core.pluginManager.crypterPlugins.keys() ]
builtin.extend([ "downloadserienjunkiesorg" ])
-
- online = [ crypter.replace(".", "\\.") for crypter in online if remove_chars(crypter, "-.") not in builtin ]
+
+ crypter_pattern = re.compile("(\w[\w.-]+)")
+ online = []
+ for crypter in m.group(1).split(', '):
+ m = re.match(crypter_pattern, crypter)
+ if m and remove_chars(m.group(1), "-.") not in builtin:
+ online.append(m.group(1).replace(".", "\\."))
+
if not online:
self.logError(_("Crypter list is empty"))
return
- regexp = r"https?://([^.]+\.)*?(%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/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index fa2f3ddef..d2bf37d70 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -55,7 +55,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")
@@ -66,7 +66,7 @@ class NetloadIn(Hoster):
self.multiDL = True
self.chunkLimit = -1
self.resumeDownload = True
-
+
def process(self, pyfile):
self.url = pyfile.url
self.prepare()
@@ -94,7 +94,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
@@ -107,7 +111,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/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index 19ca4ba9d..d729e73c6 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -74,13 +74,14 @@ class UploadedTo(Hoster):
__name__ = "UploadedTo"
__type__ = "hoster"
__pattern__ = r"http://[\w\.-]*?(uploaded\.(to|net)(/file/|/?\?id=|.*?&id=)|ul\.to/)\w+"
- __version__ = "0.62"
+ __version__ = "0.63"
__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")
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
@@ -199,7 +200,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()
@@ -212,11 +213,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/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py
index c9e8a1c7a..29cb3f60a 100644
--- a/module/plugins/hoster/YoutubeCom.py
+++ b/module/plugins/hoster/YoutubeCom.py
@@ -11,9 +11,9 @@ class YoutubeCom(Hoster):
__name__ = "YoutubeCom"
__type__ = "hoster"
__pattern__ = r"(http|https)://(www\.)?(de\.)?\youtube\.com/watch\?v=.*"
- __version__ = "0.27"
- __config__ = [("quality", "sd;hd;fullhd", "Quality Setting", "hd"),
- ("fmt", "int", "FMT Number 0-102", 0),
+ __version__ = "0.28"
+ __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),
@@ -47,6 +47,8 @@ class YoutubeCom(Hoster):
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)
@@ -59,8 +61,16 @@ class YoutubeCom(Hoster):
#get config
use3d = self.getConf("3d")
- quality = {"sd":82,"hd":84,"fullhd":85} if use3d else {"sd":18,"hd":22,"fullhd":37}
- desired_fmt = self.getConf("fmt") or quality.get(self.getConf("quality"), 18)
+ 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 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 = unquote(re.search(r'url_encoded_fmt_stream_map=(.*?);', html).group(1))