]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/gdcvault.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from .kaltura
import KalturaIE
13 class GDCVaultIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://(?:www\.)?gdcvault\.com/play/(?P<id>\d+)(?:/(?P<name>[\w-]+))?'
15 _NETRC_MACHINE
= 'gdcvault'
18 'url': 'http://www.gdcvault.com/play/1019721/Doki-Doki-Universe-Sweet-Simple',
19 'md5': '7ce8388f544c88b7ac11c7ab1b593704',
21 'id': '201311826596_AWNY',
22 'display_id': 'Doki-Doki-Universe-Sweet-Simple',
24 'title': 'Doki-Doki Universe: Sweet, Simple and Genuine (GDC Next 10)'
28 'url': 'http://www.gdcvault.com/play/1015683/Embracing-the-Dark-Art-of',
30 'id': '201203272_1330951438328RSXR',
31 'display_id': 'Embracing-the-Dark-Art-of',
33 'title': 'Embracing the Dark Art of Mathematical Modeling in AI'
36 'skip_download': True, # Requires rtmpdump
40 'url': 'http://www.gdcvault.com/play/1015301/Thexder-Meets-Windows-95-or',
41 'md5': 'a5eb77996ef82118afbbe8e48731b98e',
44 'display_id': 'Thexder-Meets-Windows-95-or',
46 'title': 'Thexder Meets Windows 95, or Writing Great Games in the Windows 95 Environment',
48 'skip': 'Requires login',
51 'url': 'http://gdcvault.com/play/1020791/',
52 'only_matching': True,
56 'url': 'http://gdcvault.com/play/1023460/Tenacious-Design-and-The-Interface',
57 'md5': 'a8efb6c31ed06ca8739294960b2dbabd',
61 'display_id': 'Tenacious-Design-and-The-Interface',
62 'title': 'Tenacious Design and The Interface of \'Destiny\'',
67 'url': 'http://www.gdcvault.com/play/1014631/Classic-Game-Postmortem-PAC',
69 'id': '12396_1299111843500GMPX',
71 'title': 'How to Create a Good Game - From My Experience of Designing Pac-Man',
74 # 'skip_download': True, # Requires rtmpdump
75 # 'format': 'jp', # The japanese audio
80 'url': 'http://www.gdcvault.com/play/1435/An-American-engine-in-Tokyo',
82 'id': '9350_1238021887562UHXB',
83 'display_id': 'An-American-engine-in-Tokyo',
85 'title': 'An American Engine in Tokyo:/nThe collaboration of Epic Games and Square Enix/nFor THE LAST REMINANT',
90 'url': 'https://www.gdcvault.com/play/1026180/Mastering-the-Apex-of-Scaling',
94 'title': 'Mastering the Apex of Scaling Game Servers (Presented by Multiplay)',
95 'timestamp': 1554401811,
96 'upload_date': '20190404',
97 'uploader_id': 'joe@blazestreaming.com',
105 def _login(self
, webpage_url
, display_id
):
106 username
, password
= self
._get
_login
_info
()
107 if username
is None or password
is None:
108 self
.report_warning('It looks like ' + webpage_url
+ ' requires a login. Try specifying a username and password and try again.')
111 mobj
= re
.match(r
'(?P<root_url>https?://.*?/).*', webpage_url
)
112 login_url
= mobj
.group('root_url') + 'api/login.php'
113 logout_url
= mobj
.group('root_url') + 'logout'
117 'password': password
,
120 request
= sanitized_Request(login_url
, urlencode_postdata(login_form
))
121 request
.add_header('Content-Type', 'application/x-www-form-urlencoded')
122 self
._download
_webpage
(request
, display_id
, 'Logging in')
123 webpage
= self
._download
_webpage
(webpage_url
, display_id
, 'Getting authenticated video page')
124 self
._download
_webpage
(logout_url
, display_id
, 'Logging out')
128 def _real_extract(self
, url
):
129 video_id
, name
= re
.match(self
._VALID
_URL
, url
).groups()
130 display_id
= name
or video_id
132 webpage
= self
._download
_webpage
(url
, display_id
)
134 title
= self
._html
_search
_regex
(
135 r
'<td><strong>Session Name:?</strong></td>\s*<td>(.*?)</td>',
138 PLAYER_REGEX
= r
'<iframe src=\"(?P<manifest_url>.*?)\".*?</iframe>'
139 manifest_url
= self
._html
_search
_regex
(
140 PLAYER_REGEX
, webpage
, 'manifest_url')
142 partner_id
= self
._search
_regex
(
143 r
'/p(?:artner_id)?/(\d+)', manifest_url
, 'partner id',
146 kaltura_id
= self
._search
_regex
(
147 r
'entry_id=(?P<id>(?:[^&])+)', manifest_url
,
148 'kaltura id', group
='id')
151 '_type': 'url_transparent',
152 'url': 'kaltura:%s:%s' % (partner_id
, kaltura_id
),
153 'ie_key': KalturaIE
.ie_key(),
155 'display_id': display_id
,