]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/unity.py
1 from .common
import InfoExtractor
2 from .youtube
import YoutubeIE
5 class UnityIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:www\.)?unity3d\.com/learn/tutorials/(?:[^/]+/)*(?P<id>[^/?#&]+)'
8 'url': 'https://unity3d.com/learn/tutorials/topics/animation/animate-anything-mecanim',
12 'title': 'Live Training 22nd September 2014 - Animate Anything',
13 'description': 'md5:e54913114bd45a554c56cdde7669636e',
16 'uploader_id': 'Unity3D',
17 'upload_date': '20140926',
20 'url': 'https://unity3d.com/learn/tutorials/projects/2d-ufo-tutorial/following-player-camera?playlist=25844',
21 'only_matching': True,
24 def _real_extract(self
, url
):
25 video_id
= self
._match
_id
(url
)
26 webpage
= self
._download
_webpage
(url
, video_id
)
27 youtube_id
= self
._search
_regex
(
28 r
'data-video-id="([_0-9a-zA-Z-]+)"',
29 webpage
, 'youtube ID')
30 return self
.url_result(youtube_id
, ie
=YoutubeIE
.ie_key(), video_id
=video_id
)