1
mirror of https://github.com/mpv-player/mpv synced 2024-11-14 22:48:35 +01:00

ytdl_hook: add a header to support geo-bypass

youtube-dl supports bypassing some geographic restrictions by
setting X-Forwarded-For header when used with geo-bypass and
geo-bypass-country.
This commit is contained in:
Jagannathan Tiruvallur Eachambadi 2017-07-16 14:11:24 +02:00 committed by Ricardo Constantino
parent 572802e866
commit 46bfa3726f
No known key found for this signature in database
GPG Key ID: EFD16019AE4FF531

View File

@ -41,7 +41,7 @@ local function set_http_headers(http_headers)
if useragent and not option_was_set("user-agent") then
mp.set_property("file-local-options/user-agent", useragent)
end
local additional_fields = {"Cookie", "Referer"}
local additional_fields = {"Cookie", "Referer", "X-Forwarded-For"}
for idx, item in pairs(additional_fields) do
local field_value = http_headers[item]
if field_value then