mondern slopify hand crafted code for the greater good.

(move from user specified blocklist download URLs to simply country codes with multiple providers available.)
This commit is contained in:
2026-05-01 17:18:50 -06:00
parent 746bb9c8b4
commit b1ed8f75ec
10 changed files with 576 additions and 105 deletions

24
provider_ipdeny.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"fmt"
"strings"
)
const ipdenyBaseURL = "https://www.ipdeny.com/ipblocks/data/aggregated"
// IPDenyProvider fetches GeoIP data from ipdeny.com.
// IPDeny provides aggregated country-level IP blocks derived from RIR data.
// Website: https://www.ipdeny.com/ipblocks/
type IPDenyProvider struct{}
func (p *IPDenyProvider) Name() string {
return "ipdeny"
}
// FetchCIDRs downloads IPv4 CIDR blocks for a country from ipdeny.
// URL format: https://www.ipdeny.com/ipblocks/data/aggregated/{cc}-aggregated.zone
func (p *IPDenyProvider) FetchCIDRs(countryCode string) ([]string, error) {
url := fmt.Sprintf("%s/%s-aggregated.zone", ipdenyBaseURL, strings.ToLower(countryCode))
return downloadAndParseCIDRs(url)
}