diff options
Diffstat (limited to 'module/plugins/hoster')
| -rw-r--r-- | module/plugins/hoster/YoutubeCom.py | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 1db5fc0a4..316eebd4b 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -4,7 +4,6 @@  import re  import subprocess  import os -import os.path  from urllib import unquote  from module.utils import html_unescape @@ -37,7 +36,7 @@ class YoutubeCom(Hoster):      __name__ = "YoutubeCom"      __type__ = "hoster"      __pattern__ = r"https?://(?:[^/]*?)youtube\.com/watch.*?[?&]v=.*" -    __version__ = "0.34" +    __version__ = "0.35"      __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), @@ -49,6 +48,9 @@ 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 = ':?><"|\\' +      # name, width, height, quality ranking, 3D      formats = {5: (".flv", 400, 240, 1, False),                 6: (".flv", 640, 400, 4, False), @@ -137,6 +139,11 @@ class YoutubeCom(Hoster):          file_suffix = self.formats[fmt][0] if fmt in self.formats else ".flv"          file_name_pattern = '<meta name="title" content="(.+?)">'          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, '_') +          pyfile.name = html_unescape(name)          time = re.search(r"t=((\d+)m)?(\d+)s", pyfile.url) | 
