mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-02 17:52:19 +00:00
Add default switch for enabling insert_url
This commit is contained in:
3 files changed
+9
-4
No files matched your search
@@ -2,6 +2,7 @@ common:
|
||||
api_mode: false
|
||||
api_access_token: password
|
||||
default_url: []
|
||||
enable_insert: true
|
||||
insert_url: []
|
||||
prepend_insert_url: true
|
||||
exclude_remarks: ["(到期|剩余流量|时间|官网|产品)"]
|
||||
|
||||
+4
-2
@@ -8,9 +8,11 @@ api_access_token=password
|
||||
;Default URLs, used when no URL is provided in request, use "|" to separate multiple subscription links, supports local files/URL
|
||||
default_url=
|
||||
|
||||
;URLs to insert before subscription links, can be used to add node(s) to all exported subscriptions, use "|" to separate multiple subscription links, supports local files/URL
|
||||
;Insert subscription links to requests. Can be used to add node(s) to all exported subscriptions.
|
||||
enable_insert=true
|
||||
;URLs to insert to subscription links, use "|" to separate multiple subscription links, supports local files/URL
|
||||
insert_url=
|
||||
;Prepend inserted URLs to the node list. Nodes in insert_url will be added to groups first with non-group-specific match pattern.
|
||||
;Prepend inserted URLs to subscription links. Nodes in insert_url will be added to groups first with non-group-specific match pattern.
|
||||
prepend_insert_url=true
|
||||
|
||||
;Exclude nodes which remarks match the following patterns. Supports regular expression.
|
||||
|
||||
+4
-2
@@ -48,7 +48,7 @@ std::mutex on_configuring;
|
||||
//preferences
|
||||
string_array renames, emojis;
|
||||
bool add_emoji = false, remove_old_emoji = false, append_proxy_type = false, filter_deprecated = true;
|
||||
tribool udp_flag, tfo_flag, scv_flag;
|
||||
tribool udp_flag, tfo_flag, scv_flag, enable_insert;
|
||||
bool do_sort = false, config_update_strict = false;
|
||||
bool clash_use_new_field_name = false;
|
||||
std::string proxy_config, proxy_ruleset, proxy_subscription;
|
||||
@@ -485,6 +485,7 @@ void readYAMLConf(YAML::Node &node)
|
||||
eraseElements(tempArray);
|
||||
}
|
||||
}
|
||||
enable_insert = safe_as<std::string>(section["enable_insert"]);
|
||||
if(section["insert_url"].IsSequence())
|
||||
{
|
||||
section["insert_url"] >> tempArray;
|
||||
@@ -733,6 +734,7 @@ void readConf()
|
||||
ini.GetBoolIfExist("api_mode", api_mode);
|
||||
ini.GetIfExist("api_access_token", access_token);
|
||||
ini.GetIfExist("default_url", default_url);
|
||||
enable_insert = ini.Get("enable_insert");
|
||||
ini.GetIfExist("insert_url", insert_url);
|
||||
ini.GetBoolIfExist("prepend_insert_url", prepend_insert_url);
|
||||
if(ini.ItemPrefixExist("exclude_remarks"))
|
||||
@@ -1152,7 +1154,7 @@ std::string subconverter(RESPONSE_CALLBACK_ARGS)
|
||||
std::string ext_quan_base = quan_rule_base, ext_quanx_base = quanx_rule_base, ext_loon_base = loon_rule_base, ext_sssub_base = sssub_rule_base;
|
||||
|
||||
//validate urls
|
||||
add_insert.define(true);
|
||||
add_insert.define(enable_insert);
|
||||
if(!url.size() && (!api_mode || authorized))
|
||||
url = default_url;
|
||||
if((!url.size() && !(insert_url.size() && add_insert)) || !target.size())
|
||||
|
||||
Reference in new issue
Block a user