This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH Second] Fix stacktrace on auto-generated "X - Topic" channels without Videos tab

Message ID
DKIM signature
Download raw message
Patch: +1 -1
From: Lomanic <lomanic@hotmail.fr>

See https://second.cadence.moe/api/v1/channels/UCr-iHMODX8D4a6MVQ_RtdQg as an example
 extractors/channel.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extractors/channel.py b/extractors/channel.py
index 787a2ec..bb84cc3 100644
--- a/extractors/channel.py
+++ b/extractors/channel.py
@@ -51,7 +51,7 @@ def extract_channel(ucid):

		latest_videos = []
		tabs = yt_initial_data["contents"]["twoColumnBrowseResultsRenderer"]["tabs"]
		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"), {"content": {"sectionListRenderer": {"contents": [{"itemSectionRenderer": {"contents": [""]}}]}}})
		tab_parts = videos_tab["content"]["sectionListRenderer"]["contents"][0]["itemSectionRenderer"]["contents"][0]

		# check that the channel actually has videos - this may be replaced
Message ID
<161263930770.15985.8336044797103459040-0@git.sr.ht> (view parent)
DKIM signature
Download raw message
Hardcoding a JSON object in here looked like code smell, so I fixed
the core issue using different code in commit
c8b46999222cad3ffb76862474d1e127125ffac6. Thanks for bringing it to my
attention, though!
Reply to thread Export thread (mbox)