-
-
Save Brianetta/7887502 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Place this file somewhere that Squid can find it, and change access | |
# so that Squid can read and execute it. | |
# Include the following line in squid.conf, and un-comment it there. If | |
# you saved it anywhere other than /etc/squid, change the path to its | |
# correct location: | |
#url_rewrite_program /etc/squid/rewrite.pl | |
# Restart Squid, and in your XBMC's Settings/Internet Settings give your | |
# squid server's name and port as the proxy to use. | |
# Change this line to your preferred mirror. It replaces mirrors.xbmc.org in the URL. | |
$mirror = "www.mirrorservice.org/sites/mirrors.xbmc.org"; | |
$| = 1; | |
while (<>) { | |
@line = split; | |
$_ = $line[0]; | |
if (m/^http:\/\/(mirrors\.xbmc\.org)\/(.*)/) { | |
print "http://" . $mirror . "/" . $2 . "\n"; | |
} else { | |
print $_ . "\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment