You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.0 KiB

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. from ..utils import int_or_none
  4. class StretchInternetIE(InfoExtractor):
  5. _VALID_URL = r'https?://portal\.stretchinternet\.com/[^/]+/(?:portal|full)\.htm\?.*?\beventId=(?P<id>\d+)'
  6. _TEST = {
  7. 'url': 'https://portal.stretchinternet.com/umary/portal.htm?eventId=573272&streamType=video',
  8. 'info_dict': {
  9. 'id': '573272',
  10. 'ext': 'mp4',
  11. 'title': 'University of Mary Wrestling vs. Upper Iowa',
  12. 'timestamp': 1575668361,
  13. 'upload_date': '20191206',
  14. }
  15. }
  16. def _real_extract(self, url):
  17. video_id = self._match_id(url)
  18. event = self._download_json(
  19. 'https://api.stretchinternet.com/trinity/event/tcg/' + video_id,
  20. video_id)[0]
  21. return {
  22. 'id': video_id,
  23. 'title': event['title'],
  24. 'timestamp': int_or_none(event.get('dateCreated'), 1000),
  25. 'url': 'https://' + event['media'][0]['url'],
  26. }