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

germanupa.py (4051B)


  1. from .common import InfoExtractor
  2. from .vimeo import VimeoIE
  3. from ..utils import (
  4. parse_qs,
  5. traverse_obj,
  6. url_or_none,
  7. )
  8. class GermanupaIE(InfoExtractor):
  9. IE_DESC = 'germanupa.de'
  10. _VALID_URL = r'https?://germanupa\.de/mediathek/(?P<id>[\w-]+)'
  11. _TESTS = [{
  12. 'url': 'https://germanupa.de/mediathek/4-figma-beratung-deine-sprechstunde-fuer-figma-fragen',
  13. 'info_dict': {
  14. 'id': '909179246',
  15. 'title': 'Tutorial: #4 Figma Beratung - Deine Sprechstunde für Figma-Fragen',
  16. 'ext': 'mp4',
  17. 'uploader': 'German UPA',
  18. 'uploader_id': 'germanupa',
  19. 'thumbnail': 'https://i.vimeocdn.com/video/1792564420-7415283ccef8bf8702dab8c6b7515555ceeb7a1c11371ffcc133b8e887dbf70e-d_1280',
  20. 'uploader_url': 'https://vimeo.com/germanupa',
  21. 'duration': 3987,
  22. },
  23. 'expected_warnings': ['Failed to parse XML: not well-formed'],
  24. 'params': {'skip_download': 'm3u8'},
  25. }, {
  26. 'note': 'audio, uses GenericIE',
  27. 'url': 'https://germanupa.de/mediathek/live-vom-ux-festival-neuigkeiten-von-figma-jobmarkt-agenturszene-interview-zu-sustainable',
  28. 'info_dict': {
  29. 'id': '1867346676',
  30. 'title': 'Live vom UX Festival: Neuigkeiten von Figma, Jobmarkt, Agenturszene & Interview zu Sustainable UX',
  31. 'ext': 'opus',
  32. 'timestamp': 1720545088,
  33. 'upload_date': '20240709',
  34. 'duration': 3910.557,
  35. 'like_count': int,
  36. 'description': 'md5:db2aed5ff131e177a7b33901e9a8db05',
  37. 'uploader': 'German UPA',
  38. 'repost_count': int,
  39. 'genres': ['Science'],
  40. 'license': 'all-rights-reserved',
  41. 'uploader_url': 'https://soundcloud.com/user-80097677',
  42. 'uploader_id': '471579486',
  43. 'view_count': int,
  44. 'comment_count': int,
  45. 'thumbnail': 'https://i1.sndcdn.com/artworks-oCti2e9GhaZFWBqY-48ybGw-original.jpg',
  46. },
  47. }, {
  48. 'note': 'Nur für Mitglieder/Just for members',
  49. 'url': 'https://germanupa.de/mediathek/ux-festival-2024-usability-tests-und-ai',
  50. 'info_dict': {
  51. 'id': '986994430',
  52. 'title': 'UX Festival 2024 "Usability Tests und AI" von Lennart Weber',
  53. 'ext': 'mp4',
  54. 'release_date': '20240719',
  55. 'uploader_url': 'https://vimeo.com/germanupa',
  56. 'timestamp': 1721373980,
  57. 'license': 'by-sa',
  58. 'like_count': int,
  59. 'thumbnail': 'https://i.vimeocdn.com/video/1904187064-2a672630c30f9ad787bd390bff3f51d7506a3e8416763ba6dbf465732b165c5c-d_1280',
  60. 'duration': 2146,
  61. 'release_timestamp': 1721373980,
  62. 'uploader': 'German UPA',
  63. 'uploader_id': 'germanupa',
  64. 'upload_date': '20240719',
  65. 'comment_count': int,
  66. },
  67. 'expected_warnings': ['Failed to parse XML: not well-formed'],
  68. 'skip': 'login required',
  69. }]
  70. def _real_extract(self, url):
  71. video_id = self._match_id(url)
  72. webpage = self._download_webpage(url, video_id)
  73. param_url = traverse_obj(
  74. self._search_regex(
  75. r'<iframe[^>]+data-src\s*?=\s*?([\'"])(?P<url>https://germanupa\.de/media/oembed\?url=(?:(?!\1).)+)\1',
  76. webpage, 'embedded video', default=None, group='url'),
  77. ({parse_qs}, 'url', 0, {url_or_none}))
  78. if not param_url:
  79. if self._search_regex(
  80. r'<div[^>]+class\s*?=\s*?([\'"])(?:(?!\1).)*login-wrapper(?:(?!\1).)*\1',
  81. webpage, 'login wrapper', default=None):
  82. self.raise_login_required('This video is only available for members')
  83. return self.url_result(url, 'Generic') # Fall back to generic to extract audio
  84. real_url = param_url.replace('https://vimeo.com/', 'https://player.vimeo.com/video/')
  85. return self.url_result(VimeoIE._smuggle_referrer(real_url, url), VimeoIE, video_id)