There are two largely separate parts – querying the torrent tracker for the seeders IP, and reverse-geocoding the IP addresses to determine the country.
The reverse-geocoding part is a common thing, and easily done. This question lists several options, and this one is similar, but specifically for PHP
The torrent-tracker-querying part is a bit more complicated, due to the various types of torrent trackers. This question explains what you need to do
1
solved Get current seeder’s IP addresses of a torrent using PHP [closed]