]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/gdcvault.py
3 from .common
import InfoExtractor
4 from .kaltura
import KalturaIE
14 class GDCVaultIE(InfoExtractor
):
15 _VALID_URL
= r
'https?://(?:www\.)?gdcvault\.com/play/(?P<id>\d+)(?:/(?P<name>[\w-]+))?'
16 _NETRC_MACHINE
= 'gdcvault'
19 'url': 'http://www.gdcvault.com/play/1019721/Doki-Doki-Universe-Sweet-Simple',
20 'md5': '7ce8388f544c88b7ac11c7ab1b593704',
22 'id': '201311826596_AWNY',
23 'display_id': 'Doki-Doki-Universe-Sweet-Simple',
25 'title': 'Doki-Doki Universe: Sweet, Simple and Genuine (GDC Next 10)'
29 'url': 'http://www.gdcvault.com/play/1015683/Embracing-the-Dark-Art-of',
31 'id': '201203272_1330951438328RSXR',
32 'display_id': 'Embracing-the-Dark-Art-of',
34 'title': 'Embracing the Dark Art of Mathematical Modeling in AI'
37 'skip_download': True, # Requires rtmpdump
41 'url': 'http://www.gdcvault.com/play/1015301/Thexder-Meets-Windows-95-or',
42 'md5': 'a5eb77996ef82118afbbe8e48731b98e',
45 'display_id': 'Thexder-Meets-Windows-95-or',
47 'title': 'Thexder Meets Windows 95, or Writing Great Games in the Windows 95 Environment',
49 'skip': 'Requires login',
52 'url': 'http://gdcvault.com/play/1020791/',
53 'only_matching': True,
57 'url': 'http://gdcvault.com/play/1023460/Tenacious-Design-and-The-Interface',
58 'md5': 'a8efb6c31ed06ca8739294960b2dbabd',
62 'display_id': 'Tenacious-Design-and-The-Interface',
63 'title': 'Tenacious Design and The Interface of \'Destiny\'',
68 'url': 'http://www.gdcvault.com/play/1014631/Classic-Game-Postmortem-PAC',
70 'id': '12396_1299111843500GMPX',
72 'title': 'How to Create a Good Game - From My Experience of Designing Pac-Man',
75 # 'skip_download': True, # Requires rtmpdump
76 # 'format': 'jp', # The japanese audio
81 'url': 'http://www.gdcvault.com/play/1435/An-American-engine-in-Tokyo',
83 'id': '9350_1238021887562UHXB',
84 'display_id': 'An-American-engine-in-Tokyo',
86 'title': 'An American Engine in Tokyo:/nThe collaboration of Epic Games and Square Enix/nFor THE LAST REMINANT',
91 'url': 'https://www.gdcvault.com/play/1026180/Mastering-the-Apex-of-Scaling',
95 'title': 'Mastering the Apex of Scaling Game Servers (Presented by Multiplay)',
96 'timestamp': 1554401811,
97 'upload_date': '20190404',
98 'uploader_id': 'joe@blazestreaming.com',
105 # Kaltura embed, whitespace between quote and embedded URL in iframe's src
106 'url': 'https://www.gdcvault.com/play/1025699',
110 'title': 'Tech Toolbox',
111 'upload_date': '20190408',
112 'uploader_id': 'joe@blazestreaming.com',
113 'timestamp': 1554764629,
116 'skip_download': True,
121 'url': 'http://www.gdcvault.com/play/1014846/Conference-Keynote-Shigeru',
122 'only_matching': True,
126 def _login(self
, webpage_url
, display_id
):
127 username
, password
= self
._get
_login
_info
()
128 if username
is None or password
is None:
129 self
.report_warning('It looks like ' + webpage_url
+ ' requires a login. Try specifying a username and password and try again.')
132 mobj
= re
.match(r
'(?P<root_url>https?://.*?/).*', webpage_url
)
133 login_url
= mobj
.group('root_url') + 'api/login.php'
134 logout_url
= mobj
.group('root_url') + 'logout'
138 'password': password
,
141 request
= sanitized_Request(login_url
, urlencode_postdata(login_form
))
142 request
.add_header('Content-Type', 'application/x-www-form-urlencoded')
143 self
._download
_webpage
(request
, display_id
, 'Logging in')
144 start_page
= self
._download
_webpage
(webpage_url
, display_id
, 'Getting authenticated video page')
145 self
._download
_webpage
(logout_url
, display_id
, 'Logging out')
149 def _real_extract(self
, url
):
150 video_id
, name
= self
._match
_valid
_url
(url
).groups()
151 display_id
= name
or video_id
153 webpage_url
= 'http://www.gdcvault.com/play/' + video_id
154 start_page
= self
._download
_webpage
(webpage_url
, display_id
)
156 direct_url
= self
._search
_regex
(
157 r
's1\.addVariable\("file",\s*encodeURIComponent\("(/[^"]+)"\)\);',
158 start_page
, 'url', default
=None)
160 title
= self
._html
_search
_regex
(
161 r
'<td><strong>Session Name:?</strong></td>\s*<td>(.*?)</td>',
163 video_url
= 'http://www.gdcvault.com' + direct_url
164 # resolve the url so that we can detect the correct extension
165 video_url
= self
._request
_webpage
(
166 HEADRequest(video_url
), video_id
).geturl()
170 'display_id': display_id
,
175 embed_url
= KalturaIE
._extract
_url
(start_page
)
177 embed_url
= smuggle_url(embed_url
, {'source_url': url}
)
180 PLAYER_REGEX
= r
'<iframe src="(?P<xml_root>.+?)/(?:gdc-)?player.*?\.html.*?".*?</iframe>'
182 xml_root
= self
._html
_search
_regex
(
183 PLAYER_REGEX
, start_page
, 'xml root', default
=None)
185 # Probably need to authenticate
186 login_res
= self
._login
(webpage_url
, display_id
)
187 if login_res
is None:
188 self
.report_warning('Could not login.')
190 start_page
= login_res
191 # Grab the url from the authenticated page
192 xml_root
= self
._html
_search
_regex
(
193 PLAYER_REGEX
, start_page
, 'xml root')
195 xml_name
= self
._html
_search
_regex
(
196 r
'<iframe src=".*?\?xml(?:=|URL=xml/)(.+?\.xml).*?".*?</iframe>',
197 start_page
, 'xml filename', default
=None)
199 info
= self
._parse
_html
5_media
_entries
(url
, start_page
, video_id
)[0]
201 'title': remove_start(self
._search
_regex
(
202 r
'>Session Name:\s*<.*?>\s*<td>(.+?)</td>', start_page
,
203 'title', default
=None) or self
._og
_search
_title
(
204 start_page
, default
=None), 'GDC Vault - '),
206 'display_id': display_id
,
209 embed_url
= '%s/xml/%s' % (xml_root
, xml_name
)
210 ie_key
= 'DigitallySpeaking'
213 '_type': 'url_transparent',
215 'display_id': display_id
,