+import urllib.parse
+
from .common import InfoExtractor
-from ..compat import (
- compat_str,
- compat_urllib_parse_unquote,
-)
from ..utils import (
ExtractorError,
int_or_none,
def _real_initialize(self):
auth = self._get_cookies('https://www.gaia.com/').get('auth')
if auth:
- auth = self._parse_json(compat_urllib_parse_unquote(auth.value), None, fatal=False)
+ auth = self._parse_json(urllib.parse.unquote(auth.value), None, fatal=False)
self._jwt = auth.get('jwt')
def _perform_login(self, username, password):
'https://auth.gaia.com/v1/login',
None, data=urlencode_postdata({
'username': username,
- 'password': password
+ 'password': password,
}))
if auth.get('success') is False:
raise ExtractorError(', '.join(auth['messages']), expected=True)
node = self._download_json(
'https://brooklyn.gaia.com/node/%d' % node_id, node_id)
vdata = node[vtype]
- media_id = compat_str(vdata['nid'])
+ media_id = str(vdata['nid'])
title = node['title']
headers = None
media_id, headers=headers)
formats = self._extract_m3u8_formats(
media['mediaUrls']['bcHLS'], media_id, 'mp4')
- self._sort_formats(formats)
subtitles = {}
text_tracks = media.get('textTracks', {})
'like_count': int_or_none(try_get(fivestar, lambda x: x['up_count']['value'])),
'dislike_count': int_or_none(try_get(fivestar, lambda x: x['down_count']['value'])),
'comment_count': int_or_none(node.get('comment_count')),
- 'series': try_get(node, lambda x: x['series']['title'], compat_str),
+ 'series': try_get(node, lambda x: x['series']['title'], str),
'season_number': int_or_none(get_field_value('season')),
'season_id': str_or_none(get_field_value('series_nid', 'nid')),
'episode_number': int_or_none(get_field_value('episode')),