From bb2850ef98528295cd97ad8e9da6751d267926a6 Mon Sep 17 00:00:00 2001 From: knight Date: Fri, 20 Mar 2026 12:01:45 -0400 Subject: [PATCH] Add /channels HTML page and fix placeholder channel names - Add /channels route serving a simple HTML page with channel names linked to their YouTube pages - Fix names for UCehAungJpAeC (Wholly Unfocused) and UCiJmdXTb76i (Bridges of Meaning Hub) from Elasticsearch data Co-Authored-By: Claude Opus 4.6 --- channels.yml | 4 ++-- search_app.py | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/channels.yml b/channels.yml index f103e1c..050bdc5 100644 --- a/channels.yml +++ b/channels.yml @@ -81,7 +81,7 @@ channels: name: TheCommonToad url: https://www.youtube.com/channel/UC-QiBn6GsM3JZJAeAQpaGAA/videos - id: UCiJmdXTb76i8eIPXdJyf8ZQ - name: Channel UCiJmdXTb76i + name: Bridges of Meaning Hub url: https://www.youtube.com/channel/UCiJmdXTb76i8eIPXdJyf8ZQ/videos - id: UCM9Z05vuQhMEwsV03u6DrLA name: Cassidy van der Kamp @@ -264,7 +264,7 @@ channels: name: LeviathanForPlay url: https://www.youtube.com/@LeviathanForPlay/videos - id: UCehAungJpAeC-F3R5FwvvCQ - name: Channel UCehAungJpAeC + name: Wholly Unfocused url: https://www.youtube.com/channel/UCehAungJpAeC-F3R5FwvvCQ/videos - id: UC4YwC5zA9S_2EwthE27Xlew name: Channel UC4YwC5zA9S diff --git a/search_app.py b/search_app.py index e4a7826..3a07f42 100644 --- a/search_app.py +++ b/search_app.py @@ -1309,6 +1309,53 @@ def create_app(config: AppConfig = CONFIG) -> Flask: body = "\n".join(urls) + ("\n" if urls else "") return (body, 200, {"Content-Type": "text/plain; charset=utf-8"}) + @app.route("/channels") + def channels_page(): + try: + entries = load_channel_entries(config.channels_path) + except FileNotFoundError: + return "Channel list not found.", 404 + except Exception: + return "Failed to load channel list.", 500 + + rows = "" + for ch in entries: + name = ch.get("name") or ch.get("handle") or ch.get("id") or "Unknown" + url = ch.get("url", "") + # Link to the channel page, not the /videos tab + channel_url = url.replace("/videos", "") if url.endswith("/videos") else url + name_html = ( + f'{name}' + if channel_url + else name + ) + rows += f"{name_html}\n" + + html = f""" + + + + +Channels - This Little Corner + + + +

Channels

+

{len(entries)} channels tracked

+ +{rows}
+ +""" + return (html, 200, {"Content-Type": "text/html; charset=utf-8"}) + def _rss_target(feed_name: str) -> str: name = (feed_name or "").strip("/") if not name: