Skip to content

Commit

Permalink
Update format.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
adysec authored Oct 26, 2024
1 parent 270acf0 commit a46109d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ fi
# 使用tr将逗号替换为换行符,然后使用grep和sed来处理文件
# - 使用grep -oP 来匹配以http://, https://, udp://, wss://开头并且以/announce结尾的内容
# - 不进行贪婪匹配
# - 去除每行末尾的所有空格或制表符
# - 使用sed来省略默认端口
tr ',' '\n' < "$input_file" | \
grep -oP '(http|https|udp|wss)://[^/]+/announce' | \
sed -E 's#(http://[^/]+):80/announce#\1/announce#; s#(https://[^/]+):443/announce#\1/announce#' | \
sed 's/[ \t]*$//' > "$output_file"

echo "Formatted trackers have been saved to $output_file"

0 comments on commit a46109d

Please sign in to comment.