-# coding: utf-8
-from __future__ import unicode_literals
-
from .common import InfoExtractor
-from ..compat import (
- compat_HTTPError,
- compat_str,
-)
+from ..compat import compat_str
+from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
- int_or_none,
float_or_none,
+ int_or_none,
parse_resolution,
str_or_none,
try_get,
display_id, 'Downloading video JSON',
headers=self.geo_verification_headers())
except ExtractorError as e:
- if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:
+ if isinstance(e.cause, HTTPError) and e.cause.status == 403:
self.raise_geo_restricted()
raise
format_id += '-%sp' % quality
f['format_id'] = format_id
formats.append(f)
- self._sort_formats(formats)
creator = try_get(
show, lambda x: x['producer']['name'], compat_str)