We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 270acf0 commit a46109dCopy full SHA for a46109d
format.sh
@@ -18,9 +18,10 @@ fi
18
# 使用tr将逗号替换为换行符,然后使用grep和sed来处理文件
19
# - 使用grep -oP 来匹配以http://, https://, udp://, wss://开头并且以/announce结尾的内容
20
# - 不进行贪婪匹配
21
-# - 去除每行末尾的所有空格或制表符
+# - 使用sed来省略默认端口
22
tr ',' '\n' < "$input_file" | \
23
grep -oP '(http|https|udp|wss)://[^/]+/announce' | \
24
+sed -E 's#(http://[^/]+):80/announce#\1/announce#; s#(https://[^/]+):443/announce#\1/announce#' | \
25
sed 's/[ \t]*$//' > "$output_file"
26
27
echo "Formatted trackers have been saved to $output_file"
0 commit comments