diff --git a/browser.py b/browser.py index a7cd569..80c2cd8 100755 --- a/browser.py +++ b/browser.py @@ -869,11 +869,10 @@ if __name__ == "__main__": import re cache_file = _HOME / "kiosk-home" / "news-data.json" - # Expanded catalog of highly reliable, 100% paywall-free news sources + # Refined catalog of highly reliable, 100% paywall-free, direct-link news sources world_catalog = [ ("http://feeds.bbci.co.uk/news/world/rss.xml", "BBC News"), - ("https://www.aljazeera.com/xml/rss/all.xml", "Al Jazeera"), - ("https://news.google.com/rss/search?q=source:%22Associated+Press%22", "Associated Press") + ("https://www.aljazeera.com/xml/rss/all.xml", "Al Jazeera") ] national_catalog = [ @@ -925,9 +924,9 @@ if __name__ == "__main__": return "", "" while True: - # Randomly select 2 World feeds and 2 National feeds to harvest - selected_world = random.sample(world_catalog, 2) - selected_national = random.sample(national_catalog, 2) + # Randomly select 2 World feeds and 2 National feeds to harvest (safely capped by catalog size) + selected_world = random.sample(world_catalog, min(len(world_catalog), 2)) + selected_national = random.sample(national_catalog, min(len(national_catalog), 2)) feeds = { "World News": selected_world,