From 1ac23b7d8ca862293b4df849ae6d9d284e755364 Mon Sep 17 00:00:00 2001 From: Tim Mann Date: Sat, 13 Feb 2021 12:27:22 -0800 Subject: [PATCH] Cleanup for pull request. Both tests still pass, successfully fetching the video and description. --- youtube_dl/extractor/pac12.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/pac12.py b/youtube_dl/extractor/pac12.py index 2a5020106..8b46bdc95 100644 --- a/youtube_dl/extractor/pac12.py +++ b/youtube_dl/extractor/pac12.py @@ -48,10 +48,12 @@ class Pac12IE(InfoExtractor): video_id = self._match_id(vod_url) title = self._html_search_regex(r'(.+?)', webpage, 'title') - description = self._og_search_description(webpage, default=None) \ - or self._search_regex(r'"description":"(?P[^"]+)"', - webpage, 'description', default="") \ - .encode('utf-8').decode('unicode_escape') + description = self._og_search_description(webpage, default=None) + if description == None: + d = self._search_regex(r'"description":"(?P[^"]+)"', + webpage, 'description', default=None) + if d != None: + description = d.encode('utf-8').decode('unicode_escape') return { 'id': video_id, 'title': title,