Skip to content

Instantly share code, notes, and snippets.

@zhongfly
zhongfly / set_proxy.lua
Last active June 17, 2025 13:40
Get windows system proxy(only support http proxy) and auto set proxy for mpv and ytdl_hook
local mp = require 'mp'
local block = true
function string:trim()
return (self:gsub("^%s*(.-)%s*$", "%1"))
end
-- safe protocol (copied from mpv ytdl_hook.lua)
------------------------------------------------------------------------
local function Set (t)