diff options
Diffstat (limited to 'youtube_dl/utils.py')
| -rw-r--r-- | youtube_dl/utils.py | 19 | 
1 files changed, 18 insertions, 1 deletions
| diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index d00b14b86..c0325f054 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -925,6 +925,21 @@ def determine_ext(url, default_ext='unknown_video'):      guess = url.partition('?')[0].rpartition('.')[2]      if re.match(r'^[A-Za-z0-9]+$', guess):          return guess +    elif guess.rstrip('/') in ( +            'mp4', 'm4a', 'm4p', 'm4b', 'm4r', 'm4v', 'aac', +            'flv', 'f4v', 'f4a', 'f4b', +            'webm', 'ogg', 'ogv', 'oga', 'ogx', 'spx', 'opus', +            'mkv', 'mka', 'mk3d', +            'avi', 'divx', +            'mov', +            'asf', 'wmv', 'wma', +            '3gp', '3g2', +            'mp3', +            'flac', +            'ape', +            'wav', +            'f4f', 'f4m', 'm3u8', 'smil'): +        return guess.rstrip('/')      else:          return default_ext @@ -1668,7 +1683,9 @@ def urlencode_postdata(*args, **kargs):  def encode_dict(d, encoding='utf-8'): -    return dict((k.encode(encoding), v.encode(encoding)) for k, v in d.items()) +    def encode(v): +        return v.encode(encoding) if isinstance(v, compat_basestring) else v +    return dict((encode(k), encode(v)) for k, v in d.items())  US_RATINGS = { | 
