Browse Source

If duration is 0:00 assume it's live

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

+ 3
- 1
beatbot.py View File

@@ -49,8 +49,10 @@ def format_details(yt_id, snippet):
minutes, seconds = divmod(rem, 60)
if hours:
duration = f' ({hours:d}:{minutes:02d}:{seconds:02d})'
else:
elif minutes or seconds:
duration = f' ({minutes:d}:{seconds:02d})'
else:
duration = ' (LIVE)'
text += f' — {html.unescape(snippet["title"])}{duration}'
except RuntimeError:
LOGGER.exception("Unable to get video details")


Loading…
Cancel
Save