[cleanup] Misc (#8968)
[yt-dlp.git] / yt_dlp / extractor / unity.py
blob6d8bc05939f61861dd3b3ca1433967c12b0aa2dd
1 from .common import InfoExtractor
2 from .youtube import YoutubeIE
5 class UnityIE(InfoExtractor):
6 _WORKING = False
7 _VALID_URL = r'https?://(?:www\.)?unity3d\.com/learn/tutorials/(?:[^/]+/)*(?P<id>[^/?#&]+)'
8 _TESTS = [{
9 'url': 'https://unity3d.com/learn/tutorials/topics/animation/animate-anything-mecanim',
10 'info_dict': {
11 'id': 'jWuNtik0C8E',
12 'ext': 'mp4',
13 'title': 'Live Training 22nd September 2014 - Animate Anything',
14 'description': 'md5:e54913114bd45a554c56cdde7669636e',
15 'duration': 2893,
16 'uploader': 'Unity',
17 'uploader_id': 'Unity3D',
18 'upload_date': '20140926',
20 }, {
21 'url': 'https://unity3d.com/learn/tutorials/projects/2d-ufo-tutorial/following-player-camera?playlist=25844',
22 'only_matching': True,
25 def _real_extract(self, url):
26 video_id = self._match_id(url)
27 webpage = self._download_webpage(url, video_id)
28 youtube_id = self._search_regex(
29 r'data-video-id="([_0-9a-zA-Z-]+)"',
30 webpage, 'youtube ID')
31 return self.url_result(youtube_id, ie=YoutubeIE.ie_key(), video_id=video_id)