We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subconverter v0.8.1-885a63b backend
将规则文件转换为 Surge DOMAIN-SET
getruleset?type=3&url=aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2JsYWNrbWF0cml4Ny9pb3NfcnVsZV9zY3JpcHQvbWFzdGVyL3J1bGUvQ2xhc2gvQWR2ZXJ0aXNpbmdMaXRlL0FkdmVydGlzaW5nTGl0ZS5saXN0
DOMAIN-SET:专为大量域名集列表文件设计,支持上万条记录的快速查询。文件中每行为一个域名,如果某行以 . 开头则表示匹配所有子域名和该域名本身。可用于广告过滤。
由官方文件可知,当规则是 DOMAIN-SUFFIX 的时候,应该以 . 开头;那么当规则是 DOMAIN 的时候,才是直接以域名开头。
定位代码:
https://raw.githubusercontent.com/tindy2013/subconverter/885a63b83778fbcf85765d10ec94ea06b9ca72da/src/handler/interfaces.cpp 的 242 行至249行,修改一下即可。
case 5: if(!startsWith(strLine, "DOMAIN-SUFFIX,") && !startsWith(strLine, "DOMAIN,")) continue; if(filterLine()) continue; output_content += strLine.substr(posb, pose); output_content += '\n'; continue;
以个人的代码水平修改如下:
case 5: if(!startsWith(strLine, "DOMAIN-SUFFIX,") && !startsWith(strLine, "DOMAIN,")) continue; if(filterLine()) continue; if(strLine[posb - 2] == 'X') output_content += "."; output_content += strLine.substr(posb, pose); output_content += "'\n"; continue;
当规则是 DOMAIN-SUFFIX 的时候,应该以 . 开头;那么当规则是 DOMAIN 的时候,以域名开头
不论是 DOMAIN-SUFFIX 还是 DOMAIN,转换后的规则都是以域名开头。
No response
The text was updated successfully, but these errors were encountered:
Enhancements
05a542c
Fix bad conversion of DOMAIN-SUFFIX rules when generating Surge DOMAIN-SET. (#667) Optimize codes.
Fixed in 05a542c
Sorry, something went wrong.
d3802bb
Fix bad conversion of DOMAIN-SUFFIX rules when generating Surge DOMAIN-SET. (tindy2013#667) Optimize codes.
No branches or pull requests
确认版本最新
检索issue
subconverter版本
subconverter v0.8.1-885a63b backend
转换过程
将规则文件转换为 Surge DOMAIN-SET
转换设置
getruleset?type=3&url=aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2JsYWNrbWF0cml4Ny9pb3NfcnVsZV9zY3JpcHQvbWFzdGVyL3J1bGUvQ2xhc2gvQWR2ZXJ0aXNpbmdMaXRlL0FkdmVydGlzaW5nTGl0ZS5saXN0
复现步骤
DOMAIN-SET:专为大量域名集列表文件设计,支持上万条记录的快速查询。文件中每行为一个域名,如果某行以 . 开头则表示匹配所有子域名和该域名本身。可用于广告过滤。
由官方文件可知,当规则是 DOMAIN-SUFFIX 的时候,应该以 . 开头;那么当规则是 DOMAIN 的时候,才是直接以域名开头。
定位代码:
https://raw.githubusercontent.com/tindy2013/subconverter/885a63b83778fbcf85765d10ec94ea06b9ca72da/src/handler/interfaces.cpp 的 242 行至249行,修改一下即可。
case 5:
if(!startsWith(strLine, "DOMAIN-SUFFIX,") && !startsWith(strLine, "DOMAIN,"))
continue;
if(filterLine())
continue;
output_content += strLine.substr(posb, pose);
output_content += '\n';
continue;
以个人的代码水平修改如下:
case 5:
if(!startsWith(strLine, "DOMAIN-SUFFIX,") && !startsWith(strLine, "DOMAIN,"))
continue;
if(filterLine())
continue;
if(strLine[posb - 2] == 'X')
output_content += ".";
output_content += strLine.substr(posb, pose);
output_content += "'\n";
continue;
期望结果
当规则是 DOMAIN-SUFFIX 的时候,应该以 . 开头;那么当规则是 DOMAIN 的时候,以域名开头
实际结果
不论是 DOMAIN-SUFFIX 还是 DOMAIN,转换后的规则都是以域名开头。
错误信息
No response
The text was updated successfully, but these errors were encountered: