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