@ -4,7 +4,8 @@ from __future__ import unicode_literals
importos
from.commonimportInfoExtractor
from..utilsimportparse_iso8601
from..compatimportcompat_str
from..utilsimportparse_iso8601,try_get
COOKIE_NEBULA_AUTH=os.environ.get('COOKIE_NEBULA_AUTH')# FIXME: a workaround for testing, because I couldn't figure out how to supply a cookiejar when running the unit tests
metadata=self._parse_json(initial_state_object,video_id=display_id)# TODO: we don't have the real video ID yet, is it okay to pass the display_id instead?
metadata=self._parse_json(initial_state_object,video_id=display_id)ifinitial_state_objectelseNone# TODO: we don't have the real video ID yet, is it okay to pass the display_id instead?
ifcategory.get('value'):# we're intentionally not using "'value' in category" here, because the expression is supposed to be falsy for empty lists in category['value'] as well!
returncategory['value'][0]
returnNone
def_real_extract(self,url):
# FIXME: a workaround for testing, because I couldn't figure out how to supply a cookiejar when running the unit tests
@ -163,18 +174,17 @@ class NebulaIE(InfoExtractor):
'url':video_url,
# the meta data we were able to extract from Nebula
'id':tn['name'],# this appears to be null in all cases I've seen
'id':tn.get('name'),# this appears to be null in all cases I've seen
'url':tn['url'],
'width':tn['width'],
'height':tn['height'],
}fortninvideo_meta['thumbnails']
],
'duration':video_meta['duration'],
'width':tn.get('width'),
'height':tn.get('height'),
}fortninvideo_meta.get('thumbnails',[])],
'duration':video_meta.get('duration'),
'channel':channel_title,
'uploader':channel_title,# we chose here to declare the channel name as the 'uploader' -- that's certainly arguable, as sometimes it's more of a series
# TODO: uploader_url: the video page clearly links to this (in the example case: /lindsayellis), but I cannot figure out where it gets it from!