home
·
contact
·
privacy
projects
/
ytplom
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d636fc
)
Catch "requested_format" key error in yt_dlp info dicts.
master
author
Christian Heller
<c.heller@plomlompom.de>
Wed, 15 Oct 2025 08:43:07 +0000
(10:43 +0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Wed, 15 Oct 2025 08:43:07 +0000
(10:43 +0200)
src/ytplom/misc.py
patch
|
blob
|
history
diff --git
a/src/ytplom/misc.py
b/src/ytplom/misc.py
index b59ea7f34e1536b127ae885ba0e8e75cbd3921b9..92cd728c9ac2c34a01eea39cf48c9c62abefe486 100644
(file)
--- a/
src/ytplom/misc.py
+++ b/
src/ytplom/misc.py
@@
-940,7
+940,10
@@
class DownloadsManager:
try:
info = ydl.sanitize_info(ydl.extract_info(url,
download=False))
- for f in info['requested_formats']:
+ key_formats = 'requested_formats'
+ if key_formats not in info:
+ raise YoutubeDLError(f'no "{key_formats}" in info')
+ for f in info[key_formats]:
sizes[f[TOK_FO_ID]] = [False, 1]
if TOK_FS_AP in f:
sizes[f[TOK_FO_ID]] = [True, f[TOK_FS_AP]]