mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 11:31:29 +01:00
simplify function call in traversal
This commit is contained in:
parent
5d01746c4c
commit
1db3eaa77e
|
@ -1,5 +1,3 @@
|
|||
import urllib.parse
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import (
|
||||
get_element_by_id,
|
||||
|
@ -8,6 +6,7 @@
|
|||
mimetype2ext,
|
||||
traverse_obj,
|
||||
url_or_none,
|
||||
urljoin,
|
||||
)
|
||||
|
||||
|
||||
|
@ -147,7 +146,7 @@ def _real_extract(self, url):
|
|||
info_dict.update(**traverse_obj(info, ('included', lambda _, v: v['type'] == 'channel', 'attributes', {
|
||||
'channel': ('username'),
|
||||
'channel_id': ('id'),
|
||||
'channel_url': ('link', {lambda x: urllib.parse.urljoin(url, x)}), # starts with a slash
|
||||
'channel_url': ('link', filter, {urljoin(base=url)}), # starts with a slash
|
||||
'channel_follower_count': ('follower_cnt', {int_or_none}),
|
||||
}), get_all=False))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user