'tb, if given, is the original traceback (so that it can be printed out).
If expected is set, this is a normal error message and most likely not a bug in youtube-dl.'

def __init__(self, msg, tb=None, expected=False, cause=None, video_id=None):

    if (sys.exc_info()[0] in (compat_urllib_error.URLError, socket.timeout, UnavailableVideoError)):
        expected = True
    if (video_id is not None):
        msg = ((video_id + u':    ') + msg)
    if cause:
        msg += (u'    (caused    by    %r)' % cause)
    if (not expected):
        msg += bug_reports_message()
    super(ExtractorError, self).__init__(msg)
    self.traceback = tb
    self.exc_info = sys.exc_info()
    self.cause = cause
    self.video_id = video_id
