1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-27 10:03:32 +00:00

ytdl_hook.lua: lower case URLs for exclude matching

This commit is contained in:
Guido Cella 2024-10-06 23:19:41 +02:00 committed by Kacper Michajłow
parent 28a4e19a67
commit 92403a068c
2 changed files with 3 additions and 1 deletions

View File

@ -907,6 +907,8 @@ Program Behavior
should use ``%`` before any of the characters ``^$()%|,.[]*+-?`` to
match that character.
URLs are converted to lower case before matching.
.. admonition:: Examples
- ``--script-opts=ytdl_hook-exclude='^youtube%.com'``

View File

@ -291,7 +291,7 @@ local function is_blacklisted(url)
end
end
if #ytdl.blacklisted > 0 then
url = url:match('https?://(.+)')
url = url:match('https?://(.+)'):lower()
for _, exclude in ipairs(ytdl.blacklisted) do
if url:match(exclude) then
msg.verbose('URL matches excluded substring. Skipping.')