mirror of
https://git.sr.ht/~cadence/NewLeaf
synced 2024-11-21 23:27:29 +00:00
Touch up Bopol's patch
This commit is contained in:
parent
6cc921c2dc
commit
f1ddf66f50
@ -22,7 +22,7 @@ def extract_channel(ucid):
|
||||
r.raise_for_status()
|
||||
yt_initial_data = extract_yt_initial_data(r.content.decode("utf8"))
|
||||
|
||||
header = yt_initial_data["header"]["c4TabbedHeaderRenderer"] if "c4TabbedHeaderRenderer" in yt_initial_data["header"] else []
|
||||
header = yt_initial_data["header"]["c4TabbedHeaderRenderer"] if "c4TabbedHeaderRenderer" in yt_initial_data["header"] else {}
|
||||
channel_metadata = yt_initial_data["metadata"]["channelMetadataRenderer"]
|
||||
|
||||
if header:
|
||||
@ -45,10 +45,9 @@ def extract_channel(ucid):
|
||||
t["url"] = normalise_url_protocol(t["url"])
|
||||
|
||||
author_thumbnails = []
|
||||
if "avatar" in header:
|
||||
author_thumbnails = generate_full_author_thumbnails(header["avatar"]["thumbnails"])
|
||||
elif "avatar" in channel_metadata:
|
||||
author_thumbnails = generate_full_author_thumbnails(channel_metadata["avatar"]["thumbnails"])
|
||||
avatar = header.get("avatar") or channel_metadata.get("avatar")
|
||||
if avatar:
|
||||
author_thumbnails = generate_full_author_thumbnails(avatar["thumbnails"])
|
||||
|
||||
latest_videos = []
|
||||
tabs = yt_initial_data["contents"]["twoColumnBrowseResultsRenderer"]["tabs"]
|
||||
|
Loading…
Reference in New Issue
Block a user