]>
Commit | Line | Data |
---|---|---|
f4cc03d6 AB |
1 | from __future__ import unicode_literals |
2 | ||
3 | from .common import InfoExtractor | |
4 | ||
5 | ||
6 | class StretchInternetIE(InfoExtractor): | |
22cb9490 | 7 | _VALID_URL = r'https?://portal\.stretchinternet\.com/[^/]+/(?:portal|full)\.htm\?.*?\beventId=(?P<id>\d+)' |
f4cc03d6 | 8 | _TEST = { |
22cb9490 | 9 | 'url': 'https://portal.stretchinternet.com/umary/portal.htm?eventId=573272&streamType=video', |
f4cc03d6 | 10 | 'info_dict': { |
22cb9490 | 11 | 'id': '573272', |
f4cc03d6 | 12 | 'ext': 'mp4', |
ec5e77c5 | 13 | 'title': 'UNIVERSITY OF MARY WRESTLING VS UPPER IOWA', |
14 | # 'timestamp': 1575668361, | |
15 | # 'upload_date': '20191206', | |
16 | 'uploader_id': '99997', | |
f4cc03d6 AB |
17 | } |
18 | } | |
19 | ||
20 | def _real_extract(self, url): | |
21 | video_id = self._match_id(url) | |
a3de5e6c | 22 | |
ec5e77c5 | 23 | media_url = self._download_json( |
24 | 'https://core.stretchlive.com/trinity/event/tcg/' + video_id, | |
25 | video_id)[0]['media'][0]['url'] | |
a3de5e6c | 26 | event = self._download_json( |
ec5e77c5 | 27 | 'https://neo-client.stretchinternet.com/portal-ws/getEvent.json', |
28 | video_id, query={'eventID': video_id, 'token': 'asdf'})['event'] | |
a3de5e6c | 29 | |
f4cc03d6 | 30 | return { |
f4cc03d6 | 31 | 'id': video_id, |
22cb9490 | 32 | 'title': event['title'], |
ec5e77c5 | 33 | # TODO: parse US timezone abbreviations |
34 | # 'timestamp': event.get('dateTimeString'), | |
35 | 'url': 'https://' + media_url, | |
36 | 'uploader_id': event.get('ownerID'), | |
f4cc03d6 | 37 | } |