diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-07 05:17:11 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-07 05:17:11 +0530 |
commit | 51f8a31d651ce7a7850ee5c5eec80a461f3d5ee9 (patch) | |
tree | 19876aa0ecf74521197779674bf6aa42d268026b /yt_dlp/extractor/peertube.py | |
parent | be05d5cff1e39252ca9c30fa5954de8717e1b8ea (diff) |
Update to ytdl-commit-a803582
[peertube] only call description endpoint if necessary
https://github.com/ytdl-org/youtube-dl/commit/a8035827177d6b59aca03bd717acb6a9bdd75ada
Diffstat (limited to 'yt_dlp/extractor/peertube.py')
-rw-r--r-- | yt_dlp/extractor/peertube.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/yt_dlp/extractor/peertube.py b/yt_dlp/extractor/peertube.py index d9b13adc2..3af533925 100644 --- a/yt_dlp/extractor/peertube.py +++ b/yt_dlp/extractor/peertube.py @@ -569,15 +569,15 @@ class PeerTubeIE(InfoExtractor): formats.append(f) self._sort_formats(formats) - full_description = self._call_api( - host, video_id, 'description', note='Downloading description JSON', - fatal=False) + description = video.get('description') + if len(description) >= 250: + # description is shortened + 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 not description: - description = video.get('description') + if isinstance(full_description, dict): + description = str_or_none(full_description.get('description')) or description subtitles = self.extract_subtitles(host, video_id) |