summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2010-08-15 22:48:11 +0200
committerGravatar spoob <spoob@gmx.de> 2010-08-15 22:48:11 +0200
commit258a8799f5aa2a4637586bea0276adf969650ccc (patch)
treeb704ca0a5aaf72e47f4ea62762d37c9007c9d980
parentscripts fix, rs fix, closed #127 (diff)
downloadpyload-258a8799f5aa2a4637586bea0276adf969650ccc.tar.xz
Youtube Playlist
-rw-r--r--module/plugins/crypter/YoutubeBatch.py7
-rw-r--r--module/plugins/hoster/YoutubeCom.py1
-rwxr-xr-xpyLoadCore.py9
3 files changed, 14 insertions, 3 deletions
diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py
index 091c8558a..b48026654 100644
--- a/module/plugins/crypter/YoutubeBatch.py
+++ b/module/plugins/crypter/YoutubeBatch.py
@@ -8,15 +8,16 @@ from module.plugins.Crypter import Crypter
class YoutubeBatch(Crypter):
__name__ = "YoutubeBatch"
__type__ = "container"
- __pattern__ = r"http://(www\.)?(de\.)?\youtube\.com/user/*"
+ __pattern__ = r"http://(?:www\.)?(?:de\.)?\youtube\.com/(?:user/.*?/user/(?P<g1>.{16})|(?:.*?feature=PlayList\&|view_play_list\?)p=(?P<g2>.{16}))"
__version__ = "0.9"
__description__ = """Youtube.com Channel Download Plugin"""
__author_name__ = ("RaNaN", "Spoob")
__author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org")
def setup(self):
- self.user = re.search(r"/user/(.+)", self.pyfile.url).group(1).split("#")[0]
- self.playlist = re.search(r"/user/%s.*?/user/(.{16})" % self.user, self.pyfile.url).group(1)
+ compile_id = re.compile(self.__pattern__)
+ match_id = compile_id.match(self.pyfile.url)
+ self.playlist = match_id.group(match_id.lastgroup)
def file_exists(self):
if "User not found" in self.req.load("http://gdata.youtube.com/feeds/api/playlists/%s?v=2" % self.playlist):
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py
index d92d8d128..79c359ad7 100644
--- a/module/plugins/hoster/YoutubeCom.py
+++ b/module/plugins/hoster/YoutubeCom.py
@@ -32,6 +32,7 @@ class YoutubeCom(Hoster):
if self.getConf("quality") == "hd" or self.getConf("quality") == "hq":
file_suffix = ".mp4"
+
name = (re.search(file_name_pattern, html).group(1).replace("/", "") + file_suffix).decode("utf8")
pyfile.name = name #.replace("&amp;", "&").replace("ö", "oe").replace("ä", "ae").replace("ü", "ue")
diff --git a/pyLoadCore.py b/pyLoadCore.py
index fe7ba861f..c2cb7976a 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -50,6 +50,15 @@ from time import sleep
from traceback import print_exc
from xmlrpclib import Binary
+
+import locale
+import codecs
+encoding = locale.getlocale()[1]
+if not encoding:
+ encoding = "us-ascii"
+sys.stdout = codecs.getwriter(encoding)(sys.stdout, errors = "ignore")
+sys.stderr = codecs.getwriter(encoding)(sys.stderr, errors = "ignore")
+
from module import InitHomeDir
from module.AccountManager import AccountManager
from module.CaptchaManager import CaptchaManager