def run(self):
song_urls = iter(self.song_urls)
errors = []
with youtube_dl.YoutubeDL(self.opts) as yt:
while not self.is_aborted():
try:
song_url = next(song_urls)
logger.info("Downloading audio/video from {url}".format(url=song_url))
try:
yt.download([song_url])
except youtube_dl.DownloadError:
errors.append(song_url)
self.downloaded += 100
wx.CallAfter(self.parent.download_update, message=self.downloaded)
except StopIteration:
wx.CallAfter(self.parent.download_complete, errors=errors)
break
评论列表
文章目录