1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 08:35:32 +00:00

[cleanup] Use format_field where applicable

This commit is contained in:
pukkandan
2022-01-21 13:27:40 +05:30
parent 0bfc53d05c
commit e0ddbd02bd
26 changed files with 59 additions and 52 deletions

View File

@ -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)