[Go90] Correctly pass the preplay URL to the uplynk extractor

This commit is contained in:
Jeremie J. Jarosh 2017-02-04 12:47:46 -06:00
parent f7fe731cbf
commit f0870a92aa

View File

@ -2,7 +2,6 @@
from __future__ import unicode_literals
from .common import InfoExtractor
from .uplynk import UplynkPreplayIE
from ..utils import sanitize_url
@ -14,14 +13,20 @@ class Go90IE(InfoExtractor):
'info_dict': {
'id': '07d47f43a7b04eb5b693252f2bd1086b',
'ext': 'mp4',
'title': 't@gged S1:E1 #shotgun',
'title': 't@gged | #shotgun | go90',
'thumbnail': r're:^https?://.*\.jpg$',
'uploader_id': '98ac1613c7624a8387596b5d5e441064',
# TODO more properties, either as:
# * A value
# * MD5 checksum; start the string with md5:
# * A regular expression; start the string with re:
# * Any Python type (for example int or float)
}
},
'params': {
# m3u8 download
'skip_download': True,
},
'add_ie': ['UplynkPreplay'],
}
def _real_extract(self, url):
@ -33,26 +38,22 @@ class Go90IE(InfoExtractor):
page_data = {}
self.to_screen("Scrape data from webpage")
page_data['id'] = video_id
video_title = self._html_search_regex(
r'<title\b[^>]*>\s*(.*)\s*</title>', webpage, 'title')
page_data['title'] = video_title
self.to_screen("Title: " + page_data['title'])
self.to_screen("Title: " + video_title)
# retrieve upLynk data
# retrieve upLynk url
video_api = "https://www.go90.com/api/metadata/video/" + video_id
video_api_data = self._download_json(video_api, video_id) #TODO: overwrite `note=` to output better explanation
video_token_url = sanitize_url(video_api_data['url'])
uplynk_preplay = UplynkPreplayIE(self._downloader)
uplynk_data = uplynk_preplay.extract(video_token_url)
uplynk_preplay_url = sanitize_url(video_api_data['url'])
# merge data
video_data = uplynk_data.copy()
video_data.update(page_data)
# TODO more properties (see youtube_dl/extractor/common.py)
return video_data
return {
'_type': 'url_transparent',
'url': uplynk_preplay_url,
'id': video_id,
'title': video_title,
'ie_key': 'UplynkPreplay',
# TODO more properties (see youtube_dl/extractor/common.py)
}