logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

screenrec.py (1171B)


  1. from .common import InfoExtractor
  2. class ScreenRecIE(InfoExtractor):
  3. _VALID_URL = r'https?://(?:www\.)?screenrec\.com/share/(?P<id>\w{10})'
  4. _TESTS = [{
  5. 'url': 'https://screenrec.com/share/DasLtbknYo',
  6. 'info_dict': {
  7. 'id': 'DasLtbknYo',
  8. 'ext': 'mp4',
  9. 'title': '02.05.2024_03.01.25_REC',
  10. 'description': 'Recorded with ScreenRec',
  11. 'thumbnail': r're:^https?://.*\.gif$',
  12. },
  13. 'params': {
  14. 'skip_download': True,
  15. },
  16. }]
  17. def _real_extract(self, url):
  18. video_id = self._match_id(url)
  19. webpage = self._download_webpage(url, video_id)
  20. m3u8_url = self._search_regex(
  21. r'customUrl\s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage, 'm3u8 URL', group='url')
  22. return {
  23. 'id': video_id,
  24. 'title': self._og_search_title(webpage, default=None) or self._html_extract_title(webpage),
  25. 'description': self._og_search_description(webpage),
  26. 'thumbnail': self._og_search_thumbnail(webpage),
  27. 'formats': self._extract_m3u8_formats(m3u8_url, video_id, ext='mp4'),
  28. }