X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Futils.py;h=efbe64fb315dba92383f8b1053a80558f4a12d7b;hb=416c7fcbce86324587afae11414c71ff603ad296;hp=f9938616d647efc25444dcf94d9c1b0fa019ae81;hpb=cae97f6521a846392e665d8743d4c000fb7d7173;p=youtube-dl diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index f9938616d..efbe64fb3 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -363,7 +363,7 @@ def encodeArgument(s): if not isinstance(s, compat_str): # Legacy code that uses byte strings # Uncomment the following line after fixing all post processors - #assert False, 'Internal error: %r should be of type %r, is %r' % (s, compat_str, type(s)) + # assert False, 'Internal error: %r should be of type %r, is %r' % (s, compat_str, type(s)) s = s.decode('ascii') return encodeFilename(s, True) @@ -464,6 +464,13 @@ class ExtractorError(Exception): return ''.join(traceback.format_tb(self.traceback)) +class UnsupportedError(ExtractorError): + def __init__(self, url): + super(UnsupportedError, self).__init__( + 'Unsupported URL: %s' % url, expected=True) + self.url = url + + class RegexNotFoundError(ExtractorError): """Error when a regex didn't match""" pass