diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-01-21 13:27:40 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-01-21 13:27:40 +0530 |
commit | e0ddbd02bd1c365b95bb88eaa6e4e0238faf35eb (patch) | |
tree | 8035bea649dee8e517380a8c3d6dc31a0436c2c3 /yt_dlp/extractor/peertube.py | |
parent | 0bfc53d05c7ecd7762313f0cd8578c46cd916519 (diff) |
[cleanup] Use format_field where applicable
Diffstat (limited to 'yt_dlp/extractor/peertube.py')
-rw-r--r-- | yt_dlp/extractor/peertube.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/yt_dlp/extractor/peertube.py b/yt_dlp/extractor/peertube.py index 1e22f24e3..e0b2ab982 100644 --- a/yt_dlp/extractor/peertube.py +++ b/yt_dlp/extractor/peertube.py @@ -7,6 +7,7 @@ import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( + format_field, int_or_none, parse_resolution, str_or_none, @@ -1386,8 +1387,7 @@ class PeerTubePlaylistIE(InfoExtractor): playlist_timestamp = unified_timestamp(info.get('createdAt')) channel = try_get(info, lambda x: x['ownerAccount']['name']) or info.get('displayName') channel_id = try_get(info, lambda x: x['ownerAccount']['id']) or info.get('id') - thumbnail = info.get('thumbnailPath') - thumbnail = f'https://{host}{thumbnail}' if thumbnail else None + thumbnail = format_field(info, 'thumbnailPath', f'https://{host}%s') entries = OnDemandPagedList(functools.partial( self.fetch_page, host, id, type), self._PAGE_SIZE) |