Skip to content

Instantly share code, notes, and snippets.

@Hexhu
Last active October 21, 2019 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hexhu/79e6a5473b88da9d2c36e9a033724358 to your computer and use it in GitHub Desktop.
Save Hexhu/79e6a5473b88da9d2c36e9a033724358 to your computer and use it in GitHub Desktop.
Turn all trackers in github.com/ngosang/trackerslist into magnet URI
curl -L https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt 2>/dev/null |
sed -e 's/:/%3A/g; s/\//%2F/g;' |
tr '\n' '_' |
sed -e 's/__*/\&tr=/g; s/^/\&tr=/; s/\&tr=$/\n/'
@Hexhu
Copy link
Author

Hexhu commented Oct 21, 2019

If no escaping is required, but the URI needs to be in a comma-separated list:

curl -L https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt 2>/dev/null |
tr '\n' '_' |
sed -e 's/__*/,/g; s/,$/\n/'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment