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

drtalks.py (2251B)


  1. from .brightcove import BrightcoveNewIE
  2. from .common import InfoExtractor
  3. from ..utils import url_or_none
  4. from ..utils.traversal import traverse_obj
  5. class DrTalksIE(InfoExtractor):
  6. _VALID_URL = r'https?://(?:www\.)?drtalks\.com/videos/(?P<id>[\w-]+)'
  7. _TESTS = [{
  8. 'url': 'https://drtalks.com/videos/six-pillars-of-resilience-tools-for-managing-stress-and-flourishing/',
  9. 'info_dict': {
  10. 'id': '6366193757112',
  11. 'ext': 'mp4',
  12. 'uploader_id': '6314452011001',
  13. 'tags': ['resilience'],
  14. 'description': 'md5:9c6805aee237ee6de8052461855b9dda',
  15. 'timestamp': 1734546659,
  16. 'thumbnail': 'https://drtalks.com/wp-content/uploads/2024/12/Episode-82-Eva-Selhub-DrTalks-Thumbs.jpg',
  17. 'title': 'Six Pillars of Resilience: Tools for Managing Stress and Flourishing',
  18. 'duration': 2800.682,
  19. 'upload_date': '20241218',
  20. },
  21. }, {
  22. 'url': 'https://drtalks.com/videos/the-pcos-puzzle-mastering-metabolic-health-with-marcelle-pick/',
  23. 'info_dict': {
  24. 'id': '6364699891112',
  25. 'ext': 'mp4',
  26. 'title': 'The PCOS Puzzle: Mastering Metabolic Health with Marcelle Pick',
  27. 'description': 'md5:e87cbe00ca50135d5702787fc4043aaa',
  28. 'thumbnail': 'https://drtalks.com/wp-content/uploads/2024/11/Episode-34-Marcelle-Pick-OBGYN-NP-DrTalks.jpg',
  29. 'duration': 3515.2,
  30. 'tags': ['pcos'],
  31. 'upload_date': '20241114',
  32. 'timestamp': 1731592119,
  33. 'uploader_id': '6314452011001',
  34. },
  35. }]
  36. def _real_extract(self, url):
  37. video_id = self._match_id(url)
  38. webpage = self._download_webpage(url, video_id)
  39. next_data = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['data']['video']
  40. return self.url_result(
  41. next_data['videos']['brightcoveVideoLink'], BrightcoveNewIE, video_id,
  42. url_transparent=True,
  43. **traverse_obj(next_data, {
  44. 'title': ('title', {str}),
  45. 'description': ('videos', 'summury', {str}),
  46. 'thumbnail': ('featuredImage', 'node', 'sourceUrl', {url_or_none}),
  47. }))