diff options
author | Pccode66 <49125134+Pccode66@users.noreply.github.com> | 2021-02-24 15:45:56 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-25 00:15:56 +0530 |
commit | 7a5c1cfe93924351387b44919b3c0b2f66c4b883 (patch) | |
tree | 6da63f3d7b16cf7d4b9fdb29b029125cab8bd0d3 /yt_dlp/extractor/unity.py | |
parent | c4218ac3f1146daac20308439cdc374e3561101a (diff) | |
download | hypervideo-pre-7a5c1cfe93924351387b44919b3c0b2f66c4b883.tar.lz hypervideo-pre-7a5c1cfe93924351387b44919b3c0b2f66c4b883.tar.xz hypervideo-pre-7a5c1cfe93924351387b44919b3c0b2f66c4b883.zip |
Completely change project name to yt-dlp (#85)
* All modules and binary names are changed
* All documentation references changed
* yt-dlp no longer loads youtube-dlc config files
* All URLs changed to point to organization account
Co-authored-by: Pccode66
Co-authored-by: pukkandan
Diffstat (limited to 'yt_dlp/extractor/unity.py')
-rw-r--r-- | yt_dlp/extractor/unity.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/yt_dlp/extractor/unity.py b/yt_dlp/extractor/unity.py new file mode 100644 index 000000000..73daacf29 --- /dev/null +++ b/yt_dlp/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) |