fix: error if failed to fetch duration from url

This commit is contained in:
Terry Geng 2020-03-22 14:50:42 +08:00
parent 190aac37e1
commit 21c8e276c9
2 changed files with 2 additions and 1 deletions

View File

@ -97,7 +97,6 @@ song_shortlist = []
def cmd_joinme(bot, user, text, command, parameter): def cmd_joinme(bot, user, text, command, parameter):
global log global log
print(bot.mumble.users[text.actor]['channel_id'])
bot.mumble.users.myself.move_in( bot.mumble.users.myself.move_in(
bot.mumble.users[text.actor]['channel_id'], token=parameter) bot.mumble.users[text.actor]['channel_id'], token=parameter)

View File

@ -130,6 +130,8 @@ class URLItem(BaseItem):
return True return True
except youtube_dl.utils.DownloadError: except youtube_dl.utils.DownloadError:
pass pass
except KeyError: # info has no 'duration'
break
if not succeed: if not succeed:
self.ready = 'failed' self.ready = 'failed'