From f5e049fbc28a6d1957b68f72b9b55b3b94f193ce Mon Sep 17 00:00:00 2001 From: Tim Mann Date: Sat, 30 Jan 2021 21:42:31 -0800 Subject: [PATCH] Add a test for a page that doesn't contain manifest_url itself, but does contain an embed/vod-XXXXXXXX url for a page that does contain manifest_url. This test currently fails because the description on the inner page isn't in the OpenGraph format. --- youtube_dl/extractor/pac12.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/pac12.py b/youtube_dl/extractor/pac12.py index 5106901b3..004165d72 100644 --- a/youtube_dl/extractor/pac12.py +++ b/youtube_dl/extractor/pac12.py @@ -9,7 +9,7 @@ from .common import InfoExtractor class Pac12IE(InfoExtractor): _VALID_URL = r'https?://(?:[a-z]+\.)?pac-12.com/(?:embed/)?(?P.*)' - _TEST = { + _TESTS = [{ 'url': 'https://pac-12.com/videos/2020-pac-12-womens-basketball-media-day-arizona-cal-stanford', 'md5': 'b2e3c0cb99458c8b8e2dc22cb5ac922d', 'info_dict': { @@ -18,7 +18,16 @@ class Pac12IE(InfoExtractor): 'title': '2020 Pac-12 Women\'s Basketball Media Day - Arizona, Cal & Stanford | Pac-12', 'description': 'During the 2020 Pac-12 Women\'s Basketball Media Day, Ros Gold-Onwude moderates a discussion with Arizona\'s Adia Barnes & Aari McDonald, Cal\'s Charmin Smith & Evelien Lutje Schipholt & Stanford\'s Tara VanDerveer & Kiana Williams.', } - } + }, { + 'url': 'https://pac-12.com/article/2020/11/24/sonoran-dog-dish-presented-tums', + 'md5': 'a7a8ac72273b9468924bc058cc220d37', + 'info_dict': { + 'id': 'vod-YLMKpNLZvR0', + 'ext': 'mp4', + 'title': 'Sonoran Dog | The Dish, presented by TUMS | Pac-12', + 'description': 'Pac-12 Networks introduces "The Dish," presented by Tums. Jaymee Sire is bringing fans a closeup to game day treats from around the Conference with each treat connecting to a Pac-12 school, bringing the flavor and recipes fans know and love right to the dish! As Arizona and USC basketball seasons tip off, the first feature item from "The Dish" is the Sonoran Dog, a beloved treat by Trojans & Wildcat fans.', + } + }] def _real_extract(self, url): video_id = self._match_id(url) @@ -35,7 +44,7 @@ class Pac12IE(InfoExtractor): return None return self.url_result(vod_url) video_url = re.sub(r'\\', '', video_url) - title = self._html_search_regex(r'(.+?)', + title = self._html_search_regex(r'(.+?)', webpage, 'title') if 'vod-' not in url and vod_url is not None: video_id = self._match_id(vod_url)