Skip to content

Commit

Permalink
[ie/gotowebinar] Add extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
FestplattenSchnitzel committed Jan 18, 2025
1 parent a3c0321 commit 10e3469
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions yt_dlp/extractor/_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@
from .gopro import GoProIE
from .goshgay import GoshgayIE
from .gotostage import GoToStageIE
from .gotowebinar import GoTo_WebinarIE
from .gputechconf import GPUTechConfIE
from .graspop import GraspopIE
from .gronkh import (
Expand Down
55 changes: 55 additions & 0 deletions yt_dlp/extractor/gotowebinar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
from .common import InfoExtractor
from ..utils import ExtractorError


class GoTo_WebinarIE(InfoExtractor):
_VALID_URL = r'https?://(register|attendee)\.gotowebinar\.com/recording/viewRecording/(?P<webinar_key>[0-9]+)/(?P<recording_key>[0-9]+)/(?P<email>[^?]+)(?:\?registrantKey=(?P<registrant_key>[0-9]+))?'
_TESTS = [
{
# Source: https://community.intel.com/t5/Processors/Deriving-core-numbering-on-sockets-without-disabled-tiles/m-p/1263389
'url': 'https://register.gotowebinar.com/recording/viewRecording/8573274081823101697/1166504161772360449/mfratkin@tacc.utexas.edu?registrantKey=6636963737074316811&type=ATTENDEEEMAILRECORDINGLINK',
'info_dict': {
'id': '8573274081823101697-1166504161772360449',
'title': 'Topology and Cache Coherence in Knights Landing and Skylake Xeon Processors',
'description': 'md5:2d673910d31bfb4918a0605ea60561dd',
'creators': 'IXPUG Committee',
'ext': 'mp4',
},
},
]

def _real_extract(self, url):
webinar_key, recording_key, email, registrant_key = self._match_valid_url(url).group('webinar_key', 'recording_key', 'email', 'registrant_key')
video_id = f'{webinar_key}-{recording_key}'

if not registrant_key:
registrant_metadata = self._download_json(
f'https://globalattspa.gotowebinar.com/api/webinars/{webinar_key}/registrants?email={email}',
video_id,
note='Downloading registrant metadata',
errnote='Unable to download registrant metadata')
if not (registrant_key := registrant_metadata.get('registrantKey')):
raise ExtractorError('Unable to retrieve registrant key')

important_metadata = self._download_json(
f'https://api.services.gotomeeting.com/registrationservice/api/v1/webinars/{webinar_key}/registrants/{registrant_key}/recordingAssets?type=FOLLOWUPEMAILRECORDINGLINK&client=spa',
video_id,
note='Downloading important recording metadata',
errnote='Unable to important download recording metadata')

non_important_metadata = self._download_json(
f'https://global.gotowebinar.com/api/webinars/{webinar_key}',
video_id,
note='Downloading non-important recording metadata',
errnote='Unable to non-important download recording metadata',
fatal=False)

return {
'id': video_id,
'url': important_metadata.get('cdnLocation'),
'ext': 'mp4',
'is_live': False,
'title': non_important_metadata.get('subject'),
'description': non_important_metadata.get('description'),
'creators': non_important_metadata.get('organizerName'),
}

0 comments on commit 10e3469

Please sign in to comment.