WWBN / AVideo

Create Your Own Broadcast Network With AVideo Platform Open-Source. OAVP OVP
https://avideo.tube/AVideo_OpenSource
Other
1.91k stars 972 forks source link

Feature request: Using IPinfo IP to Country ASN database #9396

Open abdullahdevrel opened 2 months ago

abdullahdevrel commented 2 months ago

I am requesting to add support for IPinfo's IP to Country database to the project. The database has the following features:

Database schema

Field Name Example Data Type Description
start_ip 1.0.16.0 TEXT Starting IP address of an IP address range
end_ip 1.0.31.255 TEXT Ending IP address of an IP address range
country JP TEXT ISO 3166 country code of the location
country_name Japan TEXT Name of the country
continent AS TEXT Continent code of the country
continent_name Asia TEXT Name of the continent
asn AS2519 TEXT Autonomous System Number
as_name ARTERIA Networks Corporation TEXT Name of the AS (Autonomous System) organization
as_domain arteria-net.com TEXT Official domain or website of the AS organization

Documentation: https://ipinfo.io/developers/ip-to-country-asn-database

Samples are available here: https://github.com/ipinfo/sample-database/tree/main/IP%20to%20Country%20ASN

The database can be downloaded simply by accessing the storage URI with an access token.

curl -L https://ipinfo.io/data/free/country_asn.mmdb?token=<YOUR_TOKEN> -o country_asn.mmdb

Let me know what you think. Thanks!

DanielnetoDotCom commented 2 months ago

We already have the ip2location_db

why do I need this?

abdullahdevrel commented 2 months ago

@DanielnetoDotCom The database you are using is a paid database, I believe. However, our database is free, and it comes with full accuracy and daily updates. There is absolutely no compromise on the data accuracy. The only shortcoming is that it does not have city-level granularity.

DanielnetoDotCom commented 2 months ago

I see now, do you have a mysql dump version of it?

mysql query samples?

php code samples?

abdullahdevrel commented 2 months ago

@DanielnetoDotCom Our CSV database can be easily migrated to MySQL, making it not too difficult to transfer your codebase to us. I would recommend taking a look at the database schema here: https://ipinfo.io/developers/ip-to-country-asn-database

The same goes for the PHP code. Your existing code should fundamentally work; you only need to adjust it for the changes in the database schema.

I am curious as to why you are not using the binary file format of the IP database. We provide the 'MMDB' file format, and by using the MMDB reader library, you can make queries extremely fast.