From 204ab98bea93754beef914fe93ee249e346ee628 Mon Sep 17 00:00:00 2001 From: Mole Shang <135e2@135e2.dev> Date: Mon, 7 Aug 2023 22:52:47 +0800 Subject: hinata: support specifying cookies in curl_easy We use tomlc99 to parse strings. To use cookies for higher resolution video downloading, add a config.toml in the executable path. e.g. ```filename: config.toml cookie="SESSDATA=xxx; some_more_cookie=xxx" ``` --- xmake.lua | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'xmake.lua') diff --git a/xmake.lua b/xmake.lua index 98ba483..e287c0b 100644 --- a/xmake.lua +++ b/xmake.lua @@ -2,7 +2,7 @@ add_rules("mode.debug", "mode.release", "mode.releasedbg", "mode.minsizerel") add_requires("nuklear", "nuklear_glfw_gl3", "nuklear_fonts", "glew", "glfw", "tinyfiledialogs", "c11threads", "pcre2", - "cjson", "ffmpeg") + "cjson", "ffmpeg", "tomlc99") add_requires("libcurl", { configs = { zlib = true } }) if is_plat("linux") then @@ -24,7 +24,7 @@ if is_mode("debug") then end add_packages("nuklear", "nuklear_glfw_gl3", "nuklear_fonts", "glew", "glfw", "libcurl", "tinyfiledialogs", "c11threads", "pcre2", - "cjson", "ffmpeg") + "cjson", "ffmpeg", "tomlc99") package("tinyfiledialogs") @@ -142,3 +142,20 @@ end) on_test(function(package) assert(package:has_cfuncs("cJSON_malloc", { includes = "cjson/cJSON.h" })) end) + +package("tomlc99") + +set_homepage("https://github.com/cktan/tomlc99") +set_description("TOML C library ") +set_license("MIT") + +set_urls("https://github.com/cktan/tomlc99.git") + +on_install("linux", "macosx", "windows", "mingw", function(package) + import("package.tools.make").make(package, {}) + import("package.tools.make").make(package, { "install", "prefix = " .. package:installdir() }) +end) + +on_test(function(package) + assert(package:has_cfuncs("toml_parse_file", { includes = "toml.h" })) +end) -- cgit v1.2.3