From d14745983d22758be330556c553bc3a073c81814 Mon Sep 17 00:00:00 2001 From: Laura Liberda Date: Sun, 24 Jan 2021 06:13:30 +0100 Subject: [PATCH] [peertube] reduce request amount if webpage downloaded --- haruhi_dl/extractor/peertube.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/haruhi_dl/extractor/peertube.py b/haruhi_dl/extractor/peertube.py index e2912b44e..f89ccda7f 100644 --- a/haruhi_dl/extractor/peertube.py +++ b/haruhi_dl/extractor/peertube.py @@ -135,13 +135,15 @@ class PeerTubeSHIE(SelfhostedInfoExtractor): formats.append(f) self._sort_formats(formats) - full_description = self._call_api( - host, video_id, 'description', note='Downloading description JSON', - fatal=False) - description = None - if isinstance(full_description, dict): - description = str_or_none(full_description.get('description')) + if webpage: + description = self._og_search_description(webpage) + if not description: + full_description = self._call_api( + host, video_id, 'description', note='Downloading description JSON', + fatal=False) + if isinstance(full_description, dict): + description = str_or_none(full_description.get('description')) if not description: description = video.get('description')