diff options
author | Stefano <l.stickell@yahoo.it> | 2013-10-24 15:21:41 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-10-24 15:21:41 +0200 |
commit | e7cc8750280b48671cb55967ce2102e85b6f4ffd (patch) | |
tree | 4a76b0058fba9c88bdfed5570cbcf59d67909153 | |
parent | Fastshare: fixed offline pattern (diff) | |
download | pyload-e7cc8750280b48671cb55967ce2102e85b6f4ffd.tar.xz |
YouTube: using encode to avoid any bad char issue
-rw-r--r-- | module/plugins/hoster/YoutubeCom.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index e829bedd0..9ef49c2d6 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -36,7 +36,7 @@ class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" __pattern__ = r"https?://(?:[^/]*?)youtube\.com/watch.*?[?&]v=.*" - __version__ = "0.36" + __version__ = "0.37" __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), @@ -48,9 +48,6 @@ class YoutubeCom(Hoster): __author_name__ = ("spoob", "zoidberg") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") - # Invalid characters that must be removed from the file name - invalidChars = u'\u2605:?><"|\\' - # name, width, height, quality ranking, 3D formats = {5: (".flv", 400, 240, 1, False), 6: (".flv", 640, 400, 4, False), @@ -141,8 +138,7 @@ class YoutubeCom(Hoster): name = re.search(file_name_pattern, html).group(1).replace("/", "") # Cleaning invalid characters from the file name - for c in self.invalidChars: - name = name.replace(c, '_') + name = name.encode('latin-1', 'replace') pyfile.name = html_unescape(name) |