mirror of
https://git.sr.ht/~cadence/NewLeaf
synced 2024-11-14 20:17:29 +00:00
Author banners and thumbnails are optional
This commit is contained in:
parent
e07848788b
commit
4a4f48e9d9
@ -19,10 +19,14 @@ def extract_channel(ucid):
|
|||||||
author = header["title"]
|
author = header["title"]
|
||||||
author_id = header["channelId"]
|
author_id = header["channelId"]
|
||||||
author_url = header["navigationEndpoint"]["commandMetadata"]["webCommandMetadata"]["url"]
|
author_url = header["navigationEndpoint"]["commandMetadata"]["webCommandMetadata"]["url"]
|
||||||
author_banners = header["banner"]["thumbnails"]
|
author_banners = []
|
||||||
for t in author_banners:
|
if "banner" in header:
|
||||||
t["url"] = normalise_url_protocol(t["url"])
|
author_banners = header["banner"]["thumbnails"]
|
||||||
author_thumbnails = generate_full_author_thumbnails(header["avatar"]["thumbnails"])
|
for t in author_banners:
|
||||||
|
t["url"] = normalise_url_protocol(t["url"])
|
||||||
|
author_thumbnails = []
|
||||||
|
if "avatar" in header:
|
||||||
|
author_thumbnails = generate_full_author_thumbnails(header["avatar"]["thumbnails"])
|
||||||
subscriber_count = combine_runs(header["subscriberCountText"])
|
subscriber_count = combine_runs(header["subscriberCountText"])
|
||||||
description = yt_initial_data["metadata"]["channelMetadataRenderer"]["description"]
|
description = yt_initial_data["metadata"]["channelMetadataRenderer"]["description"]
|
||||||
allowed_regions = yt_initial_data["metadata"]["channelMetadataRenderer"]["availableCountryCodes"]
|
allowed_regions = yt_initial_data["metadata"]["channelMetadataRenderer"]["availableCountryCodes"]
|
||||||
|
Loading…
Reference in New Issue
Block a user