From 21c8e276c9006547cc7858da716f7b3628a738c0 Mon Sep 17 00:00:00 2001 From: Terry Geng Date: Sun, 22 Mar 2020 14:50:42 +0800 Subject: [PATCH] fix: error if failed to fetch duration from url --- command.py | 1 - media/url.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/command.py b/command.py index 969644e..54b9e29 100644 --- a/command.py +++ b/command.py @@ -97,7 +97,6 @@ song_shortlist = [] def cmd_joinme(bot, user, text, command, parameter): global log - print(bot.mumble.users[text.actor]['channel_id']) bot.mumble.users.myself.move_in( bot.mumble.users[text.actor]['channel_id'], token=parameter) diff --git a/media/url.py b/media/url.py index f5f4163..80ac818 100644 --- a/media/url.py +++ b/media/url.py @@ -130,6 +130,8 @@ class URLItem(BaseItem): return True except youtube_dl.utils.DownloadError: pass + except KeyError: # info has no 'duration' + break if not succeed: self.ready = 'failed'