main.py 717 B

12345678910111213141516171819202122232425262728293031
  1. from feed import check_feed
  2. from config import CHANNELS
  3. from menu import show_menu
  4. def start():
  5. channel_titles = []
  6. all_video_links = []
  7. all_video_titles = []
  8. for channel_id in CHANNELS:
  9. feed = check_feed(channel_id)
  10. channel_titles.append(feed["info"]["channel_title"])
  11. links = []
  12. titles = []
  13. for item in feed["videos"]:
  14. links.append(item["link"])
  15. titles.append(item["title"])
  16. all_video_links.append(links)
  17. all_video_titles.append(titles)
  18. show_menu(channel_titles, all_video_titles, all_video_links)
  19. if __name__ == '__main__':
  20. print("Starting the program. Please wait...")
  21. while True:
  22. start()