From 4a6d6025d7ca15fb3bfb57f60dff139c6c2fc469 Mon Sep 17 00:00:00 2001 From: dsc Date: Sat, 2 Sep 2023 21:19:05 +0300 Subject: [PATCH] fix youtube download --- ircradio/youtube.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ircradio/youtube.py b/ircradio/youtube.py index bba5db3..d9bc6c1 100644 --- a/ircradio/youtube.py +++ b/ircradio/youtube.py @@ -80,6 +80,13 @@ class YouTube: from ircradio.factory import app import mutagen + if not filepath.endswith('.ogg'): + filepath = filepath + ".ogg" + + if not os.path.exists(filepath): + app.logger.error(f"path does not exist: {filepath}") + return + try: metadata = mutagen.File(filepath) except Exception as ex: