From c7bab7c39fd51c0812f70020172766303191bc01 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 19:37:42 +0200 Subject: Adding upstream version 2023.03.04. Signed-off-by: Daniel Baumann --- yt_dlp/extractor/hgtv.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 yt_dlp/extractor/hgtv.py (limited to 'yt_dlp/extractor/hgtv.py') diff --git a/yt_dlp/extractor/hgtv.py b/yt_dlp/extractor/hgtv.py new file mode 100644 index 0000000..c40017d --- /dev/null +++ b/yt_dlp/extractor/hgtv.py @@ -0,0 +1,37 @@ +from .common import InfoExtractor + + +class HGTVComShowIE(InfoExtractor): + IE_NAME = 'hgtv.com:show' + _VALID_URL = r'https?://(?:www\.)?hgtv\.com/shows/[^/]+/(?P[^/?#&]+)' + _TESTS = [{ + # data-module="video" + 'url': 'http://www.hgtv.com/shows/flip-or-flop/flip-or-flop-full-episodes-season-4-videos', + 'info_dict': { + 'id': 'flip-or-flop-full-episodes-season-4-videos', + 'title': 'Flip or Flop Full Episodes', + }, + 'playlist_mincount': 15, + }, { + # data-deferred-module="video" + 'url': 'http://www.hgtv.com/shows/good-bones/episodes/an-old-victorian-house-gets-a-new-facelift', + 'only_matching': True, + }] + + def _real_extract(self, url): + display_id = self._match_id(url) + + webpage = self._download_webpage(url, display_id) + + config = self._parse_json( + self._search_regex( + r'(?s)data-(?:deferred-)?module=["\']video["\'][^>]*>.*?]+type=["\']text/x-config["\'][^>]*>(.+?)