diff options
author | Unknown <blackjack4494@web.de> | 2020-09-02 20:25:25 +0200 |
---|---|---|
committer | Unknown <blackjack4494@web.de> | 2020-09-02 20:25:25 +0200 |
commit | cefecac12cd3c70f9c7a30992c60b05c2eb5d34e (patch) | |
tree | f7b8e3f8ca2f6e402c83a501f72c09854ae04887 /youtube_dlc/extractor/unity.py | |
parent | 9688f237163b6aa546fde00bb3fd1e3445dd4c31 (diff) | |
download | hypervideo-pre-cefecac12cd3c70f9c7a30992c60b05c2eb5d34e.tar.lz hypervideo-pre-cefecac12cd3c70f9c7a30992c60b05c2eb5d34e.tar.xz hypervideo-pre-cefecac12cd3c70f9c7a30992c60b05c2eb5d34e.zip |
[skip travis] renaming
to avoid using same folder when using pip install for example
Diffstat (limited to 'youtube_dlc/extractor/unity.py')
-rw-r--r-- | youtube_dlc/extractor/unity.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/youtube_dlc/extractor/unity.py b/youtube_dlc/extractor/unity.py new file mode 100644 index 000000000..73daacf29 --- /dev/null +++ b/youtube_dlc/extractor/unity.py @@ -0,0 +1,32 @@ +from __future__ import unicode_literals + +from .common import InfoExtractor +from .youtube import YoutubeIE + + +class UnityIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?unity3d\.com/learn/tutorials/(?:[^/]+/)*(?P<id>[^/?#&]+)' + _TESTS = [{ + 'url': 'https://unity3d.com/learn/tutorials/topics/animation/animate-anything-mecanim', + 'info_dict': { + 'id': 'jWuNtik0C8E', + 'ext': 'mp4', + 'title': 'Live Training 22nd September 2014 - Animate Anything', + 'description': 'md5:e54913114bd45a554c56cdde7669636e', + 'duration': 2893, + 'uploader': 'Unity', + 'uploader_id': 'Unity3D', + 'upload_date': '20140926', + } + }, { + 'url': 'https://unity3d.com/learn/tutorials/projects/2d-ufo-tutorial/following-player-camera?playlist=25844', + 'only_matching': True, + }] + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + youtube_id = self._search_regex( + r'data-video-id="([_0-9a-zA-Z-]+)"', + webpage, 'youtube ID') + return self.url_result(youtube_id, ie=YoutubeIE.ie_key(), video_id=video_id) |