def hook_progress(self, d):
print(d.get("_percent_str"), d.get("_eta_str"), d.get("_speed_str"))
self.load_progress_bar.value = float(_percent_str)
def youtube_dl_download(self):
ydl_opts = {
'store_true': True,
'writeinfojson': True,
'load_info_filename': self.file_path_info_json,
'progress_hooks': [self.hook_progress],
'outtmpl': self.file_path_name,
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([url])
想请教一下如何通过一些程序中断我的下载,或者有没有一些合理的建议或解决办法。这就是我现在想做的。不幸的是,我在 [ https://github.com/ytdl-org/youtube-dl/issues? , https://google.com]