From 149e69ec98046879e3fdfed89b90a8c4f80589bd Mon Sep 17 00:00:00 2001 From: Evan Zhang Date: Sun, 2 Oct 2022 12:48:33 -0400 Subject: [PATCH 1/2] Nest Add new extractor --- youtube_dl/extractor/extractors.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 751fc38b6..e53f8d33e 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -761,6 +761,7 @@ from .ndr import ( from .ndtv import NDTVIE from .netzkino import NetzkinoIE from .nerdcubed import NerdCubedFeedIE +from .nest import NestIE from .neteasemusic import ( NetEaseMusicIE, NetEaseMusicAlbumIE, From 6dcbe07a21f61977b31c78993c280260355c2ff3 Mon Sep 17 00:00:00 2001 From: Evan Zhang Date: Sun, 2 Oct 2022 19:09:13 -0400 Subject: [PATCH 2/2] Fixes #31163 --- youtube_dl/extractor/nest.py | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 youtube_dl/extractor/nest.py diff --git a/youtube_dl/extractor/nest.py b/youtube_dl/extractor/nest.py new file mode 100644 index 000000000..9dff41633 --- /dev/null +++ b/youtube_dl/extractor/nest.py @@ -0,0 +1,39 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class NestIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?video.nest\.com/clip/(?P)(.mp4)?' + _TEST = { + 'url': 'https://video.nest.com/clip/73ddb6bd57c4485597a76e154a4429ea.mp4', + 'md5': '7ab4eb6d4c2480be1740cc014a76ee96', + 'info_dict': { + 'id': '73ddb6bd57c4485597a76e154a4429ea', + 'ext': 'mp4', + 'title': "\"\"", + 'description': '#caughtonNestCam', + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + video_id = self._search_regex( + r'https:\/\/video.nest.com\/clip\/(.+?)(\.|")', webpage, 'video_id', fatal=False) + title = self._html_search_meta(['og:title', 'title'], webpage, 'title') + if title == "": + title = "\"\"" + description = self._html_search_meta(['og:description', 'description'], webpage, 'description') + ext = self._html_search_meta('og:video:type', webpage, 'ext') + if "/" in ext: + ext = ext[ext.index("/") + 1:] + return { + 'url': self._html_search_meta(['og:video:url', 'url'], webpage, 'url'), + 'id': video_id, + 'title': title, + 'description': description, + 'ext': ext, + 'thumbnail': self._html_search_meta(['og:image', 'image'], webpage, 'thumbnail'), + }