[dl:http] fail downloads with HTML content (#7697)

add 'validate-html' option
This commit is contained in:
Mike Fährmann
2025-06-20 14:32:44 +02:00
parent e8d28d3d0d
commit dba45923c8
4 changed files with 27 additions and 8 deletions

View File

@@ -6166,6 +6166,20 @@ Description
instead of downloading a potentially broken file.
downloader.http.validate-html
-----------------------------
Type
``bool``
Default
``true``
Description
Check for unexpected HTML responses.
Fail file downloads with a ``text/html``
`Content-Type header <https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type>`__
when expecting a media file instead.
downloader.ytdl.cmdline-args
----------------------------
Type

View File

@@ -1020,7 +1020,8 @@
"headers" : null,
"retry-codes" : [],
"sleep-429" : 60.0,
"validate" : true
"validate" : true,
"validate-html" : true
},
"ytdl":