]>
Commit | Line | Data |
---|---|---|
ca1c9f26 PV |
1 | from .common import InfoExtractor |
2 | from .youtube import YoutubeIE | |
3 | ||
4 | ||
5 | class UnityIE(InfoExtractor): | |
df773c3d | 6 | _WORKING = False |
ca1c9f26 PV |
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', | |
19 | } | |
20 | }, { | |
21 | 'url': 'https://unity3d.com/learn/tutorials/projects/2d-ufo-tutorial/following-player-camera?playlist=25844', | |
22 | 'only_matching': True, | |
23 | }] | |
24 | ||
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) |