X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fstretchinternet.py;h=4dbead2ba428abdbfc678aea31403b998a1eb06c;hb=HEAD;hp=9a0ec0e650689879ef92cec2f5a2b99185a97dcc;hpb=f4cc03d60b5dd713fb8964cd9ecf8ca2b1a8a556;p=youtube-dl diff --git a/youtube_dl/extractor/stretchinternet.py b/youtube_dl/extractor/stretchinternet.py index 9a0ec0e65..4dbead2ba 100644 --- a/youtube_dl/extractor/stretchinternet.py +++ b/youtube_dl/extractor/stretchinternet.py @@ -1,28 +1,32 @@ -# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor +from ..utils import int_or_none class StretchInternetIE(InfoExtractor): - IE_DESC = 'StretchInternet' - _VALID_URL = r'https?://.*?stretchinternet\.com/[^/_?].*(?<=eventId=)(?P.*)(?=&).*' + _VALID_URL = r'https?://portal\.stretchinternet\.com/[^/]+/(?:portal|full)\.htm\?.*?\beventId=(?P\d+)' _TEST = { - 'url': 'https://portal.stretchinternet.com/umary/portal.htm?eventId=313900&streamType=video', + 'url': 'https://portal.stretchinternet.com/umary/portal.htm?eventId=573272&streamType=video', 'info_dict': { - 'id': '313900', + 'id': '573272', 'ext': 'mp4', - 'title': 'StretchInternet' + 'title': 'University of Mary Wrestling vs. Upper Iowa', + 'timestamp': 1575668361, + 'upload_date': '20191206', } } def _real_extract(self, url): video_id = self._match_id(url) - stream = self._download_json('https://neo-client.stretchinternet.com/streamservice/v1/media/stream/v%s' % video_id, video_id) - stream_url = stream.get('source') + + event = self._download_json( + 'https://api.stretchinternet.com/trinity/event/tcg/' + video_id, + video_id)[0] + return { - 'ie_key': 'Generic', 'id': video_id, - 'url': 'http://%s' % stream_url, - 'title': 'StretchInternet' + 'title': event['title'], + 'timestamp': int_or_none(event.get('dateCreated'), 1000), + 'url': 'https://' + event['media'][0]['url'], }