mirror of
https://git.sr.ht/~cadence/NewLeaf
synced 2024-11-21 23:27:29 +00:00
Support topic channels with no videos tab
https://second.cadence.moe/api/v1/channels/UCr-iHMODX8D4a6MVQ_RtdQg
This commit is contained in:
parent
80b41c7725
commit
c8b4699922
@ -51,8 +51,11 @@ def extract_channel(ucid):
|
|||||||
|
|
||||||
latest_videos = []
|
latest_videos = []
|
||||||
tabs = yt_initial_data["contents"]["twoColumnBrowseResultsRenderer"]["tabs"]
|
tabs = yt_initial_data["contents"]["twoColumnBrowseResultsRenderer"]["tabs"]
|
||||||
|
try:
|
||||||
videos_tab = next(tab["tabRenderer"] for tab in tabs if tab["tabRenderer"]["title"] == "Videos")
|
videos_tab = next(tab["tabRenderer"] for tab in tabs if tab["tabRenderer"]["title"] == "Videos")
|
||||||
tab_parts = videos_tab["content"]["sectionListRenderer"]["contents"][0]["itemSectionRenderer"]["contents"][0]
|
tab_parts = videos_tab["content"]["sectionListRenderer"]["contents"][0]["itemSectionRenderer"]["contents"][0]
|
||||||
|
except StopIteration:
|
||||||
|
tab_parts = {}
|
||||||
|
|
||||||
# check that the channel actually has videos - this may be replaced
|
# check that the channel actually has videos - this may be replaced
|
||||||
# with messageRenderer.text.simpleText == "This channel has no videos."
|
# with messageRenderer.text.simpleText == "This channel has no videos."
|
||||||
|
Loading…
Reference in New Issue
Block a user