Browse Source

Debugging why live broadcasts aren't showing as live

main
fluffy 5 months ago
parent
commit
c58c249bee
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      beatbot.py

+ 3
- 2
beatbot.py View File

@@ -35,12 +35,13 @@ def format_details(yt_id, snippet):
text = f'https://youtube.com/watch?v={yt_id}'

try:
if snippet['liveBroadcastContent'] == 'live':
LOGGER.info("snippet: %s", snippet)
if 'liveBroadcastContent' in snippet and snippet['liveBroadcastContent'] == 'live':
duration = ' (LIVE)'
else:
duration = ''
details = youtube.get_details(yt_id)
if details:
if details and 'duration' in details:
delta = isodate.parse_duration(details['duration'])
hours, rem = divmod(delta.seconds, 3600)
minutes, seconds = divmod(rem, 60)


Loading…
Cancel
Save