From da896fb0a2fd75b4e62b9bf7b3d1aafa30d33d39 Mon Sep 17 00:00:00 2001 From: "Vadim A. Misbakh-Soloviov" Date: Mon, 27 Sep 2021 22:33:40 +0700 Subject: [PATCH] Adding user-agent to external curl coe branch as per comment --- sponsorblock_minimal.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sponsorblock_minimal.lua b/sponsorblock_minimal.lua index 1c725a2..d6c24a7 100644 --- a/sponsorblock_minimal.lua +++ b/sponsorblock_minimal.lua @@ -25,10 +25,20 @@ function getranges() if not(luacurl_available) then -- if Lua-cURL is not available on this system local curl_cmd = { - "curl", "-L", "-s", "-G", API -- use inoptimal method of calling external cURL command + "curl", + "-L", + "-s", + "-G", + "-A", "mpv_sponsorblock_minimal/0.0.0", + API -- use inoptimal method of calling external cURL command } - local sponsors = mp.command_native({name = "subprocess", capture_stdout = true, playback_only = false, args = curl_cmd}) + local sponsors = mp.command_native{ + name = "subprocess", + capture_stdout = true, + playback_only = false, + args = curl_cmd + } res = sponsors.stdout else -- otherwise use Lua-cURL (binding to libcurl) local buf={}