Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
creates a blocklist for your p2p endeavors
#!/usr/bin/env sh
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2020 glaszig <glaszig@gmail.com>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
# inspired by https://gist.github.com/johntyree/3331662#gistcomment-1968023
#
# usage:
# UA="user agent string" mkp2pblocklist > /tmp/blockp2p.list
# or
# UA="user agent string" mkp2pblocklist | gzip -9 > /tmp/blockp2p.list.gz
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH"
if [ -z "$UA" ]; then
echo "User Agent environment variable UA missing."
echo "See, e.g., https://user-agents.net/browsers for examples."
exit 1
fi
curl -A "$UA" -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=p2p.*\)'.*/\1/p" \
| xargs curl -A "$UA" -sL \
| gunzip \
| egrep -v '^#' \
| uniq
@MusicaBoludeces

This comment has been minimized.

Copy link

@MusicaBoludeces MusicaBoludeces commented Jun 15, 2017

I am using your blocklist "https://silo.glasz.org/antip2p.list.gz" in transmission, thank you!

wondering if you can share details on what is included in the blocklist?

@acsfer

This comment has been minimized.

Copy link

@acsfer acsfer commented Aug 20, 2017

Alternative URL, updated hourly:

http://o2php53.odns.fr/block.list.gz

@Globulopolis

This comment has been minimized.

Copy link

@Globulopolis Globulopolis commented Oct 29, 2017

Can anyone do an alternative list in dat format to using in utorrent?

@AnonymousAnonymousAnonymous

This comment has been minimized.

Copy link

@AnonymousAnonymousAnonymous AnonymousAnonymousAnonymous commented Jan 20, 2018

appreciate the blocklist! thx

@glaszig

This comment has been minimized.

Copy link
Owner Author

@glaszig glaszig commented Mar 27, 2020

updated the script to fake its user agent since iblocklist is blocking curl.
PLEASE USE YOUR OWN USER AGENT STRING, supply it with an env var, e.g., UA='custom ua string' mkp2pblocklist.
choose any from this list: https://user-agents.net/browsers

@jerkstore369: also fixed, long ago actually.

@jsotiriou

This comment has been minimized.

Copy link

@jsotiriou jsotiriou commented Apr 5, 2020

many thx for the update

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