Full Code of xykt/IPQuality for AI

main f2c83eb12673 cached
16 files
968.3 KB
370.4k tokens
1 requests
Download .txt
Showing preview only (994K chars total). Download the full file or copy to clipboard to get everything.
Repository: xykt/IPQuality
Branch: main
Commit: f2c83eb12673
Files: 16
Total size: 968.3 KB

Directory structure:
gitextract_n772nbuf/

├── .github/
│   └── FUNDING.yml
├── LICENSE
├── README.md
├── README_EN.md
├── ip.sh
├── ref/
│   ├── ad1.ans
│   ├── ad2.ans
│   ├── ad3.ans
│   ├── ad4.ans
│   ├── cookies.txt
│   ├── dnsbl.list
│   ├── iata-icao.csv
│   ├── iso3166.json
│   ├── sponsor.ans
│   └── upgrade_bash.sh
└── res/
    └── output.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

github: xykt # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
# ko_fi: # Replace with a single Ko-fi username
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
# liberapay: # Replace with a single Liberapay username
# issuehunt: # Replace with a single IssueHunt username
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
# polar: # Replace with a single Polar username
# buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
# thanks_dev: # Replace with a single thanks.dev username
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']


================================================
FILE: LICENSE
================================================
                    GNU AFFERO GENERAL PUBLIC LICENSE
                       Version 3, 19 November 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.

  A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate.  Many developers of free software are heartened and
encouraged by the resulting cooperation.  However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.

  The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community.  It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server.  Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.

  An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals.  This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU Affero General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Remote Network Interaction; Use with the GNU General Public License.

  Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software.  This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time.  Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published
    by the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source.  For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code.  There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.


================================================
FILE: README.md
================================================
<p align="center">
<img src="https://hits.xykt.de/ip.svg?action=view&count_bg=%2379C83D&title_bg=%23555555&title=Runs&edge_flat=false"/> 
<img src="https://hits.xykt.de/ip_github.svg?action=hit&count_bg=%233DC8C0&title_bg=%23555555&title=Visits&edge_flat=false"/> 
<a href="/LICENSE"><img src="https://img.shields.io/badge/License-AGPL%20v3-blue.svg" alt="license" /></a>  
</p>

## IP质量体检脚本  -  [IP Quality Check Script (EN)](https://github.com/xykt/IPQuality/blob/main/README_EN.md)

**支持OS/Platform:Ubuntu | Debian | Linux Mint | Fedora | Red Hat Enterprise Linux (RHEL) | CentOS | Arch Linux | Manjaro | Alpine Linux | AlmaLinux | Rocky Linux | macOS | Anolis OS | Alibaba Cloud Linux | SUSE Linux | openSUSE | Void Linux | Windows (via Docker)**

- 中英文双语言支持
- 支持IPv4/IPv6双栈查询
- 精美排版,直观显示,多终端单屏优化展示,便于截图分享
- 基础信息、IP类型、风险评分、风险因子、流媒体解锁、邮局检测六大模块
- 基础数据源自*Maxmind*数据库
- 风险信息 *IPinfo / ipregistry / ipapi / AbuseIPDB / IP2Location / IPQS / DB-IP / Scamalytics* 多数据库整合
- 流媒体及AI多个服务商 *TikTok / Disney+ / Netflix / Youtube / AmazonPrimeVideo / Reddit / ChatGPT* 解锁及解锁类型检测
- 多邮局服务商 *Gmail / Outlook / Yahoo / Apple / QQ / Mail.ru / AOL / GMX / Mail.com / 163 / Sohu / Sina* 连通性检测
- IP地址黑名单400+数据库检测

##### 屏幕截图
![截图](https://raw.githubusercontent.com/xykt/IPQuality/main/res/cn_IPv4.svg)

## 使用方法

### 便捷模式:交互界面

![Net](https://github.com/xykt/ScriptMenu/raw/main/res/IP_CN.png)

##### Bash:
````bash
bash <(curl -Ls https://Check.Place) -I
````

##### Docker:
- Linux
````bash
docker run --rm --net=host -it xykt/check -I && docker rmi xykt/check > /dev/null 2>&1
````

- Windows (CMD)
````bash
docker run --rm --net=host -it xykt/check -I & docker rmi xykt/check > NUL 2>&1
````

### 高级模式:参数运行

![Help](https://github.com/xykt/IPQuality/raw/main/res/help.png)

##### 默认双栈检测:
````bash
bash <(curl -Ls https://IP.Check.Place)
````

##### 只检测IPv4结果:
````bash
bash <(curl -Ls https://IP.Check.Place) -4
````

##### 只检测IPv6结果:
````bash
bash <(curl -Ls https://IP.Check.Place) -6
````

##### 指定检测网卡:
````bash
bash <(curl -Ls https://IP.Check.Place) -i eth0
````

##### 指定代理服务器:
````bash
bash <(curl -Ls https://IP.Check.Place) -x http://username:password@proxyserver:port
bash <(curl -Ls https://IP.Check.Place) -x https://username:password@proxyserver:port
bash <(curl -Ls https://IP.Check.Place) -x socks5://username:password@socksproxy:port
````

##### 选择脚本语言为英文(任选其一):
````bash
bash <(curl -Ls https://IP.Check.Place) -E
bash <(curl -Ls https://IP.Check.Place) -l en
````

##### 跳过检测系统及安装依赖:
````bash
bash <(curl -Ls https://IP.Check.Place) -n
````

##### 自动安装依赖:
````bash
bash <(curl -Ls https://IP.Check.Place) -y
````

##### 报告展示完整IP地址:
````bash
bash <(curl -Ls https://IP.Check.Place) -f
````

##### 输出JSON结果([输出示例](https://github.com/xykt/IPQuality/blob/main/res/output.json)):
````bash
bash <(curl -Ls https://IP.Check.Place) -j
````

##### 输出报告ANSI/JSON/纯文本至文件:
````bash
bash <(curl -Ls https://IP.Check.Place) -o /path/to/file.ansi
bash <(curl -Ls https://IP.Check.Place) -o /path/to/file.json
bash <(curl -Ls https://IP.Check.Place) -o /path/to/file.txtoranyother
````

##### 基础信息多语言支持:
````bash
bash <(curl -Ls https://IP.Check.Place) -l jp|es|de|fr|ru|pt
````

##### 隐私模式——禁用在线报告生成功能:
````bash
bash <(curl -Ls https://IP.Check.Place) -p
````

##### Docker(支持运行参数,须在```&```前插入):
- Linux
````bash
docker run --rm --net=host -it xykt/ipquality && docker rmi xykt/ipquality > /dev/null 2>&1
````

- Windows (CMD)
````cmd
docker run --rm --net=host -it xykt/ipquality & docker rmi xykt/ipquality > NUL 2>&1
````

## 脚本更新

2026/01/24 12:40 将Spotify检测替换为Reddit检测

2026/01/15 17:23 修正不规范的JSON

2025/08/03 00:00 增加Docker运行方式

2025/08/01 16:15 增加-p隐私模式,禁用在线报告生成功能

2025/07/30 16:30 将所有HTTP请求替换为HTTPS以提升脚本安全性

2025/06/02 21:25 修复25端口检测的错误逻辑,规范化邮件服务商连通性检测方法

2025/04/23 18:00 增加-o输出报告ANSI/JSON/纯文本至文件

2025/04/19 21:00 增加-j的JSON输出模式

2025/03/13 23:15 增加-y自动安装依赖,-n跳过操作系统及依赖检查

2024/11/09 00:30 增加Cloudflare风险评分,修复IP2Location偶发IP类型判断BUG

2024/10/06 01:15 修复极个别运行脚本报错问题

2024/07/23 23:50 增加运行参数-f使报告显示完整IP地址

2024/07/22 01:50 安装依赖包前增加询问,修复Disney+解锁类型错误

2024/06/27 01:00 增加Anolis OS | Alibaba Cloud Linux | SUSE Linux | openSUSE系统支持

2024/05/30 01:15 增加macOS系统支持

2024/05/28 18:00 修复了指定网卡/代理服务器仍然检测默认IP的bug

2024/05/17 00:45 增加报告svg图片分享链接,修复一些排版问题

2024/05/11 23:20 修复因网关阻断25端口导致的邮件检测时间过长的问题,修复Tiktok IPv6结果不准确的bug

2024/05/10 17:50 修复未安装sudo系统无法正常安装依赖的bug

2024/05/10 11:00 增加指定网卡及代理服务器检测支持

2024/05/09 15:00 修正不规范内网IP导致的错误,修正其他若干bug

2024/05/08 23:00 修正Netflix澳洲检测结果不正确的bug

2024/05/08 18:10 更新依赖程序dig检测及安装

2024/05/08 00:00 脚本发布

## 脚本贡献

**Acknowledgments:**

| 赞助商 | 商标 | 网址 | 
| - | - | - | 
| IP2Location | ![ip2location_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_ip2location.png) | [https://ip2location.io](https://ip2location.io)</br>[https://ip2location.com](https://ip2location.com) | 
| Scamalytics | ![scamalytics_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_scamalytics.png) | [https://scamalytics.com](https://scamalytics.com) | 

- 衷心感谢主流IP风险数据库[AbuseIPDB](https://www.abuseipdb.com/)/[Cloudflare](https://cloudflare.com/)/[DB-IP](https://db-ip.com/)/[IP2Location](https://www.ip2location.io/)/[ipapi](https://ipapi.is/)/[IPinfo](https://ipinfo.io/)/[IPQS](https://www.ipqualityscore.com/)/[ipregistry](https://ipregistry.co/)/[Scamalytics](https://scamalytics.com/)提供的风险数据(排名不分先后)

- 感谢[lmc999](https://github.com/lmc999/RegionRestrictionCheck),本脚本局部代码参考原版流媒体解锁检测脚本

- 感谢[spiritLHLS](https://github.com/spiritLHLS/ecs),本脚本局部代码参考融合怪测评脚本

**服务器赞助商(排名不分先后)**

| 赞助商 | 商标 | 网址 | 
| - | - | - | 
| V.PS | ![vps_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_vps.png) | [https://v.ps](https://v.ps)| 
| BAGE | ![bage_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_bage.png) | [https://bagevm.com](https://bagevm.com)|
| LisaHost</br>丽萨主机 | ![lisa_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_lisa.png) | [https://lisahost.com](https://lisahost.com)|
| VIRCS</br>威尔克斯 | ![vircs_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_vircs.png) | [https://vircs.com](https://www.vircs.com/promotion?code=6)|   
| RapidProxy</br>`原生IP` | ![rapidproxy_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_rapidproxy.png) | [https://rapidproxy.io](https://www.rapidproxy.io/?ref=gitipquality)|   
| 华纳云</br>HNCloud | ![hncloud_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_hncloud.png) | [https://hncloud.com](https://www.hncloud.com/activity/activity_2026spring.html/?g=nodequality)| 

##### *E-Mail: sponsor@check.place Telegram Bot: https://t.me/xythebot*
**仅接受长期稳定运营,信誉良好的商家*

**Stars History:**

![Stargazers over time](https://starchart.cc/xykt/IPQuality.svg?background=%23FFFFFF&axis=%23333333&line=%2377ff77)

**Daily Runs History:**

![daily_runs_history](https://hits.xykt.de/history/ip.svg?days=46&chartType=bar&title=IP%E8%B4%A8%E9%87%8F%E4%BD%93%E6%A3%80%E8%84%9A%E6%9C%AC%E6%AF%8F%E6%97%A5%E8%BF%90%E8%A1%8C%E9%87%8F%E7%BB%9F%E8%AE%A1&width=1024&height=400&color=green)


================================================
FILE: README_EN.md
================================================
<p align="center">
<img src="https://hits.xykt.de/ip.svg?action=view&count_bg=%2379C83D&title_bg=%23555555&title=Runs&edge_flat=false"/> 
<img src="https://hits.xykt.de/ip_github.svg?action=hit&count_bg=%233DC8C0&title_bg=%23555555&title=Visits&edge_flat=false"/> 
<a href="/LICENSE"><img src="https://img.shields.io/badge/License-AGPL%20v3-blue.svg" alt="license" /></a>  
</p>

## IP Quality Check Script  -  [IP质量体检脚本 (中文)](https://github.com/xykt/IPQuality/blob/main/README.md)

**Supported OS/Platform: Ubuntu | Debian | Linux Mint | Fedora | Red Hat Enterprise Linux (RHEL) | CentOS | Arch Linux | Manjaro | Alpine Linux | AlmaLinux | Rocky Linux | macOS | Anolis OS | Alibaba Cloud Linux | SUSE Linux | openSUSE | Void Linux | Windows (via Docker)**

- Bilingual support in English and Chinese
- Supports dual-stack queries for IPv4/IPv6
- Beautifully formatted, intuitive display, optimized for single-screen multi-terminal display, facilitating screenshot sharing
- Six modules: Basic Information, IP Type, Risk Score, Risk Factors, Streaming Media Unlocking, and Post Office Check
- Basic data sourced from the *Maxmind* database
- Risk information integrated from multiple databases: *IPinfo / ipregistry / ipapi / AbuseIPDB / IP2Location / IPQS / DB-IP / Scamalytics*
- Streaming and AI service providers' unlocking and type detection: *TikTok / Disney+ / Netflix / Youtube / AmazonPrimeVideo / Reddit / ChatGPT*
- Connectivity tests for multiple email providers: *Gmail / Outlook / Yahoo / Apple / QQ / Mail.ru / AOL / GMX / Mail.com / 163 / Sohu / Sina*
- Over 400 IP address blacklist database checks

##### Screenshots
![Screenshot](https://raw.githubusercontent.com/xykt/IPQuality/main/res/en_IPv4.svg)

## Usage

### Easy Mode: Run with Interactive Interface

![Net](https://github.com/xykt/ScriptMenu/raw/main/res/IP_EN.png)

##### Bash:
````bash
bash <(curl -Ls https://Check.Place) -EI
````

##### Docker:
- Linux
````bash
docker run --rm --net=host -it xykt/check -EI && docker rmi xykt/check > /dev/null 2>&1
````

- Windows (CMD)
````bash
docker run --rm --net=host -it xykt/check -EI & docker rmi xykt/check > NUL 2>&1
````

### Advanced Mode: Run with Parameters

![Help](https://github.com/xykt/IPQuality/raw/main/res/help.png)

##### English version of dual-stack test (Either):
````bash
bash <(curl -Ls https://IP.Check.Place) -E
bash <(curl -Ls https://IP.Check.Place) -l en
````

##### IPv4 only test:
````bash
bash <(curl -Ls https://IP.Check.Place) -E4
````

##### IPv6 only test:
````bash
bash <(curl -Ls https://IP.Check.Place) -E6
````

##### Specify network interface:
````bash
bash <(curl -Ls https://IP.Check.Place) -E -i eth0
````

##### Specify proxy server:
````bash
bash <(curl -Ls https://IP.Check.Place) -E -x http://username:password@proxyserver:port
bash <(curl -Ls https://IP.Check.Place) -E -x https://username:password@proxyserver:port
bash <(curl -Ls https://IP.Check.Place) -E -x socks5://username:password@socksproxy:port
````

##### Skip checking OS and dependencies:

```bash
bash <(curl -Ls https://IP.Check.Place) -En
```

##### Auto-install dependencies:

```bash
bash <(curl -Ls https://IP.Check.Place) -Ey
```

##### Show full IP on report:
````bash
bash <(curl -Ls https://IP.Check.Place) -Ef
````

##### JSON output ([Example Output](https://github.com/xykt/IPQuality/blob/main/res/output.json)):
````bash
bash <(curl -Ls https://IP.Check.Place) -Ej
````

##### Output report to file in ANSI/JSON/Text format:
````bash
bash <(curl -Ls https://IP.Check.Place) -o /path/to/file.ansi
bash <(curl -Ls https://IP.Check.Place) -o /path/to/file.json
bash <(curl -Ls https://IP.Check.Place) -o /path/to/file.txtoranyother
````

##### Basic information multi-language support:
````bash
bash <(curl -Ls https://IP.Check.Place) -l jp|es|de|fr|ru|pt
````

##### Privacy mode - Disable online report link:
````bash
bash <(curl -Ls https://IP.Check.Place) -Ep
````

##### Docker (supports runtime arguments; insert them before the ```&```):
- Linux
````bash
docker run --rm --net=host -it xykt/ipquality -E && docker rmi xykt/ipquality > /dev/null 2>&1
````

- Windows (CMD)
````bash
docker run --rm --net=host -it xykt/ipquality -E & docker rmi xykt/ipquality > NUL 2>&1
````

## Script Updates

2026/01/24 12:40 Replace Spotify detection with Reddit detection

2026/01/15 17:23 Fix non-standard JSON

2025/08/03 00:00 Add Docker support

2025/08/01 16:15 Add -p for privacy mode, which disables online report links

2025/07/30 16:30 Replace all HTTP requests with HTTPS to improve script security

2025/06/02 21:25 Fix the error logic in port 25 detection and standardize the connectivity testing method for email service providers

2025/04/23 18:00 Add -o to output report to file in ANSI/JSON/Text format

2025/04/19 21:00 Add -j for JSON mode

2025/03/13 23:15 Add -y -n for dependencies auto-install/skip

2024/11/09 00:30 Add Cloudflare threat score, fix IP2Location IP type bug

2024/10/06 01:15 Fixed bug causing script errors in very rare cases

2024/07/23 23:50 Add parameter -f to show full IP address on report

2024/07/22 01:50 Add prompt before installing dependent packages, fix Disney+ bug

2024/06/27 01:00 Add Anolis OS | Alibaba Cloud Linux | SUSE Linux | openSUSE support

2024/05/30 01:15 Add macOS support

2024/05/28 18:00 Fixed bug where default IP was detected for specified network interface/proxy server

2024/05/17 00:45 Add report svg image sharing link and fix some layout problems

2024/05/11 23:20 Fixed mail detection taking too long due to gateway blocking port 25, fix inaccurate Tiktok IPv6 results

2024/05/10 17:50 Fix dependency installation issue with no sudo installed

2024/05/10 11:00 Added support for specified network interface and proxy server

2024/05/09 15:00 Corrected errors caused by non-standard private IP addresses, and fixed several other bugs

2024/05/08 23:00 Fixed a bug affecting incorrect detection results for Netflix Australia

2024/05/08 18:10 Updated the dependency checks and installation for the 'dig' program

2024/05/08 00:00 Script published

## Script Contributions

**Acknowledgments:**

| Sponsor | Logo | Link | 
| - | - | - | 
| IP2Location | ![ip2location_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_ip2location.png) | [https://ip2location.io](https://ip2location.io)</br>[https://ip2location.com](https://ip2location.com) | 
| Scamalytics | ![scamalytics_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_scamalytics.png) | [https://scamalytics.com](https://scamalytics.com) | 

- Sincerely appreciate the IP threat intelligence data provided by leading providers (No ranking implied, listed in alphabetical order): [AbuseIPDB](https://www.abuseipdb.com/)/[Cloudflare](https://cloudflare.com/)/[DB-IP](https://db-ip.com/)/[IP2Location](https://www.ip2location.io/)/[ipapi](https://ipapi.is/)/[IPinfo](https://ipinfo.io/)/[IPQS](https://www.ipqualityscore.com/)/[ipregistry](https://ipregistry.co/)/[Scamalytics](https://scamalytics.com/) 

- Thanks to [lmc999](https://github.com/lmc999/RegionRestrictionCheck) for parts of this script reference the RegionRestrictionCheck script.

- Thanks to [spiritLHLS](https://github.com/spiritLHLS/ecs) for parts of this script reference the VPS Fusion Monster Server Test Script.

**Server Sponsors​ *(No ranking implied)*:**

| Sponsor | Logo | Link | 
| - | - | - |
| V.PS | ![vps_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_vps.png) | [https://v.ps](https://v.ps)| 
| BAGE | ![bage_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_bage.png) | [https://bagevm.com](https://bagevm.com)|
| LisaHost</br>丽萨主机 | ![lisa_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_lisa.png) | [https://lisahost.com](https://lisahost.com)|
| VIRCS</br>威尔克斯 | ![vircs_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_vircs.png) | [https://vircs.com](https://www.vircs.com/promotion?code=6)|   
| RapidProxy</br>`ISP IP` | ![rapidproxy_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_rapidproxy.png) | [https://rapidproxy.io](https://www.rapidproxy.io/?ref=gitipquality)|   
| HNCloud</br>华纳云 | ![hncloud_logo](https://raw.githubusercontent.com/xykt/IPQuality/main/res/sponsor/logo_hncloud.png) | [https://hncloud.com](https://www.hncloud.com/activity/activity_2026spring.html/?g=nodequality)| 

##### *E-Mail: sponsor@check.place Telegram Bot: https://t.me/xythebot*
**Only accepting merchants with long-term stable operations and good reputation*

**Stars History:**

![Stargazers over time](https://starchart.cc/xykt/IPQuality.svg?background=%23FFFFFF&axis=%23333333&line=%2377dd77)

**Daily Runs History:**

![daily_runs_history](https://hits.xykt.de/history/ip.svg?days=46&chartType=bar&title=Daily%20Runs%20of%20Network%20Quality%20Script&width=1024&height=400&color=green)


================================================
FILE: ip.sh
================================================
#!/bin/bash
script_version="v2026-03-13"
check_bash(){
current_bash_version=$(bash --version|head -n 1|awk -F ' ' '{for (i=1; i<=NF; i++) if ($i ~ /^[0-9]+\.[0-9]+\.[0-9]+/) {print $i; exit}}'|cut -d . -f 1)
if [ "$current_bash_version" = "0" ]||[ "$current_bash_version" = "1" ]||[ "$current_bash_version" = "2" ]||[ "$current_bash_version" = "3" ];then
echo "ERROR: Bash version is lower than 4.0!"
echo "Tips: Run the following script to automatically upgrade Bash."
echo "bash <(curl -sL https://raw.githubusercontent.com/xykt/IPQuality/main/ref/upgrade_bash.sh)"
exit 0
fi
}
check_bash
Font_B="\033[1m"
Font_D="\033[2m"
Font_I="\033[3m"
Font_U="\033[4m"
Font_Black="\033[30m"
Font_Red="\033[31m"
Font_Green="\033[32m"
Font_Yellow="\033[33m"
Font_Blue="\033[34m"
Font_Purple="\033[35m"
Font_Cyan="\033[36m"
Font_White="\033[37m"
Back_Black="\033[40m"
Back_Red="\033[41m"
Back_Green="\033[42m"
Back_Yellow="\033[43m"
Back_Blue="\033[44m"
Back_Purple="\033[45m"
Back_Cyan="\033[46m"
Back_White="\033[47m"
Font_Suffix="\033[0m"
Font_LineClear="\033[2K"
Font_LineUp="\033[1A"
declare ADLines
declare -A aad
declare IP=""
declare IPhide
declare fullIP=0
declare YY="cn"
declare -A maxmind
declare -A ipinfo
declare -A scamalytics
declare -A ipregistry
declare -A ipapi
declare -A abuseipdb
declare -A ip2location
declare -A dbip
declare -A ipdata
declare -A ipqs
declare -A tiktok
declare -A disney
declare -A netflix
declare -A youtube
declare -A amazon
declare -A reddit
declare -A chatgpt
declare IPV4
declare IPV6
declare IPV4check=1
declare IPV6check=1
declare IPV4work=0
declare IPV6work=0
declare ERRORcode=0
declare shelp
declare -A swarn
declare -A sinfo
declare -A shead
declare -A sbasic
declare -A stype
declare -A sscore
declare -A sfactor
declare -A smedia
declare -A smail
declare -A smailstatus
declare -A stail
declare mode_no=0
declare mode_yes=0
declare mode_lite=0
declare mode_json=0
declare mode_menu=0
declare mode_output=0
declare mode_privacy=0
declare ipjson
declare ibar=0
declare bar_pid
declare ibar_step=0
declare main_pid=$$
declare PADDING=""
declare useNIC=""
declare usePROXY=""
declare CurlARG=""
declare UA_Browser
declare rawgithub
declare Media_Cookie
declare IATA_Database
shelp_lines=(
"IP QUALITY CHECK SCRIPT IP质量体检脚本"
"Interactive Interface:  bash <(curl -sL https://IP.Check.Place) -EM"
"交互界面:              bash <(curl -sL https://IP.Check.Place) -M"
"Parameters 参数运行: bash <(curl -sL https://IP.Check.Place) [-4] [-6] [-f] [-h] [-i iface] [-j] [-l language] [-n] [-o outputpath] [-p] [-x proxy] [-y] [-E] [-M]"
"            -4                             Test IPv4                                  测试IPv4"
"            -6                             Test IPv6                                  测试IPv6"
"            -f                             Show full IP on reports                    报告展示完整IP地址"
"            -h                             Help information                           帮助信息"
"            -i eth0                        Specify network interface                  指定检测网卡"
"               ipaddress                   Specify outbound IP Address                指定检测出口IP"
"            -j                             JSON output                                JSON输出"
"            -l cn|en|jp|es|de|fr|ru|pt     Specify script language                    指定报告语言"
"            -n                             No OS or dependencies check                跳过系统检测及依赖安装"
"            -o /path/to/file.ansi          Output ANSI report to file                 输出ANSI报告至文件"
"               /path/to/file.json          Output JSON result to file                 输出JSON结果至文件"
"               /path/to/file.anyother      Output plain text report to file           输出纯文本报告至文件"
"            -p                             Privacy mode - no generate report link     隐私模式:不生成报告链接"
"            -x http://usr:pwd@proxyurl:p   Specify http proxy                         指定http代理"
"               https://usr:pwd@proxyurl:p  Specify https proxy                        指定https代理"
"               socks5://usr:pwd@proxyurl:p Specify socks5 proxy                       指定socks5代理"
"            -y                             Install dependencies without interupt      自动安装依赖"
"            -E                             Specify English Output                     指定英文输出"
"            -M                             Run with Interactive Interface             交互界面方式运行")
shelp=$(printf "%s\n" "${shelp_lines[@]}")
set_language(){
case "$YY" in
"en"|"jp"|"es"|"de"|"fr"|"ru"|"pt")swarn[1]="ERROR: Unsupported parameters!"
swarn[2]="ERROR: IP address format error!"
swarn[3]="ERROR: Dependent programs are missing. Please run as root or install sudo!"
swarn[4]="ERROR: Parameter -4 conflicts with -i or -6!"
swarn[6]="ERROR: Parameter -6 conflicts with -i or -4!"
swarn[7]="ERROR: The specified network interface or outbound IP is invalid or does not exist!"
swarn[8]="ERROR: The specified proxy parameter is invalid or not working!"
swarn[10]="ERROR: Output file already exist!"
swarn[11]="ERROR: Output file is not writable!"
swarn[40]="ERROR: IPv4 is not available!"
swarn[60]="ERROR: IPv6 is not available!"
sinfo[database]="Checking IP database "
sinfo[media]="Checking stream media "
sinfo[ai]="Checking AI provider "
sinfo[mail]="Connecting Email server "
sinfo[dnsbl]="Checking Blacklist database "
sinfo[ldatabase]=21
sinfo[lmedia]=22
sinfo[lai]=21
sinfo[lmail]=24
sinfo[ldnsbl]=28
shead[title]="IP QUALITY CHECK REPORT: "
shead[title_lite]="IP QUALITY CHECK REPORT(LITE): "
shead[ver]="Version: $script_version"
shead[bash]="bash <(curl -sL https://Check.Place) -EI"
shead[git]="https://github.com/xykt/IPQuality"
shead[time_raw]=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
shead[time]="Report Time: ${shead[time_raw]}"
shead[ltitle]=25
shead[ltitle_lite]=31
shead[ptime]=$(printf '%7s' '')
sbasic[title]="1. Basic Information (${Font_I}Maxmind Database$Font_Suffix)"
sbasic[title_lite]="1. Basic Information (${Font_I}IPinfo Database$Font_Suffix)"
sbasic[asn]="ASN:                    "
sbasic[noasn]="Not Assigned"
sbasic[org]="Organization:           "
sbasic[location]="Location:               "
sbasic[map]="Map:                    "
sbasic[city]="City:                   "
sbasic[country]="Actual Region:          "
sbasic[regcountry]="Registered Region:      "
sbasic[continent]="Continent:              "
sbasic[timezone]="Time Zone:              "
sbasic[type]="IP Type:                "
sbasic[type0]=" Geo-consistent "
sbasic[type1]=" Geo-discrepant "
stype[business]=" $Back_Yellow$Font_White$Font_B Business $Font_Suffix "
stype[isp]="   $Back_Green$Font_White$Font_B ISP $Font_Suffix    "
stype[hosting]=" $Back_Red$Font_White$Font_B Hosting $Font_Suffix  "
stype[education]="$Back_Yellow$Font_White$Font_B Education $Font_Suffix "
stype[government]="$Back_Yellow$Font_White$Font_B Government $Font_Suffix"
stype[banking]=" $Back_Yellow$Font_White$Font_B Banking $Font_Suffix  "
stype[organization]="$Back_Yellow$Font_White${Font_B}Organization$Font_Suffix"
stype[military]=" $Back_Yellow$Font_White$Font_B Military $Font_Suffix "
stype[library]=" $Back_Yellow$Font_White$Font_B Library $Font_Suffix  "
stype[cdn]="   $Back_Red$Font_White$Font_B CDN $Font_Suffix    "
stype[lineisp]=" $Back_Green$Font_White$Font_B Line ISP $Font_Suffix "
stype[mobile]="$Back_Green$Font_White$Font_B Mobile ISP $Font_Suffix"
stype[spider]="$Back_Red$Font_White$Font_B Web Spider $Font_Suffix"
stype[reserved]=" $Back_Yellow$Font_White$Font_B Reserved $Font_Suffix "
stype[other]="  $Back_Yellow$Font_White$Font_B Other $Font_Suffix   "
stype[title]="2. IP Type"
stype[db]="Database:  "
stype[usetype]="Usage:     "
stype[comtype]="Company:   "
sscore[verylow]="$Font_Green${Font_B}VeryLow$Font_Suffix"
sscore[low]="$Font_Green${Font_B}Low$Font_Suffix"
sscore[medium]="$Font_Yellow${Font_B}Medium$Font_Suffix"
sscore[high]="$Font_Red${Font_B}High$Font_Suffix"
sscore[veryhigh]="$Font_Red${Font_B}VeryHigh$Font_Suffix"
sscore[elevated]="$Font_Yellow${Font_B}Elevated$Font_Suffix"
sscore[suspicious]="$Font_Yellow${Font_B}Suspicious$Font_Suffix"
sscore[risky]="$Font_Red${Font_B}Risky$Font_Suffix"
sscore[highrisk]="$Font_Red${Font_B}HighRisk$Font_Suffix"
sscore[dos]="$Font_Red${Font_B}DoS$Font_Suffix"
sscore[colon]=": "
sscore[title]="3. Risk Score"
sscore[range]="${Font_Cyan}Levels:         $Font_I$Font_White${Back_Green}VeryLow     Low $Back_Yellow     Medium     $Back_Red High   VeryHigh$Font_Suffix"
sfactor[title]="4. Risk Factors"
sfactor[factor]="DB:  "
sfactor[countrycode]="Region: "
sfactor[proxy]="Proxy:  "
sfactor[tor]="Tor:    "
sfactor[vpn]="VPN:    "
sfactor[server]="Server: "
sfactor[abuser]="Abuser: "
sfactor[robot]="Robot:  "
sfactor[yes]="$Font_Red$Font_B Yes$Font_Suffix"
sfactor[no]="$Font_Green$Font_B No $Font_Suffix"
sfactor[na]="$Font_Green$Font_B N/A$Font_Suffix"
smedia[yes]="  $Back_Green$Font_White Yes $Font_Suffix  "
smedia[no]=" $Back_Red$Font_White Block $Font_Suffix "
smedia[bad]="$Back_Red$Font_White Failed $Font_Suffix "
smedia[pending]="$Back_Yellow$Font_White Pending $Font_Suffix"
smedia[cn]=" $Back_Red$Font_White China $Font_Suffix "
smedia[noprem]="$Back_Red$Font_White NoPrem. $Font_Suffix"
smedia[org]="$Back_Yellow$Font_White NF.Only $Font_Suffix"
smedia[web]="$Back_Yellow$Font_White WebOnly $Font_Suffix"
smedia[app]="$Back_Yellow$Font_White APPOnly $Font_Suffix"
smedia[idc]="  $Back_Yellow$Font_White IDC $Font_Suffix  "
smedia[native]="$Back_Green$Font_White Native $Font_Suffix "
smedia[dns]="$Back_Yellow$Font_White ViaDNS $Font_Suffix "
smedia[nodata]="         "
smedia[title]="5. Accessibility check for media and AI services"
smedia[meida]="Service: "
smedia[status]="Status:  "
smedia[region]="Region:  "
smedia[type]="Type:    "
smail[title]="6. Email service availability and blacklist detection"
smail[port]="Local Port 25 Outbound: "
smail[yes]="${Font_Green}Available$Font_Suffix"
smail[no]="${Font_Red}Blocked$Font_Suffix"
smail[occupied]="${Font_Yellow}Occupied$Font_Suffix"
smail[blocked]="${Font_Red}Remote Port 25 unreachable​$Font_Suffix"
smail[provider]="Conn: "
smail[dnsbl]="DNSBL database: "
smail[available]="$Font_Suffix${Font_Cyan}Active $Font_B"
smail[clean]="$Font_Suffix${Font_Green}Clean $Font_B"
smail[marked]="$Font_Suffix${Font_Yellow}Marked $Font_B"
smail[blacklisted]="$Font_Suffix${Font_Red}Blacklisted $Font_B"
stail[stoday]="IP Checks Today: "
stail[stotal]="; Total: "
stail[thanks]=". Thanks for running xy scripts!"
stail[link]="${Font_I}Report Link: $Font_U"
;;
"cn")swarn[1]="错误:不支持的参数!"
swarn[2]="错误:IP地址格式错误!"
swarn[3]="错误:未安装依赖程序,请以root执行此脚本,或者安装sudo命令!"
swarn[4]="错误:参数-4与-i/-6冲突!"
swarn[6]="错误:参数-6与-i/-4冲突!"
swarn[7]="错误:指定的网卡或出口IP不存在!"
swarn[8]="错误:指定的代理服务器不可用!"
swarn[10]="错误:输出文件已存在!"
swarn[11]="错误:输出文件不可写!"
swarn[40]="错误:IPV4不可用!"
swarn[60]="错误:IPV6不可用!"
sinfo[database]="正在检测IP数据库 "
sinfo[media]="正在检测流媒体服务商 "
sinfo[ai]="正在检测AI服务商 "
sinfo[mail]="正在连接邮件服务商 "
sinfo[dnsbl]="正在检测黑名单数据库 "
sinfo[ldatabase]=17
sinfo[lmedia]=21
sinfo[lai]=17
sinfo[lmail]=19
sinfo[ldnsbl]=21
shead[title]="IP质量体检报告:"
shead[title_lite]="IP质量体检报告(Lite):"
shead[ver]="脚本版本:$script_version"
shead[bash]="bash <(curl -sL https://Check.Place) -I"
shead[git]="https://github.com/xykt/IPQuality"
shead[time_raw]=$(TZ="Asia/Shanghai" date +"%Y-%m-%d %H:%M:%S CST")
shead[time]="报告时间:${shead[time_raw]}"
shead[ltitle]=16
shead[ltitle_lite]=22
shead[ptime]=$(printf '%8s' '')
sbasic[title]="一、基础信息(${Font_I}Maxmind 数据库$Font_Suffix)"
sbasic[title_lite]="一、基础信息(${Font_I}IPinfo 数据库$Font_Suffix)"
sbasic[asn]="自治系统号:            "
sbasic[noasn]="未分配"
sbasic[org]="组织:                  "
sbasic[location]="坐标:                  "
sbasic[map]="地图:                  "
sbasic[city]="城市:                  "
sbasic[country]="使用地:                "
sbasic[regcountry]="注册地:                "
sbasic[continent]="洲际:                  "
sbasic[timezone]="时区:                  "
sbasic[type]="IP类型:                "
sbasic[type0]=" 原生IP "
sbasic[type1]=" 广播IP "
stype[business]="   $Back_Yellow$Font_White$Font_B 商业 $Font_Suffix   "
stype[isp]="   $Back_Green$Font_White$Font_B 家宽 $Font_Suffix   "
stype[hosting]="   $Back_Red$Font_White$Font_B 机房 $Font_Suffix   "
stype[education]="   $Back_Yellow$Font_White$Font_B 教育 $Font_Suffix   "
stype[government]="   $Back_Yellow$Font_White$Font_B 政府 $Font_Suffix   "
stype[banking]="   $Back_Yellow$Font_White$Font_B 银行 $Font_Suffix   "
stype[organization]="   $Back_Yellow$Font_White$Font_B 组织 $Font_Suffix   "
stype[military]="   $Back_Yellow$Font_White$Font_B 军队 $Font_Suffix   "
stype[library]="  $Back_Yellow$Font_White$Font_B 图书馆 $Font_Suffix  "
stype[cdn]="   $Back_Red$Font_White$Font_B CDN $Font_Suffix    "
stype[lineisp]="   $Back_Green$Font_White$Font_B 家宽 $Font_Suffix   "
stype[mobile]="   $Back_Green$Font_White$Font_B 手机 $Font_Suffix   "
stype[spider]="   $Back_Red$Font_White$Font_B 蜘蛛 $Font_Suffix   "
stype[reserved]="   $Back_Yellow$Font_White$Font_B 保留 $Font_Suffix   "
stype[other]="   $Back_Yellow$Font_White$Font_B 其他 $Font_Suffix   "
stype[title]="二、IP类型属性"
stype[db]="数据库:   "
stype[usetype]="使用类型: "
stype[comtype]="公司类型: "
sscore[verylow]="$Font_Green$Font_B极低风险$Font_Suffix"
sscore[low]="$Font_Green$Font_B低风险$Font_Suffix"
sscore[medium]="$Font_Yellow$Font_B中风险$Font_Suffix"
sscore[high]="$Font_Red$Font_B高风险$Font_Suffix"
sscore[veryhigh]="$Font_Red$Font_B极高风险$Font_Suffix"
sscore[elevated]="$Font_Yellow$Font_B较高风险$Font_Suffix"
sscore[suspicious]="$Font_Yellow$Font_B可疑IP$Font_Suffix"
sscore[risky]="$Font_Red$Font_B存在风险$Font_Suffix"
sscore[highrisk]="$Font_Red$Font_B高风险$Font_Suffix"
sscore[dos]="$Font_Red$Font_B建议封禁$Font_Suffix"
sscore[colon]=":"
sscore[title]="三、风险评分"
sscore[range]="$Font_Cyan风险等级:      $Font_I$Font_White$Back_Green极低         低 $Back_Yellow      中等      $Back_Red 高         极高$Font_Suffix"
sfactor[title]="四、风险因子"
sfactor[factor]="库: "
sfactor[countrycode]="地区:  "
sfactor[proxy]="代理:  "
sfactor[tor]="Tor:   "
sfactor[vpn]="VPN:   "
sfactor[server]="服务器:"
sfactor[abuser]="滥用:  "
sfactor[robot]="机器人:"
sfactor[yes]="$Font_Red$Font_B 是 $Font_Suffix"
sfactor[no]="$Font_Green$Font_B 否 $Font_Suffix"
sfactor[na]="$Font_Green$Font_B 无 $Font_Suffix"
smedia[yes]=" $Back_Green$Font_White 解锁 $Font_Suffix  "
smedia[no]=" $Back_Red$Font_White 屏蔽 $Font_Suffix  "
smedia[bad]=" $Back_Red$Font_White 失败 $Font_Suffix  "
smedia[pending]="$Back_Yellow$Font_White 待支持 $Font_Suffix "
smedia[cn]=" $Back_Red$Font_White 中国 $Font_Suffix  "
smedia[noprem]="$Back_Red$Font_White 禁会员 $Font_Suffix "
smedia[org]="$Back_Yellow$Font_White 仅自制 $Font_Suffix "
smedia[web]="$Back_Yellow$Font_White 仅网页 $Font_Suffix "
smedia[app]=" $Back_Yellow$Font_White 仅APP $Font_Suffix "
smedia[idc]=" $Back_Yellow$Font_White 机房 $Font_Suffix  "
smedia[native]=" $Back_Green$Font_White 原生 $Font_Suffix  "
smedia[dns]="  $Back_Yellow$Font_White DNS $Font_Suffix  "
smedia[nodata]="         "
smedia[title]="五、流媒体及AI服务解锁检测"
smedia[meida]="服务商: "
smedia[status]="状态:   "
smedia[region]="地区:   "
smedia[type]="方式:   "
smail[title]="六、邮局连通性及黑名单检测"
smail[port]="本地25端口出站:"
smail[yes]="$Font_Green可用$Font_Suffix"
smail[no]="$Font_Red阻断$Font_Suffix"
smail[occupied]="$Font_Yellow占用$Font_Suffix"
smail[blocked]="$Font_Red远端25端口不可达​$Font_Suffix"
smail[provider]="通信:"
smail[dnsbl]="IP地址黑名单数据库:"
smail[available]="$Font_Suffix$Font_Cyan有效 $Font_B"
smail[clean]="$Font_Suffix$Font_Green正常 $Font_B"
smail[marked]="$Font_Suffix$Font_Yellow已标记 $Font_B"
smail[blacklisted]="$Font_Suffix$Font_Red黑名单 $Font_B"
stail[stoday]="今日IP检测量:"
stail[stotal]=";总检测量:"
stail[thanks]="。感谢使用xy系列脚本!"
stail[link]="$Font_I报告链接:$Font_U"
;;
*)echo -ne "ERROR: Language not supported!"
esac
}
countRunTimes(){
local RunTimes=$(curl $CurlARG -s --max-time 10 "https://hits.xykt.de/ip?action=hit" 2>&1)
stail[today]=$(echo "$RunTimes"|jq '.daily')
stail[total]=$(echo "$RunTimes"|jq '.total')
}
show_progress_bar(){
show_progress_bar_ "$@" 1>&2
}
show_progress_bar_(){
local bar="\u280B\u2819\u2839\u2838\u283C\u2834\u2826\u2827\u2807\u280F"
local n=${#bar}
while sleep 0.1;do
if ! kill -0 $main_pid 2>/dev/null;then
echo -ne ""
exit
fi
echo -ne "\r$Font_Cyan$Font_B[$IP]# $1$Font_Cyan$Font_B$(printf '%*s' "$2" ''|tr ' ' '.') ${bar:ibar++*6%n:6} $(printf '%02d%%' $ibar_step) $Font_Suffix"
done
}
kill_progress_bar(){
kill "$bar_pid" 2>/dev/null&&echo -ne "\r"
}
install_dependencies(){
if ! jq --version >/dev/null 2>&1||! curl --version >/dev/null 2>&1||! bc --version >/dev/null 2>&1||! nc -h >/dev/null 2>&1||! dig -v >/dev/null 2>&1;then
echo "Detecting operating system..."
if [ "$(uname)" == "Darwin" ];then
install_packages "brew" "brew install" "no_sudo"
elif [ -f /etc/os-release ];then
. /etc/os-release
if [ $(id -u) -ne 0 ]&&! sudo -v >/dev/null 2>&1;then
ERRORcode=3
fi
case $ID in
ubuntu|debian|linuxmint)install_packages "apt" "apt-get install -y"
;;
rhel|centos|almalinux|rocky|anolis)if
[ "$(echo $VERSION_ID|cut -d '.' -f1)" -ge 8 ]
then
install_packages "dnf" "dnf install -y"
else
install_packages "yum" "yum install -y"
fi
;;
arch|manjaro)install_packages "pacman" "pacman -S --noconfirm"
;;
alpine)install_packages "apk" "apk add"
;;
fedora)install_packages "dnf" "dnf install -y"
;;
alinux)install_packages "yum" "yum install -y"
;;
suse|opensuse*)install_packages "zypper" "zypper install -y"
;;
void)install_packages "xbps" "xbps-install -Sy"
;;
*)echo "Unsupported distribution: $ID"
exit 1
esac
elif [ -n "$PREFIX" ];then
install_packages "pkg" "pkg install"
else
echo "Cannot detect distribution because /etc/os-release is missing."
exit 1
fi
fi
}
install_packages(){
local package_manager=$1
local install_command=$2
local no_sudo=$3
echo "Using package manager: $package_manager"
echo -e "Lacking necessary dependencies, $Font_I${Font_Cyan}jq curl bc netcat dnsutils iproute$Font_Suffix will be installed using $Font_I$Font_Cyan$package_manager$Font_Suffix."
if [[ $mode_yes -eq 0 ]];then
prompt=$(printf "Continue? (${Font_Green}y$Font_Suffix/${Font_Red}n$Font_Suffix): ")
read -p "$prompt" choice
case "$choice" in
y|Y|yes|Yes|YES)echo "Continue to execute script..."
;;
n|N|no|No|NO)echo "Script exited."
exit 0
;;
*)echo "Invalid input, script exited."
exit 1
esac
else
echo -e "Detected parameter $Font_Green-y$Font_Suffix. Continue installation..."
fi
if [ "$no_sudo" == "no_sudo" ]||[ $(id -u) -eq 0 ];then
local usesudo=""
else
local usesudo="sudo"
fi
case $package_manager in
apt)$usesudo apt update
$usesudo $install_command jq curl bc netcat-openbsd dnsutils iproute2
;;
dnf|yum)$usesudo $install_command epel-release
$usesudo $package_manager makecache
$usesudo $install_command jq curl bc nmap-ncat bind-utils iproute
;;
pacman)$usesudo pacman -Sy
$usesudo $install_command jq curl bc gnu-netcat bind-tools iproute2
;;
apk)$usesudo apk update
$usesudo $install_command jq curl bc netcat-openbsd grep bind-tools iproute2
;;
pkg)$usesudo $package_manager update
$usesudo $package_manager $install_command jq curl bc netcat dnsutils iproute
;;
brew)eval "$(/opt/homebrew/bin/brew shellenv)"
$install_command jq curl bc netcat bind
;;
zypper)$usesudo zypper refresh
$usesudo $install_command jq curl bc netcat bind-utils iproute2
;;
xbps)$usesudo xbps-install -Sy
$usesudo $install_command jq curl bc netcat bind-utils iproute2
esac
}
declare -A browsers=(
[Chrome]="145.0.0.0 144.0.0.0 143.0.0.0 142.0.0.0 141.0.0.0 140.0.0.0"
[Firefox]="147.0 146.0 145.0 144.0 143.0 142.0 141.0 140.0")
generate_random_user_agent(){
local browsers_keys=(${!browsers[@]})
local random_browser_index=$((RANDOM%${#browsers_keys[@]}))
local browser=${browsers_keys[random_browser_index]}
case $browser in
Chrome)local versions=(${browsers[Chrome]})
local version=${versions[RANDOM%${#versions[@]}]}
UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/$version Safari/537.36"
;;
Firefox)local versions=(${browsers[Firefox]})
local version=${versions[RANDOM%${#versions[@]}]}
UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:$version) Gecko/20100101 Firefox/$version"
esac
}
adapt_locale(){
local ifunicode=$(printf '\u2800')
[[ ${#ifunicode} -gt 3 ]]&&export LC_CTYPE=en_US.UTF-8 2>/dev/null
}
check_connectivity(){
local url="https://www.google.com/generate_204"
local timeout=2
local http_code
http_code=$(curl -s -o /dev/null -w "%{http_code}" --connect-timeout "$timeout" "$url" 2>/dev/null)
if [[ $http_code == "204" ]];then
rawgithub="https://github.com/xykt/IPQuality/raw/"
return 0
else
rawgithub="https://testingcf.jsdelivr.net/gh/xykt/IPQuality@"
return 1
fi
}
is_valid_ipv4(){
local ip=$1
if [[ $ip =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]];then
IFS='.' read -r -a octets <<<"$ip"
for octet in "${octets[@]}";do
if ((octet<0||octet>255));then
IPV4work=0
return 1
fi
done
IPV4work=1
return 0
else
IPV4work=0
return 1
fi
}
is_private_ipv4(){
local ip_address=$1
if [[ -z $ip_address ]];then
return 0
fi
if [[ $ip_address =~ ^10\. ]]||[[ $ip_address =~ ^172\.(1[6-9]|2[0-9]|3[0-1])\. ]]||[[ $ip_address =~ ^192\.168\. ]]||[[ $ip_address =~ ^127\. ]]||[[ $ip_address =~ ^0\. ]]||[[ $ip_address =~ ^22[4-9]\. ]]||[[ $ip_address =~ ^23[0-9]\. ]];then
return 0
fi
return 1
}
get_ipv4(){
local response
IPV4=""
local API_NET=("myip.check.place" "ip.sb" "ping0.cc" "icanhazip.com" "api64.ipify.org" "ifconfig.co" "ident.me")
for p in "${API_NET[@]}";do
response=$(curl $CurlARG -s4 --max-time 2 "$p")
if [[ $? -eq 0 && ! $response =~ error && -n $response ]];then
IPV4="$response"
break
fi
done
}
hide_ipv4(){
if [[ -n $1 ]];then
IFS='.' read -r -a ip_parts <<<"$1"
IPhide="${ip_parts[0]}.${ip_parts[1]}.*.*"
else
IPhide=""
fi
}
is_valid_ipv6(){
local ip=$1
if [[ $ip =~ ^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$ || $ip =~ ^([0-9a-fA-F]{1,4}:){1,7}:$ || $ip =~ ^:([0-9a-fA-F]{1,4}:){1,7}$ || $ip =~ ^([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}$ || $ip =~ ^([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}$ || $ip =~ ^([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}$ || $ip =~ ^([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}$ || $ip =~ ^([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}$ || $ip =~ ^[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})$ || $ip =~ ^:((:[0-9a-fA-F]{1,4}){1,7}|:)$ || $ip =~ ^fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}$ || $ip =~ ^::(ffff(:0{1,4}){0,1}:){0,1}(([0-9]{1,3}\.){3}[0-9]{1,3})$ || $ip =~ ^([0-9a-fA-F]{1,4}:){1,4}:(([0-9]{1,3}\.){3}[0-9]{1,3})$ ]];then
IPV6work=1
return 0
else
IPV6work=0
return 1
fi
}
is_private_ipv6(){
local address=$1
if [[ -z $address ]];then
return 0
fi
if [[ $address =~ ^fe80: ]]||[[ $address =~ ^fc00: ]]||[[ $address =~ ^fd00: ]]||[[ $address =~ ^2001:db8: ]]||[[ $address == ::1 ]]||[[ $address =~ ^::ffff: ]]||[[ $address =~ ^2002: ]]||[[ $address =~ ^2001: ]];then
return 0
fi
return 1
}
get_ipv6(){
local response
IPV6=""
local API_NET=("myip.check.place" "ip.sb" "ping0.cc" "icanhazip.com" "api64.ipify.org" "ifconfig.co" "ident.me")
for p in "${API_NET[@]}";do
response=$(curl $CurlARG -s6k --max-time 2 "$p")
if [[ $? -eq 0 && ! $response =~ error && -n $response ]];then
IPV6="$response"
break
fi
done
}
hide_ipv6(){
if [[ -n $1 ]];then
local expanded_ip=$(echo "$1"|sed 's/::/:0000:0000:0000:0000:0000:0000:0000:0000:/g'|cut -d ':' -f1-8)
IFS=':' read -r -a ip_parts <<<"$expanded_ip"
while [ ${#ip_parts[@]} -lt 8 ];do
ip_parts+=(0000)
done
IPhide="${ip_parts[0]:-0}:${ip_parts[1]:-0}:${ip_parts[2]:-0}:*:*:*:*:*"
IPhide=$(echo "$IPhide"|sed 's/:0\{1,\}/:/g'|sed 's/::\+/:/g')
else
IPhide=""
fi
}
calculate_display_width(){
local string="$1"
local length=0
local char
for ((i=0; i<${#string}; i++));do
char=$(echo "$string"|od -An -N1 -tx1 -j $((i))|tr -d ' ')
if [ "$(printf '%d\n' 0x$char)" -gt 127 ];then
length=$((length+2))
i=$((i+1))
else
length=$((length+1))
fi
done
echo "$length"
}
calc_padding(){
local input_text="$1"
local total_width=$2
local title_length=$(calculate_display_width "$input_text")
local left_padding=$(((total_width-title_length)/2))
if [[ $left_padding -gt 0 ]];then
PADDING=$(printf '%*s' $left_padding)
else
PADDING=""
fi
}
generate_dms(){
local lat=$1
local lon=$2
if [[ -z $lat || $lat == "null" || -z $lon || $lon == "null" ]];then
echo ""
return
fi
convert_single(){
local coord=$1
local direction=$2
local fixed_coord=$(echo "$coord"|sed 's/\.$/.0/')
local degrees=$(echo "$fixed_coord"|cut -d'.' -f1)
local fractional="0.$(echo "$fixed_coord"|cut -d'.' -f2)"
local minutes=$(echo "$fractional * 60"|bc -l|cut -d'.' -f1)
local seconds_fractional="0.$(echo "$fractional * 60"|bc -l|cut -d'.' -f2)"
local seconds=$(echo "$seconds_fractional * 60"|bc -l|awk '{printf "%.0f", $1}')
echo "$degrees°$minutes′$seconds″$direction"
}
local lat_dir='N'
if [[ $(echo "$lat < 0"|bc -l) -eq 1 ]];then
lat_dir='S'
lat=$(echo "$lat * -1"|bc -l)
fi
local lon_dir='E'
if [[ $(echo "$lon < 0"|bc -l) -eq 1 ]];then
lon_dir='W'
lon=$(echo "$lon * -1"|bc -l)
fi
local lat_dms=$(convert_single $lat $lat_dir)
local lon_dms=$(convert_single $lon $lon_dir)
echo "$lon_dms, $lat_dms"
}
generate_googlemap_url(){
local lat=$1
local lon=$2
local radius=$3
if [[ -z $lat || $lat == "null" || -z $lon || $lon == "null" || -z $radius || $radius == "null" ]];then
echo ""
return
fi
local zoom_level=15
if [[ $radius -gt 1000 ]];then
zoom_level=12
elif [[ $radius -gt 500 ]];then
zoom_level=13
elif [[ $radius -gt 250 ]];then
zoom_level=14
fi
echo "https://check.place/$lat,$lon,$zoom_level,$YY"
}
db_maxmind(){
local temp_info="$Font_Cyan$Font_B${sinfo[database]}${Font_I}Maxmind $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-8-${sinfo[ldatabase]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
maxmind=()
local RESPONSE=$(curl $CurlARG -Ls -$1 -m 10 "https://ipinfo.check.place/$IP?lang=$YY")
echo "$RESPONSE"|jq . >/dev/null 2>&1||RESPONSE=""
if [[ -z $RESPONSE ]];then
mode_lite=1
else
mode_lite=0
fi
maxmind[asn]=$(echo "$RESPONSE"|jq -r '.ASN.AutonomousSystemNumber')
maxmind[org]=$(echo "$RESPONSE"|jq -r '.ASN.AutonomousSystemOrganization')
maxmind[city]=$(echo "$RESPONSE"|jq -r '.City.Name')
maxmind[post]=$(echo "$RESPONSE"|jq -r '.City.PostalCode')
maxmind[lat]=$(echo "$RESPONSE"|jq -r '.City.Latitude')
maxmind[lon]=$(echo "$RESPONSE"|jq -r '.City.Longitude')
maxmind[rad]=$(echo "$RESPONSE"|jq -r '.City.AccuracyRadius')
maxmind[continentcode]=$(echo "$RESPONSE"|jq -r '.City.Continent.Code')
maxmind[continent]=$(echo "$RESPONSE"|jq -r '.City.Continent.Name')
maxmind[citycountrycode]=$(echo "$RESPONSE"|jq -r '.City.Country.IsoCode')
maxmind[citycountry]=$(echo "$RESPONSE"|jq -r '.City.Country.Name')
maxmind[timezone]=$(echo "$RESPONSE"|jq -r '.City.Location.TimeZone')
maxmind[subcode]=$(echo "$RESPONSE"|jq -r 'if .City.Subdivisions | length > 0 then .City.Subdivisions[0].IsoCode else "N/A" end')
maxmind[sub]=$(echo "$RESPONSE"|jq -r 'if .City.Subdivisions | length > 0 then .City.Subdivisions[0].Name else "N/A" end')
maxmind[countrycode]=$(echo "$RESPONSE"|jq -r '.Country.IsoCode')
maxmind[country]=$(echo "$RESPONSE"|jq -r '.Country.Name')
maxmind[regcountrycode]=$(echo "$RESPONSE"|jq -r '.Country.RegisteredCountry.IsoCode')
maxmind[regcountry]=$(echo "$RESPONSE"|jq -r '.Country.RegisteredCountry.Name')
if [[ $YY != "en" ]];then
local backup_response=$(curl $CurlARG -s -$1 -m 10 "https://ipinfo.check.place/$IP?lang=en")
[[ ${maxmind[asn]} == "null" ]]&&maxmind[asn]=$(echo "$backup_response"|jq -r '.ASN.AutonomousSystemNumber')
[[ ${maxmind[org]} == "null" ]]&&maxmind[org]=$(echo "$backup_response"|jq -r '.ASN.AutonomousSystemOrganization')
[[ ${maxmind[city]} == "null" ]]&&maxmind[city]=$(echo "$backup_response"|jq -r '.City.Name')
[[ ${maxmind[post]} == "null" ]]&&maxmind[post]=$(echo "$backup_response"|jq -r '.City.PostalCode')
[[ ${maxmind[lat]} == "null" ]]&&maxmind[lat]=$(echo "$backup_response"|jq -r '.City.Latitude')
[[ ${maxmind[lon]} == "null" ]]&&maxmind[lon]=$(echo "$backup_response"|jq -r '.City.Longitude')
[[ ${maxmind[rad]} == "null" ]]&&maxmind[rad]=$(echo "$backup_response"|jq -r '.City.AccuracyRadius')
[[ ${maxmind[continentcode]} == "null" ]]&&maxmind[continentcode]=$(echo "$backup_response"|jq -r '.City.Continent.Code')
[[ ${maxmind[continent]} == "null" ]]&&maxmind[continent]=$(echo "$backup_response"|jq -r '.City.Continent.Name')
[[ ${maxmind[citycountrycode]} == "null" ]]&&maxmind[citycountrycode]=$(echo "$backup_response"|jq -r '.City.Country.IsoCode')
[[ ${maxmind[citycountry]} == "null" ]]&&maxmind[citycountry]=$(echo "$backup_response"|jq -r '.City.Country.Name')
[[ ${maxmind[timezone]} == "null" ]]&&maxmind[timezone]=$(echo "$backup_response"|jq -r '.City.Location.TimeZone')
[[ ${maxmind[subcode]} == "null" ]]&&maxmind[subcode]=$(echo "$backup_response"|jq -r 'if .City.Subdivisions | length > 0 then .City.Subdivisions[0].IsoCode else "N/A" end')
[[ ${maxmind[sub]} == "null" ]]&&maxmind[sub]=$(echo "$backup_response"|jq -r 'if .City.Subdivisions | length > 0 then .City.Subdivisions[0].Name else "N/A" end')
[[ ${maxmind[countrycode]} == "null" ]]&&maxmind[countrycode]=$(echo "$backup_response"|jq -r '.Country.IsoCode')
[[ ${maxmind[country]} == "null" ]]&&maxmind[country]=$(echo "$backup_response"|jq -r '.Country.Name')
[[ ${maxmind[regcountrycode]} == "null" ]]&&maxmind[regcountrycode]=$(echo "$backup_response"|jq -r '.Country.RegisteredCountry.IsoCode')
[[ ${maxmind[regcountry]} == "null" ]]&&maxmind[regcountry]=$(echo "$backup_response"|jq -r '.Country.RegisteredCountry.Name')
fi
if [[ ${maxmind[lat]} != "null" && ${maxmind[lon]} != "null" ]];then
maxmind[dms]=$(generate_dms "${maxmind[lat]}" "${maxmind[lon]}")
maxmind[map]=$(generate_googlemap_url "${maxmind[lat]}" "${maxmind[lon]}" "${maxmind[rad]}")
else
maxmind[dms]="null"
maxmind[map]="null"
fi
}
db_ipinfo(){
local temp_info="$Font_Cyan$Font_B${sinfo[database]}${Font_I}IPinfo $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-7-${sinfo[ldatabase]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
ipinfo=()
if [[ $IP == *:* ]];then
local RESPONSE=$(curl -Ls -m 10 "https://ipinfo.io/widget/demo/$IP")
else
local RESPONSE=$(curl $CurlARG -Ls -m 10 "https://ipinfo.io/widget/demo/$IP")
fi
echo "$RESPONSE"|jq . >/dev/null 2>&1||RESPONSE=""
ipinfo[usetype]=$(echo "$RESPONSE"|jq -r '.data.asn.type')
ipinfo[comtype]=$(echo "$RESPONSE"|jq -r '.data.company.type')
shopt -s nocasematch
case ${ipinfo[usetype]} in
"business")ipinfo[susetype]="${stype[business]}"
;;
"isp")ipinfo[susetype]="${stype[isp]}"
;;
"hosting")ipinfo[susetype]="${stype[hosting]}"
;;
"education")ipinfo[susetype]="${stype[education]}"
;;
*)ipinfo[susetype]="${stype[other]}"
esac
case ${ipinfo[comtype]} in
"business")ipinfo[scomtype]="${stype[business]}"
;;
"isp")ipinfo[scomtype]="${stype[isp]}"
;;
"hosting")ipinfo[scomtype]="${stype[hosting]}"
;;
"education")ipinfo[scomtype]="${stype[education]}"
;;
*)ipinfo[scomtype]="${stype[other]}"
esac
shopt -u nocasematch
ipinfo[countrycode]=$(echo "$RESPONSE"|jq -r '.data.country')
ipinfo[proxy]=$(echo "$RESPONSE"|jq -r '.data.privacy.proxy')
ipinfo[tor]=$(echo "$RESPONSE"|jq -r '.data.privacy.tor')
ipinfo[vpn]=$(echo "$RESPONSE"|jq -r '.data.privacy.vpn')
ipinfo[server]=$(echo "$RESPONSE"|jq -r '.data.privacy.hosting')
local ISO3166=$(curl -sL -m 10 "${rawgithub}main/ref/iso3166.json")
ipinfo[asn]=$(echo "$RESPONSE"|jq -r '.data.asn.asn'|sed 's/^AS//')
ipinfo[org]=$(echo "$RESPONSE"|jq -r '.data.asn.name')
ipinfo[city]=$(echo "$RESPONSE"|jq -r '.data.city')
ipinfo[post]=$(echo "$RESPONSE"|jq -r '.data.postal')
ipinfo[timezone]=$(echo "$RESPONSE"|jq -r '.data.timezone')
local tmp_str=$(echo "$RESPONSE"|jq -r '.data.loc')
ipinfo[lat]=$(echo "$tmp_str"|cut -d',' -f1)
ipinfo[lon]=$(echo "$tmp_str"|cut -d',' -f2)
ipinfo[countrycode]=$(echo "$RESPONSE"|jq -r '.data.country')
ipinfo[country]=$(echo "$ISO3166"|jq --arg code "${ipinfo[countrycode]}" -r '.[] | select(.["alpha-2"] == $code) | .name')
ipinfo[continent]=$(echo "$ISO3166"|jq --arg code "${ipinfo[countrycode]}" -r '.[] | select(.["alpha-2"] == $code) | .region')
ipinfo[regcountrycode]=$(echo "$RESPONSE"|jq -r '.data.abuse.country')
ipinfo[regcountry]=$(echo "$ISO3166"|jq --arg code "${ipinfo[regcountrycode]}" -r '.[] | select(.["alpha-2"] == $code) | .name')
if [[ ${ipinfo[lat]} != "null" && ${ipinfo[lon]} != "null" ]];then
ipinfo[dms]=$(generate_dms "${ipinfo[lat]}" "${ipinfo[lon]}")
ipinfo[map]=$(generate_googlemap_url "${ipinfo[lat]}" "${ipinfo[lon]}" "1001")
else
ipinfo[dms]="null"
ipinfo[map]="null"
fi
}
db_scamalytics(){
local temp_info="$Font_Cyan$Font_B${sinfo[database]}${Font_I}Scamalytics $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-12-${sinfo[ldatabase]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
scamalytics=()
local RESPONSE=$(curl $CurlARG -sL -$1 -m 10 "https://ipinfo.check.place/$IP?db=scamalytics")
echo "$RESPONSE"|jq . >/dev/null 2>&1||RESPONSE=""
scamalytics[countrycode]=$(echo "$RESPONSE"|jq -r '.external_datasources.maxmind_geolite2.ip_country_code')
scamalytics[proxy]=$(echo "$RESPONSE"|jq -r '.external_datasources.firehol.is_proxy')
scamalytics[tor]=$(echo "$RESPONSE"|jq -r '.external_datasources.x4bnet.is_tor')
scamalytics[vpn]=$(echo "$RESPONSE"|jq -r '.scamalytics.scamalytics_proxy.is_vpn')
scamalytics[server]=$(echo "$RESPONSE"|jq -r '.scamalytics.scamalytics_proxy.is_datacenter')
scamalytics[abuser]=$(echo "$RESPONSE"|jq -r '.scamalytics.is_blacklisted_external')
scamalytics[robot1]=$(echo "$RESPONSE"|jq -r '.external_datasources.x4bnet.is_blacklisted_spambot')
scamalytics[robot2]=$(echo "$RESPONSE"|jq -r '.external_datasources.x4bnet.is_bot_operamini')
scamalytics[robot3]=$(echo "$RESPONSE"|jq -r '.external_datasources.x4bnet.is_bot_semrush')
[[ ${scamalytics[robot1]} == "true" || ${scamalytics[robot2]} == "true" || ${scamalytics[robot3]} == "true" ]]&&scamalytics[robot]="true"
[[ ${scamalytics[robot1]} == "false" && ${scamalytics[robot2]} == "false" && ${scamalytics[robot3]} == "false" ]]&&scamalytics[robot]="false"
scamalytics[score]=$(echo "$RESPONSE"|jq -r '.scamalytics.scamalytics_score')
if [[ ${scamalytics[score]} -lt 20 ]];then
scamalytics[risk]="${sscore[low]}"
elif [[ ${scamalytics[score]} -lt 60 ]];then
scamalytics[risk]="${sscore[medium]}"
elif [[ ${scamalytics[score]} -lt 90 ]];then
scamalytics[risk]="${sscore[high]}"
elif [[ ${scamalytics[score]} -ge 90 ]];then
scamalytics[risk]="${sscore[veryhigh]}"
fi
}
db_ipregistry(){
local temp_info="$Font_Cyan$Font_B${sinfo[database]}${Font_I}ipregistry $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-11-${sinfo[ldatabase]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
ipregistry=()
local tmpgo="sb69ksjcajfs4c"
local REGISTRY_HTML
REGISTRY_HTML=$(curl $CurlARG -sL -$1 -m 10 -H "User-Agent: $UA_Browser" "https://ipregistry.co")
if [[ -n $REGISTRY_HTML ]];then
if [[ $REGISTRY_HTML =~ apiKey=\"([a-zA-Z0-9]+)\" ]];then
tmpgo="${BASH_REMATCH[1]}"
fi
fi
local RESPONSE
RESPONSE=$(curl $CurlARG -sS -$1 --compressed -m 10 \
-H "authority: api.ipregistry.co" \
-H "origin: https://ipregistry.co" \
-H "referer: https://ipregistry.co/" \
-H "User-Agent: $UA_Browser" \
"https://api.ipregistry.co/$IP?hostname=true&key=$tmpgo")
echo "$RESPONSE"|jq . >/dev/null 2>&1||RESPONSE=""
ipregistry[usetype]=$(echo "$RESPONSE"|jq -r '.connection.type')
ipregistry[comtype]=$(echo "$RESPONSE"|jq -r '.company.type')
shopt -s nocasematch
case ${ipregistry[usetype]} in
"business")ipregistry[susetype]="${stype[business]}"
;;
"isp")ipregistry[susetype]="${stype[isp]}"
;;
"hosting")ipregistry[susetype]="${stype[hosting]}"
;;
"education")ipregistry[susetype]="${stype[education]}"
;;
"government")ipregistry[susetype]="${stype[government]}"
;;
*)ipregistry[susetype]="${stype[other]}"
esac
case ${ipregistry[comtype]} in
"business")ipregistry[scomtype]="${stype[business]}"
;;
"isp")ipregistry[scomtype]="${stype[isp]}"
;;
"hosting")ipregistry[scomtype]="${stype[hosting]}"
;;
"education")ipregistry[scomtype]="${stype[education]}"
;;
"government")ipregistry[scomtype]="${stype[government]}"
;;
*)ipregistry[scomtype]="${stype[other]}"
esac
shopt -u nocasematch
ipregistry[countrycode]=$(echo "$RESPONSE"|jq -r '.location.country.code')
ipregistry[proxy]=$(echo "$RESPONSE"|jq -r '.security.is_proxy')
ipregistry[tor1]=$(echo "$RESPONSE"|jq -r '.security.is_tor')
ipregistry[tor2]=$(echo "$RESPONSE"|jq -r '.security.is_tor_exit')
[[ ${ipregistry[tor1]} == "true" || ${ipregistry[tor2]} == "true" ]]&&ipregistry[tor]="true"
[[ ${ipregistry[tor1]} == "false" && ${ipregistry[tor2]} == "false" ]]&&ipregistry[tor]="false"
ipregistry[vpn]=$(echo "$RESPONSE"|jq -r '.security.is_vpn')
ipregistry[server]=$(echo "$RESPONSE"|jq -r '.security.is_cloud_provider')
ipregistry[abuser]=$(echo "$RESPONSE"|jq -r '.security.is_abuser')
}
db_ipapi(){
local temp_info="$Font_Cyan$Font_B${sinfo[database]}${Font_I}ipapi $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-6-${sinfo[ldatabase]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
ipapi=()
if [[ $IP == *:* ]];then
local RESPONSE=$(curl -Ls -m 10 "https://api.ipapi.is/?q=$IP")
else
local RESPONSE=$(curl $CurlARG -sL -m 10 "https://api.ipapi.is/?q=$IP")
fi
echo "$RESPONSE"|jq . >/dev/null 2>&1||RESPONSE=""
ipapi[usetype]=$(echo "$RESPONSE"|jq -r '.asn.type')
ipapi[comtype]=$(echo "$RESPONSE"|jq -r '.company.type')
shopt -s nocasematch
case ${ipapi[usetype]} in
"business")ipapi[susetype]="${stype[business]}"
;;
"isp")ipapi[susetype]="${stype[isp]}"
;;
"hosting")ipapi[susetype]="${stype[hosting]}"
;;
"education")ipapi[susetype]="${stype[education]}"
;;
"government")ipapi[susetype]="${stype[government]}"
;;
"banking")ipapi[susetype]="${stype[banking]}"
;;
*)ipapi[susetype]="${stype[other]}"
esac
case ${ipapi[comtype]} in
"business")ipapi[scomtype]="${stype[business]}"
;;
"isp")ipapi[scomtype]="${stype[isp]}"
;;
"hosting")ipapi[scomtype]="${stype[hosting]}"
;;
"education")ipapi[scomtype]="${stype[education]}"
;;
"government")ipapi[scomtype]="${stype[government]}"
;;
"banking")ipapi[scomtype]="${stype[banking]}"
;;
*)ipapi[scomtype]="${stype[other]}"
esac
[[ -z $RESPONSE ]]&&return 1
ipapi[scoretext]=$(echo "$RESPONSE"|jq -r '.company.abuser_score')
ipapi[scorenum]=$(echo "${ipapi[scoretext]}"|awk '{print $1}')
ipapi[risktext]=$(echo "${ipapi[scoretext]}"|awk -F'[()]' '{print $2}')
ipapi[score]=$(awk "BEGIN {printf \"%.2f%%\", ${ipapi[scorenum]} * 100}")
case ${ipapi[risktext]} in
"Very Low")ipapi[risk]="${sscore[verylow]}"
;;
"Low")ipapi[risk]="${sscore[low]}"
;;
"Elevated")ipapi[risk]="${sscore[elevated]}"
;;
"High")ipapi[risk]="${sscore[high]}"
;;
"Very High")ipapi[risk]="${sscore[veryhigh]}"
esac
shopt -u nocasematch
ipapi[countrycode]=$(echo "$RESPONSE"|jq -r '.location.country_code')
ipapi[proxy]=$(echo "$RESPONSE"|jq -r '.is_proxy')
ipapi[tor]=$(echo "$RESPONSE"|jq -r '.is_tor')
ipapi[vpn]=$(echo "$RESPONSE"|jq -r '.is_vpn')
ipapi[server]=$(echo "$RESPONSE"|jq -r '.is_datacenter')
ipapi[abuser]=$(echo "$RESPONSE"|jq -r '.is_abuser')
ipapi[robot]=$(echo "$RESPONSE"|jq -r '.is_crawler')
}
db_abuseipdb(){
local temp_info="$Font_Cyan$Font_B${sinfo[database]}${Font_I}AbuseIPDB $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-10-${sinfo[ldatabase]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
abuseipdb=()
local RESPONSE=$(curl $CurlARG -sL -$1 -m 10 "https://ipinfo.check.place/$IP?db=abuseipdb")
echo "$RESPONSE"|jq . >/dev/null 2>&1||RESPONSE=""
abuseipdb[usetype]=$(echo "$RESPONSE"|jq -r '.data.usageType')
shopt -s nocasematch
case ${abuseipdb[usetype]} in
"Commercial")abuseipdb[susetype]="${stype[business]}"
;;
"Data Center/Web Hosting/Transit")abuseipdb[susetype]="${stype[hosting]}"
;;
"University/College/School")abuseipdb[susetype]="${stype[education]}"
;;
"Government")abuseipdb[susetype]="${stype[government]}"
;;
"banking")abuseipdb[susetype]="${stype[banking]}"
;;
"Organization")abuseipdb[susetype]="${stype[organization]}"
;;
"Military")abuseipdb[susetype]="${stype[military]}"
;;
"Library")abuseipdb[susetype]="${stype[library]}"
;;
"Content Delivery Network")abuseipdb[susetype]="${stype[cdn]}"
;;
"Fixed Line ISP")abuseipdb[susetype]="${stype[lineisp]}"
;;
"Mobile ISP")abuseipdb[susetype]="${stype[mobile]}"
;;
"Search Engine Spider")abuseipdb[susetype]="${stype[spider]}"
;;
"Reserved")abuseipdb[susetype]="${stype[reserved]}"
;;
*)abuseipdb[susetype]="${stype[other]}"
esac
shopt -u nocasematch
abuseipdb[score]=$(echo "$RESPONSE"|jq -r '.data.abuseConfidenceScore')
if [[ ${abuseipdb[score]} -lt 25 ]];then
abuseipdb[risk]="${sscore[low]}"
elif [[ ${abuseipdb[score]} -lt 75 ]];then
abuseipdb[risk]="${sscore[high]}"
elif [[ ${abuseipdb[score]} -ge 75 ]];then
abuseipdb[risk]="${sscore[dos]}"
fi
}
db_ip2location(){
local temp_info="$Font_Cyan$Font_B${sinfo[database]}${Font_I}IP2LOCATION $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-12-${sinfo[ldatabase]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
ip2location=()
local RESPONSE=$(curl $CurlARG -sL -$1 -m 10 "https://ipinfo.check.place/$IP?db=ip2location")
echo "$RESPONSE"|jq . >/dev/null 2>&1||RESPONSE=""
ip2location[usetype]=$(echo "$RESPONSE"|jq -r '.usage_type')
ip2location[comtype]=$(echo "$RESPONSE"|jq -r '.as_info.as_usage_type')
shopt -s nocasematch
local first_use="${ip2location[usetype]%%/*}"
case $first_use in
"COM")ip2location[susetype]="${stype[business]}"
;;
"DCH")ip2location[susetype]="${stype[hosting]}"
;;
"EDU")ip2location[susetype]="${stype[education]}"
;;
"GOV")ip2location[susetype]="${stype[government]}"
;;
"ORG")ip2location[susetype]="${stype[organization]}"
;;
"MIL")ip2location[susetype]="${stype[military]}"
;;
"LIB")ip2location[susetype]="${stype[library]}"
;;
"CDN")ip2location[susetype]="${stype[cdn]}"
;;
"ISP")ip2location[susetype]="${stype[lineisp]}"
;;
"MOB")ip2location[susetype]="${stype[mobile]}"
;;
"SES")ip2location[susetype]="${stype[spider]}"
;;
"RSV")ip2location[susetype]="${stype[reserved]}"
;;
*)ip2location[susetype]="${stype[other]}"
esac
first_use="${ip2location[comtype]%%/*}"
case $first_use in
"COM")ip2location[scomtype]="${stype[business]}"
;;
"DCH")ip2location[scomtype]="${stype[hosting]}"
;;
"EDU")ip2location[scomtype]="${stype[education]}"
;;
"GOV")ip2location[scomtype]="${stype[government]}"
;;
"ORG")ip2location[scomtype]="${stype[organization]}"
;;
"MIL")ip2location[scomtype]="${stype[military]}"
;;
"LIB")ip2location[scomtype]="${stype[library]}"
;;
"CDN")ip2location[scomtype]="${stype[cdn]}"
;;
"ISP")ip2location[scomtype]="${stype[lineisp]}"
;;
"MOB")ip2location[scomtype]="${stype[mobile]}"
;;
"SES")ip2location[scomtype]="${stype[spider]}"
;;
"RSV")ip2location[scomtype]="${stype[reserved]}"
;;
*)ip2location[scomtype]="${stype[other]}"
esac
shopt -u nocasematch
ip2location[countrycode]=$(echo "$RESPONSE"|jq -r '.country_code')
ip2location[proxy0]=$(echo "$RESPONSE"|jq -r '.is_proxy')
ip2location[proxy1]=$(echo "$RESPONSE"|jq -r '.proxy.is_public_proxy')
ip2location[proxy2]=$(echo "$RESPONSE"|jq -r '.proxy.is_web_proxy')
[[ ${ip2location[proxy0]} == "true" || ${ip2location[proxy1]} == "true" || ${ip2location[proxy2]} == "true" ]]&&ip2location[proxy]="true"
[[ ${ip2location[proxy0]} == "false" && ${ip2location[proxy1]} == "false" && ${ip2location[proxy2]} == "false" ]]&&ip2location[proxy]="false"
ip2location[tor]=$(echo "$RESPONSE"|jq -r '.proxy.is_tor')
ip2location[vpn]=$(echo "$RESPONSE"|jq -r '.proxy.is_vpn')
ip2location[server]=$(echo "$RESPONSE"|jq -r '.proxy.is_data_center')
ip2location[abuser]=$(echo "$RESPONSE"|jq -r '.proxy.is_spammer')
ip2location[robot1]=$(echo "$RESPONSE"|jq -r '.proxy.is_web_crawler')
ip2location[robot2]=$(echo "$RESPONSE"|jq -r '.proxy.is_scanner')
ip2location[robot3]=$(echo "$RESPONSE"|jq -r '.proxy.is_botnet')
[[ ${ip2location[robot1]} == "true" || ${ip2location[robot2]} == "true" || ${ip2location[robot3]} == "true" ]]&&ip2location[robot]="true"
[[ ${ip2location[robot1]} == "false" && ${ip2location[robot2]} == "false" && ${ip2location[robot3]} == "false" ]]&&ip2location[robot]="false"
ip2location[score]=$(echo "$RESPONSE"|jq -r '.fraud_score')
if [[ ${ip2location[score]} -lt 33 ]];then
ip2location[risk]="${sscore[low]}"
elif [[ ${ip2location[score]} -lt 66 ]];then
ip2location[risk]="${sscore[medium]}"
elif [[ ${ip2location[score]} -ge 66 ]];then
ip2location[risk]="${sscore[high]}"
fi
}
db_dbip(){
local temp_info="$Font_Cyan$Font_B${sinfo[database]}${Font_I}DB-IP $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-6-${sinfo[ldatabase]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
dbip=()
if [[ $IP == *:* ]];then
local RESPONSE=$(curl -sL -m 10 "https://db-ip.com/$IP")
else
local RESPONSE=$(curl $CurlARG -sL -m 10 "https://db-ip.com/$IP")
fi
mapfile -t results < <(echo "$RESPONSE"|awk '/<th class='\''text-center'\''>Crawler/ {flag=1; next}
             flag && /<span class="sr-only">/ {
                 if ($0 ~ /Yes/) print "true";
                 else if ($0 ~ /No/) print "false";
             }
             /<\/tr>/ && flag {flag=0}')
dbip[robot]="${results[0]}"
dbip[proxy]="${results[1]}"
dbip[abuser]="${results[2]}"
dbip[risktext]=$(echo "$RESPONSE"|sed -n 's/.*Estimated threat level for this IP address is[[:space:]]*<span[^>]*>\([^<]*\)<.*/\1/p')
dbip[countrycode]=$(echo "$RESPONSE"|sed -n '/<code class="language-json">/,/<\/code>/p'|sed -n 's/.*"countryCode"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
shopt -s nocasematch
case ${dbip[risktext]} in
"low")dbip[risk]="${sscore[low]}"
dbip[score]=0
;;
"medium")dbip[risk]="${sscore[medium]}"
dbip[score]=50
;;
"high")dbip[risk]="${sscore[high]}"
dbip[score]=100
esac
shopt -u nocasematch
}
db_ipdata(){
local temp_info="$Font_Cyan$Font_B${sinfo[database]}${Font_I}ipdata $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-7-${sinfo[ldatabase]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
ipdata=()
local RESPONSE=$(curl $CurlARG -sL -$1 -m 10 "https://ipinfo.check.place/$IP?db=ipdata")
echo "$RESPONSE"|jq . >/dev/null 2>&1||RESPONSE=""
ipdata[countrycode]=$(echo "$RESPONSE"|jq -r '.country_code')
ipdata[proxy]=$(echo "$RESPONSE"|jq -r '.threat.is_proxy')
ipdata[tor]=$(echo "$RESPONSE"|jq -r '.threat.is_tor')
ipdata[server]=$(echo "$RESPONSE"|jq -r '.threat.is_datacenter')
ipdata[abuser1]=$(echo "$RESPONSE"|jq -r '.threat.is_threat')
ipdata[abuser2]=$(echo "$RESPONSE"|jq -r '.threat.is_known_abuser')
ipdata[abuser3]=$(echo "$RESPONSE"|jq -r '.threat.is_known_attacker')
[[ ${ipdata[abuser1]} == "true" || ${ipdata[abuser2]} == "true" || ${ipdata[abuser3]} == "true" ]]&&ipdata[abuser]="true"
[[ ${ipdata[abuser1]} == "false" && ${ipdata[abuser2]} == "false" && ${ipdata[abuser3]} == "false" ]]&&ipdata[abuser]="false"
}
db_ipqs(){
local temp_info="$Font_Cyan$Font_B${sinfo[database]}${Font_I}IPQS $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-5-${sinfo[ldatabase]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
ipqs=()
local RESPONSE=$(curl $CurlARG -sL -$1 -m 10 "https://ipinfo.check.place/$IP?db=ipqualityscore")
echo "$RESPONSE"|jq . >/dev/null 2>&1||RESPONSE=""
ipqs[score]=$(echo "$RESPONSE"|jq -r '.fraud_score')
if [[ ${ipqs[score]} -lt 75 ]];then
ipqs[risk]="${sscore[low]}"
elif [[ ${ipqs[score]} -lt 85 ]];then
ipqs[risk]="${sscore[suspicious]}"
elif [[ ${ipqs[score]} -lt 90 ]];then
ipqs[risk]="${sscore[risky]}"
elif [[ ${ipqs[score]} -ge 90 ]];then
ipqs[risk]="${sscore[highrisk]}"
fi
ipqs[countrycode]=$(echo "$RESPONSE"|jq -r '.country_code')
ipqs[proxy]=$(echo "$RESPONSE"|jq -r '.proxy')
ipqs[tor]=$(echo "$RESPONSE"|jq -r '.tor')
ipqs[vpn]=$(echo "$RESPONSE"|jq -r '.vpn')
ipqs[abuser]=$(echo "$RESPONSE"|jq -r '.recent_abuse')
ipqs[robot]=$(echo "$RESPONSE"|jq -r '.bot_status')
}
function check_ip_valide(){
local IPPattern='^(\<([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\>\.){3}\<([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\>$'
IP="$1"
if [[ $IP =~ $IPPattern ]];then
return 0
else
return 1
fi
}
function calc_ip_net(){
sip="$1"
snetmask="$2"
check_ip_valide "$sip"
if [ $? -ne 0 ];then
echo ""
return 1
fi
local ipFIELD1=$(echo "$sip"|cut -d. -f1)
local ipFIELD2=$(echo "$sip"|cut -d. -f2)
local ipFIELD3=$(echo "$sip"|cut -d. -f3)
local ipFIELD4=$(echo "$sip"|cut -d. -f4)
local netmaskFIELD1=$(echo "$snetmask"|cut -d. -f1)
local netmaskFIELD2=$(echo "$snetmask"|cut -d. -f2)
local netmaskFIELD3=$(echo "$snetmask"|cut -d. -f3)
local netmaskFIELD4=$(echo "$snetmask"|cut -d. -f4)
local tmpret1=$((ipFIELD1&netmaskFIELD1))
local tmpret2=$((ipFIELD2&netmaskFIELD2))
local tmpret3=$((ipFIELD3&netmaskFIELD3))
local tmpret4=$((ipFIELD4&netmaskFIELD4))
echo "$tmpret1.$tmpret2.$tmpret3.$tmpret4"
}
function Check_DNS_IP(){
if [ "$1" != "${1#*[0-9].[0-9]}" ];then
if [ "$(calc_ip_net "$1" 255.0.0.0)" == "10.0.0.0" ];then
echo 0
elif [ "$(calc_ip_net "$1" 255.240.0.0)" == "172.16.0.0" ];then
echo 0
elif [ "$(calc_ip_net "$1" 255.255.0.0)" == "169.254.0.0" ];then
echo 0
elif [ "$(calc_ip_net "$1" 255.255.0.0)" == "192.168.0.0" ];then
echo 0
elif [ "$(calc_ip_net "$1" 255.255.255.0)" == "$(calc_ip_net "$2" 255.255.255.0)" ];then
echo 0
else
echo 1
fi
elif [ "$1" != "${1#*[0-9a-fA-F]:*}" ];then
if [ "${1:0:3}" == "fe8" ];then
echo 0
elif [ "${1:0:3}" == "FE8" ];then
echo 0
elif [ "${1:0:2}" == "fc" ];then
echo 0
elif [ "${1:0:2}" == "FC" ];then
echo 0
elif [ "${1:0:2}" == "fd" ];then
echo 0
elif [ "${1:0:2}" == "FD" ];then
echo 0
elif [ "${1:0:2}" == "ff" ];then
echo 0
elif [ "${1:0:2}" == "FF" ];then
echo 0
else
echo 1
fi
else
echo 0
fi
}
function Check_DNS_1(){
local resultdns=$(nslookup $1)
local resultinlines=(${resultdns//$'\n'/ })
for i in ${resultinlines[*]};do
if [[ $i == "Name:" ]];then
local resultdnsindex=$((resultindex+3))
break
fi
local resultindex=$((resultindex+1))
done
echo $(Check_DNS_IP ${resultinlines[$resultdnsindex]} ${resultinlines[1]})
}
function Check_DNS_2(){
local resultdnstext=$(dig $1|grep "ANSWER:")
local resultdnstext=${resultdnstext#*"ANSWER: "}
local resultdnstext=${resultdnstext%", AUTHORITY:"*}
if [ "$resultdnstext" == "0" ]||[ "$resultdnstext" == "1" ]||[ "$resultdnstext" == "2" ];then
echo 0
else
echo 1
fi
}
function Check_DNS_3(){
local resultdnstext=$(dig "test$RANDOM$RANDOM.$1"|grep "ANSWER:")
local resultdnstext=${resultdnstext#*"ANSWER: "}
local resultdnstext=${resultdnstext%", AUTHORITY:"*}
if [ "$resultdnstext" == "0" ];then
echo 1
else
echo 0
fi
}
function Get_Unlock_Type(){
while [ $# -ne 0 ];do
if [ "$1" = "0" ];then
echo "${smedia[dns]}"
return
fi
shift
done
echo "${smedia[native]}"
}
function MediaUnlockTest_TikTok(){
local temp_info="$Font_Cyan$Font_B${sinfo[media]}${Font_I}TikTok $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-7-${sinfo[lmedia]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
tiktok=()
local checkunlockurl="tiktok.com"
local result1=$(Check_DNS_1 $checkunlockurl)
local result3=$(Check_DNS_3 $checkunlockurl)
local resultunlocktype=$(Get_Unlock_Type $result1 $result3)
local Ftmpresult=$(curl $CurlARG -$1 --user-agent "$UA_Browser" -sL -m 10 "https://www.tiktok.com/")
[[ $Ftmpresult == *"Please wait..."* ]]&&Ftmpresult=$(curl $useNIC $usePROXY $xForward --user-agent "$UA_Browser" -sL -m 10 "https://www.tiktok.com/explore")
if [[ $Ftmpresult == "curl"* ]];then
tiktok[ustatus]="${smedia[no]}"
tiktok[uregion]="${smedia[nodata]}"
tiktok[utype]="${smedia[nodata]}"
return
fi
local FRegion=$(echo $Ftmpresult|grep '"region":'|sed 's/.*"region"//'|cut -f2 -d'"')
if [ -n "$FRegion" ];then
tiktok[ustatus]="${smedia[yes]}"
local ttpadding=$((7-${#FRegion}))
local ttleft=$((ttpadding/2))
local ttright=$((ttpadding-ttleft))
tiktok[uregion]="$(printf "%*s%s%*s" "$ttleft" "" "[$FRegion]" "$ttright" "")"
tiktok[utype]="$resultunlocktype"
return
fi
local STmpresult=$(curl $CurlARG -$1 --user-agent "$UA_Browser" -sL -m 10 -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "Accept-Encoding: gzip" -H "Accept-Language: en" "https://www.tiktok.com"|gunzip 2>/dev/null)
[[ $Ftmpresult == *"Please wait..."* ]]&&STmpresult=$(curl $useNIC $usePROXY $xForward --user-agent "$UA_Browser" -sL -m 10 -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "Accept-Encoding: gzip" -H "Accept-Language: en" "https://www.tiktok.com/explore"|gunzip 2>/dev/null)
local SRegion=$(echo $STmpresult|grep '"region":'|sed 's/.*"region"//'|cut -f2 -d'"')
if [ -n "$SRegion" ];then
tiktok[ustatus]="${smedia[idc]}"
local ttWidth=7
local ttpadding=$((7-${#SRegion}))
local ttleft=$((ttpadding/2))
local ttright=$((ttpadding-ttleft))
tiktok[uregion]="$(printf "%*s%s%*s" "$ttleft" "" "[$SRegion]" "$ttright" "")"
tiktok[utype]="$resultunlocktype"
return
else
tiktok[ustatus]="${smedia[bad]}"
tiktok[uregion]="${smedia[nodata]}"
tiktok[utype]="${smedia[nodata]}"
return
fi
}
function MediaUnlockTest_DisneyPlus(){
local temp_info="$Font_Cyan$Font_B${sinfo[media]}${Font_I}Disney+ $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-8-${sinfo[lmedia]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
disney=()
local checkunlockurl="disneyplus.com"
local result1=$(Check_DNS_1 $checkunlockurl)
local result3=$(Check_DNS_3 $checkunlockurl)
local resultunlocktype=$(Get_Unlock_Type $result1 $result3)
local PreAssertion=$(curl $CurlARG -$1 --user-agent "$UA_Browser" -s --max-time 10 -X POST "https://disney.api.edge.bamgrid.com/devices" -H "authorization: Bearer ZGlzbmV5JmJyb3dzZXImMS4wLjA.Cu56AgSfBTDag5NiRA81oLHkDZfu5L3CKadnefEAY84" -H "content-type: application/json; charset=UTF-8" -d '{"deviceFamily":"browser","applicationRuntime":"chrome","deviceProfile":"windows","attributes":{}}' 2>&1)
if [[ $PreAssertion == "curl"* ]]&&[[ $1 == "6" ]];then
disney[ustatus]="${smedia[bad]}"
disney[uregion]="${smedia[nodata]}"
disney[utype]="${smedia[nodata]}"
return
elif [[ $PreAssertion == "curl"* ]];then
disney[ustatus]="${smedia[bad]}"
disney[uregion]="${smedia[nodata]}"
disney[utype]="${smedia[nodata]}"
return
fi
if ! (echo "$PreAssertion"|jq . >/dev/null 2>&1&&echo "$TokenContent"|jq . >/dev/null 2>&1);then
disney[ustatus]="${smedia[bad]}"
disney[uregion]="${smedia[nodata]}"
disney[utype]="${smedia[nodata]}"
return
fi
local assertion=$(echo $PreAssertion|jq -r '.assertion')
local PreDisneyCookie=$(echo "$Media_Cookie"|sed -n '1p')
local disneycookie=$(echo $PreDisneyCookie|sed "s/DISNEYASSERTION/$assertion/g")
local TokenContent=$(curl $CurlARG -$1 --user-agent "$UA_Browser" -s --max-time 10 -X POST "https://disney.api.edge.bamgrid.com/token" -H "authorization: Bearer ZGlzbmV5JmJyb3dzZXImMS4wLjA.Cu56AgSfBTDag5NiRA81oLHkDZfu5L3CKadnefEAY84" -d "$disneycookie" 2>&1)
local isBanned=$(echo $TokenContent|jq -r 'select(.error_description == "forbidden-location") | .error_description')
local is403=$(echo $TokenContent|grep '403 ERROR')
if [ -n "$isBanned" ]||[ -n "$is403" ];then
disney[ustatus]="${smedia[no]}"
disney[uregion]="${smedia[nodata]}"
disney[utype]="${smedia[nodata]}"
return
fi
local fakecontent=$(echo "$Media_Cookie"|sed -n '8p')
local refreshToken=$(echo $TokenContent|jq -r '.refresh_token')
local disneycontent=$(echo $fakecontent|sed "s/ILOVEDISNEY/$refreshToken/g")
local tmpresult=$(curl $CurlARG -$1 --user-agent "$UA_Browser" -X POST -sSL --max-time 10 "https://disney.api.edge.bamgrid.com/graph/v1/device/graphql" -H "authorization: ZGlzbmV5JmJyb3dzZXImMS4wLjA.Cu56AgSfBTDag5NiRA81oLHkDZfu5L3CKadnefEAY84" -d "$disneycontent" 2>&1)
if ! (echo "$tmpresult"|jq . >/dev/null 2>&1);then
disney[ustatus]="${smedia[bad]}"
disney[uregion]="${smedia[nodata]}"
disney[utype]="${smedia[nodata]}"
return
fi
local previewcheck=$(curl $CurlARG -$1 -s -o /dev/null -L --max-time 10 -w '%{url_effective}\n' "https://disneyplus.com"|grep preview)
local isUnavailable=$(echo $previewcheck|grep 'unavailable')
local region=$(echo $tmpresult|jq -r '.extensions.sdk.session.location.countryCode')
local inSupportedLocation=$(echo $tmpresult|jq -r '.extensions.sdk.session.inSupportedLocation')
if [[ $region == "JP" ]];then
disney[ustatus]="${smedia[yes]}"
disney[uregion]="  [JP]   "
disney[utype]="$resultunlocktype"
return
elif [ -n "$region" ]&&[[ $inSupportedLocation == "false" ]]&&[ -z "$isUnavailable" ];then
disney[ustatus]="${smedia[pending]}"
disney[uregion]="  [$region]   "
disney[utype]="$resultunlocktype"
return
elif [ -n "$region" ]&&[ -n "$isUnavailable" ];then
disney[ustatus]="${smedia[no]}"
disney[uregion]="${smedia[nodata]}"
disney[utype]="${smedia[nodata]}"
return
elif [ -n "$region" ]&&[[ $inSupportedLocation == "true" ]];then
disney[ustatus]="${smedia[yes]}"
disney[uregion]="  [$region]   "
disney[utype]="$resultunlocktype"
return
elif [ -z "$region" ];then
disney[ustatus]="${smedia[no]}"
disney[uregion]="${smedia[nodata]}"
disney[utype]="${smedia[nodata]}"
return
else
disney[ustatus]="${smedia[bad]}"
disney[uregion]="${smedia[nodata]}"
disney[utype]="${smedia[nodata]}"
return
fi
}
function MediaUnlockTest_Netflix(){
local temp_info="$Font_Cyan$Font_B${sinfo[media]}${Font_I}Netflix $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-8-${sinfo[lmedia]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
netflix=()
local checkunlockurl="netflix.com"
local result1=$(Check_DNS_1 $checkunlockurl)
local result2=$(Check_DNS_2 $checkunlockurl)
local result3=$(Check_DNS_3 $checkunlockurl)
local resultunlocktype=$(Get_Unlock_Type $result1 $result2 $result3)
local result1=$(curl $CurlARG -$1 --user-agent "$UA_Browser" -fsL -X GET --max-time 10 --tlsv1.3 "https://www.netflix.com/title/81280792" 2>&1)
local result2=$(curl $CurlARG -$1 --user-agent "$UA_Browser" -fsL -X GET --max-time 10 --tlsv1.3 "https://www.netflix.com/title/70143836" 2>&1)
if [ -z "$result1" ]||[ -z "$result2" ];then
netflix[ustatus]="${smedia[bad]}"
netflix[uregion]="${smedia[nodata]}"
netflix[utype]="${smedia[nodata]}"
return
fi
region=$(echo "$result1"|sed -n 's/.*"id":"\([^"]*\)".*"countryName":"[^"]*".*/\1/p'|head -n1)
[[ -n $region ]]&&region=$(echo "$result2"|sed -n 's/.*"id":"\([^"]*\)".*"countryName":"[^"]*".*/\1/p'|head -n1)
result1=$(echo $result1|grep 'Oh no!')
result2=$(echo $result2|grep 'Oh no!')
if [ -n "$result1" ]&&[ -n "$result2" ];then
netflix[ustatus]="${smedia[org]}"
netflix[uregion]="  [$region]   "
netflix[utype]="$resultunlocktype"
return
fi
if [ -z "$result1" ]||[ -z "$result2" ];then
netflix[ustatus]="${smedia[yes]}"
netflix[uregion]="  [$region]   "
netflix[utype]="$resultunlocktype"
return
fi
netflix[ustatus]="${smedia[no]}"
netflix[uregion]="${smedia[nodata]}"
netflix[utype]="${smedia[nodata]}"
}
function MediaUnlockTest_YouTube_Premium(){
local temp_info="$Font_Cyan$Font_B${sinfo[media]}${Font_I}Youtube $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-8-${sinfo[lmedia]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
youtube=()
local checkunlockurl="www.youtube.com"
local result1=$(Check_DNS_1 $checkunlockurl)
local result3=$(Check_DNS_3 $checkunlockurl)
local resultunlocktype=$(Get_Unlock_Type $result1 $result3)
local tmpresult=$(curl $CurlARG -$1 --max-time 10 -sSL -H "Accept-Language: en" -b "YSC=BiCUU3-5Gdk; CONSENT=YES+cb.20220301-11-p0.en+FX+700; GPS=1; VISITOR_INFO1_LIVE=4VwPMkB7W5A; PREF=tz=Asia.Shanghai; _gcl_au=1.1.1809531354.1646633279" "https://www.youtube.com/premium" 2>&1)
if [[ $tmpresult == "curl"* ]];then
youtube[ustatus]="${smedia[bad]}"
youtube[uregion]="${smedia[nodata]}"
youtube[utype]="${smedia[nodata]}"
return
fi
local isCN=$(echo $tmpresult|grep 'www.google.cn')
if [ -n "$isCN" ];then
youtube[ustatus]="${smedia[cn]}"
youtube[uregion]="  $Font_Red[CN]$Font_Green   "
youtube[utype]="${smedia[nodata]}"
return
fi
local isNotAvailable=$(echo $tmpresult|grep 'Premium is not available in your country')
local region=$(echo $tmpresult|sed -n 's/.*"contentRegion":"\([^"]*\)".*/\1/p')
local isAvailable=$(echo $tmpresult|grep 'ad-free')
if [ -n "$isNotAvailable" ];then
youtube[ustatus]="${smedia[noprem]}"
youtube[uregion]="${smedia[nodata]}"
youtube[utype]="${smedia[nodata]}"
return
elif [ -n "$isAvailable" ]&&[ -n "$region" ];then
youtube[ustatus]="${smedia[yes]}"
youtube[uregion]="  [$region]   "
youtube[utype]="$resultunlocktype"
return
elif [ -z "$region" ]&&[ -n "$isAvailable" ];then
youtube[ustatus]="${smedia[yes]}"
youtube[uregion]="${smedia[nodata]}"
youtube[utype]="$resultunlocktype"
return
else
youtube[ustatus]="${smedia[bad]}"
youtube[uregion]="${smedia[nodata]}"
youtube[utype]="${smedia[nodata]}"
fi
}
function MediaUnlockTest_PrimeVideo_Region(){
local temp_info="$Font_Cyan$Font_B${sinfo[media]}${Font_I}Amazon $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-7-${sinfo[lmedia]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
amazon=()
local checkunlockurl="www.primevideo.com"
local result1=$(Check_DNS_1 $checkunlockurl)
local result3=$(Check_DNS_3 $checkunlockurl)
local resultunlocktype=$(Get_Unlock_Type $result1 $result3)
local tmpresult=$(curl $CurlARG -$1 --user-agent "$UA_Browser" -sL --max-time 10 "https://www.primevideo.com" 2>&1)
if [[ $tmpresult == "curl"* ]];then
amazon[ustatus]="${smedia[bad]}"
amazon[uregion]="${smedia[nodata]}"
amazon[utype]="${smedia[nodata]}"
return
fi
local result=$(echo $tmpresult|grep '"currentTerritory":'|sed 's/.*currentTerritory//'|cut -f3 -d'"'|head -n 1)
if [ -n "$result" ];then
amazon[ustatus]="${smedia[yes]}"
amazon[uregion]="  [$result]   "
amazon[utype]="$resultunlocktype"
return
else
amazon[ustatus]="${smedia[no]}"
amazon[uregion]="${smedia[nodata]}"
amazon[utype]="${smedia[nodata]}"
return
fi
}
function MediaUnlockTest_Reddit(){
local temp_info="$Font_Cyan$Font_B${sinfo[media]}${Font_I}Reddit $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-7-${sinfo[lmedia]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
reddit=()
local checkunlockurl="reddit.com"
local result1=$(Check_DNS_1 $checkunlockurl)
local result2=$(Check_DNS_2 $checkunlockurl)
local resultunlocktype=$(Get_Unlock_Type $result1 $result2)
local resp http_code html region
local resolve_opt=""
if [ "$1" = "6" ];then
local dual_ipv6
dual_ipv6=$(dig AAAA reddit.com +short|head -n 1)
[[ -z $dual_ipv6 ]]&&dual_ipv6=$(dig AAAA dualstack.reddit.map.fastly.net +short|head -n 1)
if [ -n "$dual_ipv6" ];then
resolve_opt="--resolve www.reddit.com:443:[$dual_ipv6]"
else
reddit[ustatus]="${smedia[bad]}"
reddit[uregion]="${smedia[nodata]}"
reddit[utype]="${smedia[nodata]}"
return
fi
fi
resp=$(curl $useNIC $usePROXY $xForward -$1 $ssll -fsL --user-agent "$UA_Browser" --max-time 10 $resolve_opt --write-out '\n%{http_code}' "https://www.reddit.com/")
http_code=$(printf '%s' "$resp"|tail -n 1|tr -d '\r')
html=$(printf '%s' "$resp"|sed '$d')
if [ "$http_code" = "200" ];then
region=$(printf '%s' "$html"|tr '\n' ' '|sed -n 's/.*country="\([^"]*\)".*/\1/p'|head -n 1)
fi
case "$http_code" in
000)reddit[ustatus]="${smedia[bad]}"
reddit[uregion]="${smedia[nodata]}"
reddit[utype]="${smedia[nodata]}"
;;
403)reddit[ustatus]="${smedia[no]}"
reddit[uregion]="${smedia[nodata]}"
reddit[utype]="${smedia[nodata]}"
;;
200)reddit[ustatus]="${smedia[yes]}"
reddit[uregion]="  [$region]   "
reddit[utype]="$resultunlocktype"
;;
*)reddit[ustatus]="${smedia[bad]}"
reddit[uregion]="${smedia[nodata]}"
reddit[utype]="${smedia[nodata]}"
esac
}
function OpenAITest(){
local temp_info="$Font_Cyan$Font_B${sinfo[ai]}${Font_I}ChatGPT $Font_Suffix"
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-8-${sinfo[lai]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
chatgpt=()
local checkunlockurl="chat.openai.com"
local result1=$(Check_DNS_1 $checkunlockurl)
local result2=$(Check_DNS_2 $checkunlockurl)
local result3=$(Check_DNS_3 $checkunlockurl)
local checkunlockurl="ios.chat.openai.com"
local result4=$(Check_DNS_1 $checkunlockurl)
local result5=$(Check_DNS_2 $checkunlockurl)
local result6=$(Check_DNS_3 $checkunlockurl)
local checkunlockurl="api.openai.com"
local result7=$(Check_DNS_1 $checkunlockurl)
local result8=$(Check_DNS_3 $checkunlockurl)
local resultunlocktype=$(Get_Unlock_Type $result1 $result2 $result3 $result4 $result5 $result6 $result7 $result8)
local tmpresult1=$(curl $CurlARG -$1 -sS --max-time 10 'https://api.openai.com/compliance/cookie_requirements' -H 'authority: api.openai.com' -H 'accept: */*' -H 'accept-language: zh-CN,zh;q=0.9' -H 'authorization: Bearer null' -H 'content-type: application/json' -H 'origin: https://platform.openai.com' -H 'referer: https://platform.openai.com/' -H 'sec-ch-ua: "Microsoft Edge";v="119", "Chromium";v="119", "Not?A_Brand";v="24"' -H 'sec-ch-ua-mobile: ?0' -H 'sec-ch-ua-platform: "Windows"' -H 'sec-fetch-dest: empty' -H 'sec-fetch-mode: cors' -H 'sec-fetch-site: same-site' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0' 2>&1)
local tmpresult2=$(curl $CurlARG -$1 -sS --max-time 10 'https://ios.chat.openai.com/' -H 'authority: ios.chat.openai.com' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' -H 'accept-language: zh-CN,zh;q=0.9' -H 'sec-ch-ua: "Microsoft Edge";v="119", "Chromium";v="119", "Not?A_Brand";v="24"' -H 'sec-ch-ua-mobile: ?0' -H 'sec-ch-ua-platform: "Windows"' -H 'sec-fetch-dest: document' -H 'sec-fetch-mode: navigate' -H 'sec-fetch-site: none' -H 'sec-fetch-user: ?1' -H 'upgrade-insecure-requests: 1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0' 2>&1)
local result1=$(echo $tmpresult1|grep unsupported_country)
local result2=$(echo $tmpresult2|grep VPN)
if [ -n "$result1" ];then
code=$(curl $CurlARG -$1 -o /dev/null -sS --max-time 10 \
'https://chatgpt.com/favicon.ico' \
-H 'accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8' \
-H 'authority: chatgpt.com' \
-H 'accept: */*' \
-H 'accept-language: zh-CN,zh;q=0.9' \
-H 'authorization: Bearer null' \
-H 'content-type: application/json' \
-H 'origin: https://chatgpt.com' \
-H 'referer: https://chatgpt.com/' \
-H 'sec-ch-ua: "Microsoft Edge";v="119", "Chromium";v="119", "Not?A_Brand";v="24"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "Windows"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-site' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0' \
-w "%{http_code}" 2>&1)
[[ $code != "403" ]]&&result1=""
fi
local countryCode="$(curl $CurlARG --max-time 10 -sS https://chat.openai.com/cdn-cgi/trace 2>&1|grep "loc="|awk -F= '{print $2}')"
if [ -z "$result2" ]&&[ -z "$result1" ]&&[[ $tmpresult1 != "curl"* ]]&&[[ $tmpresult2 != "curl"* ]];then
chatgpt[ustatus]="${smedia[yes]}"
chatgpt[uregion]="  [$countryCode]   "
chatgpt[utype]="$resultunlocktype"
elif [ -n "$result2" ]&&[ -n "$result1" ];then
chatgpt[ustatus]="${smedia[no]}"
chatgpt[uregion]="${smedia[nodata]}"
chatgpt[utype]="${smedia[nodata]}"
elif [ -z "$result1" ]&&[ -n "$result2" ]&&[[ $tmpresult1 != "curl"* ]];then
chatgpt[ustatus]="${smedia[web]}"
chatgpt[uregion]="  [$countryCode]   "
chatgpt[utype]="$resultunlocktype"
elif [ -n "$result1" ]&&[ -z "$result2" ];then
chatgpt[ustatus]="${smedia[app]}"
chatgpt[uregion]="  [$countryCode]   "
chatgpt[utype]="$resultunlocktype"
elif [[ $tmpresult1 == "curl"* ]]&&[ -n "$result2" ];then
chatgpt[ustatus]="${smedia[no]}"
chatgpt[uregion]="${smedia[nodata]}"
chatgpt[utype]="${smedia[nodata]}"
elif [[ $1 -eq 6 ]]&&[ -z "$result2" ]&&[[ $tmpresult2 != "curl"* ]];then
chatgpt[ustatus]="${smedia[yes]}"
chatgpt[uregion]="  [$countryCode]   "
chatgpt[utype]="$resultunlocktype"
else
chatgpt[ustatus]="${smedia[bad]}"
chatgpt[uregion]="${smedia[nodata]}"
chatgpt[utype]="${smedia[nodata]}"
fi
}
get_sorted_mx_records(){
local domain=$1
dig +short MX $domain|sort -n|head -1|awk '{print $2}'
}
check_email_service(){
local service=$1
local port=25
local expected_response="220"
local domain=""
local host=""
local response=""
local success="false"
case $service in
"Gmail")domain="gmail.com";;
"Outlook")domain="outlook.com";;
"Yahoo")domain="yahoo.com";;
"Apple")domain="me.com";;
"MailRU")domain="mail.ru";;
"AOL")domain="aol.com";;
"GMX")domain="gmx.com";;
"MailCOM")domain="mail.com";;
"163")domain="163.com";;
"Sohu")domain="sohu.com";;
"Sina")domain="sina.com";;
"QQ")domain="qq.com";;
*)return
esac
if [[ -z $host ]];then
local mx_hosts=($(get_sorted_mx_records $domain))
for host in "${mx_hosts[@]}";do
response=$(timeout 5 bash -c "echo -e 'QUIT\r\n' | nc -s $IP -w4 $host $port 2>&1")
smail_response[$service]=$response
if [[ $response == *"$expected_response"* ]];then
success="true"
smail[$service]="$Font_Black+$Font_Suffix$Back_Green$Font_White$Font_B$service$Font_Suffix"
smailstatus[$service]="true"
smail[remote]=1
break
fi
done
else
response=$(timeout 5 bash -c "echo -e 'QUIT\r\n' | nc -s $IP -w4 $host $port 2>&1")
if [[ $response == *"$expected_response"* ]];then
success="true"
smail[$service]="$Font_Black+$Font_Suffix$Back_Green$Font_White$Font_B$service$Font_Suffix"
smailstatus[$service]="true"
smail[remote]=1
fi
fi
if [[ $success == "false" ]];then
smail[$service]="$Font_Black-$Font_Suffix$Back_Red$Font_White$Font_B$service$Font_Suffix"
smailstatus[$service]="false"
fi
}
check_mail(){
ss -tano|grep -q ":25\b"&&smail[local]=2||smail[local]=0
if [[ smail[local] -ne 2 && -z $usePROXY ]];then
local response=$(timeout 10 bash -c "echo -e 'QUIT\r\n' | nc -s $IP -p25 -w9 smtp.mailgun.org 25 2>&1")
[[ $response == *"220"* ]]&&smail[local]=1
fi
[[ -n $usePROXY ]]&&smail[local]=0
smail[remote]=0
services=("Gmail" "Outlook" "Yahoo" "Apple" "QQ" "MailRU" "AOL" "GMX" "MailCOM" "163" "Sohu" "Sina")
for service in "${services[@]}";do
local temp_info="$Font_Cyan$Font_B${sinfo[mail]}$Font_I$service$Font_Suffix "
((ibar_step+=3))
show_progress_bar "$temp_info" $((40-1-${#service}-${sinfo[lmail]}))&
bar_pid="$!"&&disown "$bar_pid"
check_email_service $service
kill_progress_bar
done
}
check_dnsbl_parallel(){
ip_to_check=$1
parallel_jobs=$2
smail[t]=0
smail[c]=0
smail[m]=0
smail[b]=0
reversed_ip=$(echo "$ip_to_check"|awk -F. '{print $4"."$3"."$2"."$1}')
local total=0
local clean=0
local blacklisted=0
local other=0
curl $CurlARG -sL "${rawgithub}main/ref/dnsbl.list"|sort -u|xargs -P "$parallel_jobs" -I {} bash -c "result=\$(dig +short \"$reversed_ip.{}\" A); if [[ -z \"\$result\" ]]; then echo 'Clean'; elif [[ \"\$result\" == '127.0.0.2' ]]; then echo 'Blacklisted'; else echo 'Other'; fi"|{
while IFS= read -r line;do
((total++))
case "$line" in
"Clean")((clean++));;
"Blacklisted")((blacklisted++));;
*)((other++))
esac
done
smail[t]="$total"
smail[c]="$clean"
smail[m]="$other"
smail[b]="$blacklisted"
echo "${smail[t]} ${smail[c]} ${smail[m]} ${smail[b]}"
}
}
check_dnsbl(){
local temp_info="$Font_Cyan$Font_B${sinfo[dnsbl]} $Font_Suffix"
((ibar_step=95))
show_progress_bar "$temp_info" $((40-1-${sinfo[ldnsbl]}))&
bar_pid="$!"&&disown "$bar_pid"
trap "kill_progress_bar" RETURN
local num_array=($(check_dnsbl_parallel "$IP" 50))
smail[t]=${num_array[0]:-0}
smail[c]=${num_array[1]:-0}
smail[m]=${num_array[2]:-0}
smail[b]=${num_array[3]:-0}
smail[sdnsbl]="$Font_Cyan${smail[dnsbl]}  ${smail[available]}${smail[t]}   ${smail[clean]}${smail[c]}   ${smail[marked]}${smail[m]}   ${smail[blacklisted]}${smail[b]}$Font_Suffix"
}
show_head(){
echo -ne "\r$(printf '%72s'|tr ' ' '#')\n"
if [[ $mode_lite -eq 0 ]];then
if [ $fullIP -eq 1 ];then
calc_padding "$(printf '%*s' "${shead[ltitle]}" '')$IP" 72
echo -ne "\r$PADDING$Font_B${shead[title]}$Font_Cyan$IP$Font_Suffix\n"
else
calc_padding "$(printf '%*s' "${shead[ltitle]}" '')$IPhide" 72
echo -ne "\r$PADDING$Font_B${shead[title]}$Font_Cyan$IPhide$Font_Suffix\n"
fi
else
if [ $fullIP -eq 1 ];then
calc_padding "$(printf '%*s' "${shead[ltitle_lite]}" '')$IP" 72
echo -ne "\r$PADDING$Font_B${shead[title_lite]}$Font_Cyan$IP$Font_Suffix\n"
else
calc_padding "$(printf '%*s' "${shead[ltitle_lite]}" '')$IPhide" 72
echo -ne "\r$PADDING$Font_B${shead[title_lite]}$Font_Cyan$IPhide$Font_Suffix\n"
fi
fi
calc_padding "${shead[git]}" 72
echo -ne "\r$PADDING$Font_U${shead[git]}$Font_Suffix\n"
calc_padding "${shead[bash]}" 72
echo -ne "\r$PADDING${shead[bash]}\n"
echo -ne "\r${shead[ptime]}${shead[time]}  ${shead[ver]}\n"
echo -ne "\r$(printf '%72s'|tr ' ' '#')\n"
}
show_basic(){
echo -ne "\r${sbasic[title]}\n"
if [[ -n ${maxmind[asn]} && ${maxmind[asn]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[asn]}${Font_Green}AS${maxmind[asn]}$Font_Suffix\n"
echo -ne "\r$Font_Cyan${sbasic[org]}$Font_Green${maxmind[org]}$Font_Suffix\n"
else
echo -ne "\r$Font_Cyan${sbasic[asn]}${sbasic[noasn]}$Font_Suffix\n"
fi
if [[ ${maxmind[dms]} != "null" && ${maxmind[map]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[location]}$Font_Green${maxmind[dms]}$Font_Suffix\n"
echo -ne "\r$Font_Cyan${sbasic[map]}$Font_U$Font_Green${maxmind[map]}$Font_Suffix\n"
fi
local city_info=""
if [[ -n ${maxmind[sub]} && ${maxmind[sub]} != "null" ]];then
city_info+="${maxmind[sub]}"
fi
if [[ -n ${maxmind[city]} && ${maxmind[city]} != "null" ]];then
[[ -n $city_info ]]&&city_info+=", "
city_info+="${maxmind[city]}"
fi
if [[ -n ${maxmind[post]} && ${maxmind[post]} != "null" ]];then
[[ -n $city_info ]]&&city_info+=", "
city_info+="${maxmind[post]}"
fi
if [[ -n $city_info ]];then
echo -ne "\r$Font_Cyan${sbasic[city]}$Font_Green$city_info$Font_Suffix\n"
fi
if [[ -n ${maxmind[countrycode]} && ${maxmind[countrycode]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[country]}$Font_Green[${maxmind[countrycode]}]${maxmind[country]}$Font_Suffix"
if [[ -n ${maxmind[continentcode]} && ${maxmind[continentcode]} != "null" ]];then
echo -ne "$Font_Green, [${maxmind[continentcode]}]${maxmind[continent]}$Font_Suffix\n"
else
echo -ne "\n"
fi
elif [[ -n ${maxmind[continentcode]} && ${maxmind[continentcode]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[continent]}$Font_Green[${maxmind[continentcode]}]${maxmind[continent]}$Font_Suffix\n"
fi
if [[ -n ${maxmind[regcountrycode]} && ${maxmind[regcountrycode]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[regcountry]}$Font_Green[${maxmind[regcountrycode]}]${maxmind[regcountry]}$Font_Suffix\n"
fi
if [[ -n ${maxmind[timezone]} && ${maxmind[timezone]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[timezone]}$Font_Green${maxmind[timezone]}$Font_Suffix\n"
fi
if [[ -n ${maxmind[countrycode]} && ${maxmind[countrycode]} != "null" ]];then
if [ "${maxmind[countrycode]}" == "${maxmind[regcountrycode]}" ];then
echo -ne "\r$Font_Cyan${sbasic[type]}$Back_Green$Font_B$Font_White${sbasic[type0]}$Font_Suffix\n"
else
echo -ne "\r$Font_Cyan${sbasic[type]}$Back_Red$Font_B$Font_White${sbasic[type1]}$Font_Suffix\n"
fi
fi
}
show_basic_lite(){
echo -ne "\r${sbasic[title_lite]}\n"
if [[ -n ${ipinfo[asn]} && ${ipinfo[asn]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[asn]}${Font_Green}AS${ipinfo[asn]}$Font_Suffix\n"
echo -ne "\r$Font_Cyan${sbasic[org]}$Font_Green${ipinfo[org]}$Font_Suffix\n"
else
echo -ne "\r$Font_Cyan${sbasic[asn]}${sbasic[noasn]}$Font_Suffix\n"
fi
if [[ ${ipinfo[dms]} != "null" && ${ipinfo[map]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[location]}$Font_Green${ipinfo[dms]}$Font_Suffix\n"
echo -ne "\r$Font_Cyan${sbasic[map]}$Font_U$Font_Green${ipinfo[map]}$Font_Suffix\n"
fi
local city_info=""
if [[ -n ${ipinfo[sub]} && ${ipinfo[sub]} != "null" ]];then
city_info+="${ipinfo[sub]}"
fi
if [[ -n ${ipinfo[city]} && ${ipinfo[city]} != "null" ]];then
[[ -n $city_info ]]&&city_info+=", "
city_info+="${ipinfo[city]}"
fi
if [[ -n ${ipinfo[post]} && ${ipinfo[post]} != "null" ]];then
[[ -n $city_info ]]&&city_info+=", "
city_info+="${ipinfo[post]}"
fi
if [[ -n $city_info ]];then
echo -ne "\r$Font_Cyan${sbasic[city]}$Font_Green$city_info$Font_Suffix\n"
fi
if [[ -n ${ipinfo[countrycode]} && ${ipinfo[countrycode]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[country]}$Font_Green[${ipinfo[countrycode]}]${ipinfo[country]}$Font_Suffix"
if [[ -n ${ipinfo[continent]} && ${ipinfo[continent]} != "null" ]];then
echo -ne "$Font_Green, ${ipinfo[continent]}$Font_Suffix\n"
else
echo -ne "\n"
fi
elif [[ -n ${ipinfo[continent]} && ${ipinfo[continent]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[continent]}$Font_Green${ipinfo[continent]}$Font_Suffix\n"
fi
if [[ -n ${ipinfo[regcountrycode]} && ${ipinfo[regcountrycode]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[regcountry]}$Font_Green[${ipinfo[regcountrycode]}]${ipinfo[regcountry]}$Font_Suffix\n"
fi
if [[ -n ${ipinfo[timezone]} && ${ipinfo[timezone]} != "null" ]];then
echo -ne "\r$Font_Cyan${sbasic[timezone]}$Font_Green${ipinfo[timezone]}$Font_Suffix\n"
fi
if [[ -n ${ipinfo[countrycode]} && ${ipinfo[countrycode]} != "null" ]];then
if [ "${ipinfo[countrycode]}" == "${ipinfo[regcountrycode]}" ];then
echo -ne "\r$Font_Cyan${sbasic[type]}$Back_Green$Font_B$Font_White${sbasic[type0]}$Font_Suffix\n"
else
echo -ne "\r$Font_Cyan${sbasic[type]}$Back_Red$Font_B$Font_White${sbasic[type1]}$Font_Suffix\n"
fi
fi
}
show_type(){
echo -ne "\r${stype[title]}\n"
echo -ne "\r$Font_Cyan${stype[db]}$Font_I   IPinfo    ipregistry    ipapi    IP2Location   AbuseIPDB $Font_Suffix\n"
echo -ne "\r$Font_Cyan${stype[usetype]}$Font_Suffix${ipinfo[susetype]}${ipregistry[susetype]}${ipapi[susetype]}${ip2location[susetype]}${abuseipdb[susetype]}\n"
echo -ne "\r$Font_Cyan${stype[comtype]}$Font_Suffix${ipinfo[scomtype]}${ipregistry[scomtype]}${ipapi[scomtype]}${ip2location[scomtype]}\n"
}
show_type_lite(){
echo -ne "\r${stype[title]}\n"
echo -ne "\r$Font_Cyan${stype[db]}$Font_I   IPinfo    ipregistry    ipapi $Font_Suffix\n"
echo -ne "\r$Font_Cyan${stype[usetype]}$Font_Suffix${ipinfo[susetype]}${ipregistry[susetype]}${ipapi[susetype]}\n"
echo -ne "\r$Font_Cyan${stype[comtype]}$Font_Suffix${ipinfo[scomtype]}${ipregistry[scomtype]}${ipapi[scomtype]}\n"
}
sscore_text(){
local text="$1"
local p2=$2
local p3=$3
local p4=$4
local p5=$5
local p6=$6
local tmplen
local tmp
if ((p2>=p4));then
tmplen=$((49+15*(p2-p4)/(p5-p4)-p6))
elif ((p2>=p3));then
tmplen=$((33+16*(p2-p3)/(p4-p3)-p6))
elif ((p2>=0));then
tmplen=$((17+16*p2/p3-p6))
else
tmplen=0
fi
tmp=$(printf '%*s' $tmplen '')
local total_length=${#tmp}
local text_length=${#text}
local tmp1="${tmp:1:total_length-text_length}$text|"
sscore[text1]="${tmp1:1:16-p6}"
sscore[text2]="${tmp1:17-p6:16}"
sscore[text3]="${tmp1:33-p6:16}"
sscore[text4]="${tmp1:49-p6}"
}
show_score(){
echo -ne "\r${sscore[title]}\n"
echo -ne "\r${sscore[range]}\n"
if [[ -n ${ip2location[score]} && $mode_lite -eq 0 ]];then
sscore_text "${ip2location[score]}" ${ip2location[score]} 33 66 99 13
echo -ne "\r${Font_Cyan}IP2Location${sscore[colon]}$Font_White$Font_B${sscore[text1]}$Back_Green${sscore[text2]}$Back_Yellow${sscore[text3]}$Back_Red${sscore[text4]}$Font_Suffix${ip2location[risk]}\n"
fi
if [[ -n ${scamalytics[score]} ]];then
sscore_text "${scamalytics[score]}" ${scamalytics[score]} 20 60 100 13
echo -ne "\r${Font_Cyan}Scamalytics${sscore[colon]}$Font_White$Font_B${sscore[text1]}$Back_Green${sscore[text2]}$Back_Yellow${sscore[text3]}$Back_Red${sscore[text4]}$Font_Suffix${scamalytics[risk]}\n"
fi
if [[ -n ${ipapi[score]} ]];then
local tmp_score=$(echo "${ipapi[scorenum]} * 10000 / 1"|bc)
sscore_text "${ipapi[score]}" $tmp_score 85 300 10000 7
echo -ne "\r${Font_Cyan}ipapi${sscore[colon]}$Font_White$Font_B${sscore[text1]}$Back_Green${sscore[text2]}$Back_Yellow${sscore[text3]}$Back_Red${sscore[text4]}$Font_Suffix${ipapi[risk]}\n"
fi
if [[ $mode_lite -eq 0 ]];then
sscore_text "${abuseipdb[score]}" ${abuseipdb[score]} 25 25 100 11
[[ -n ${abuseipdb[score]} ]]&&echo -ne "\r${Font_Cyan}AbuseIPDB${sscore[colon]}$Font_White$Font_B${sscore[text1]}$Back_Green${sscore[text2]}$Back_Yellow${sscore[text3]}$Back_Red${sscore[text4]}$Font_Suffix${abuseipdb[risk]}\n"
if [ -n "${ipqs[score]}" ]&&[ "${ipqs[score]}" != "null" ];then
sscore_text "${ipqs[score]}" ${ipqs[score]} 75 85 100 6
echo -ne "\r${Font_Cyan}IPQS${sscore[colon]}$Font_White$Font_B${sscore[text1]}$Back_Green${sscore[text2]}$Back_Yellow${sscore[text3]}$Back_Red${sscore[text4]}$Font_Suffix${ipqs[risk]}\n"
fi
fi
sscore_text " " ${dbip[score]} 33 66 100 7
[[ -n ${dbip[risk]} ]]&&echo -ne "\r${Font_Cyan}DB-IP${sscore[colon]}$Font_White$Font_B${sscore[text1]}$Back_Green${sscore[text2]}$Back_Yellow${sscore[text3]}$Back_Red${sscore[text4]}$Font_Suffix${dbip[risk]}\n"
}
format_factor(){
local tmp_txt="  "
if [[ $1 == "true" ]];then
tmp_txt+="${sfactor[yes]}"
elif [[ $1 == "false" ]];then
tmp_txt+="${sfactor[no]}"
elif [ ${#1} -eq 2 ];then
tmp_txt+="$Font_Green[$1]$Font_Suffix"
else
tmp_txt+="${sfactor[na]}"
fi
tmp_txt+="    "
if [[ $2 == "true" ]];then
tmp_txt+="${sfactor[yes]}"
elif [[ $2 == "false" ]];then
tmp_txt+="${sfactor[no]}"
elif [ ${#2} -eq 2 ];then
tmp_txt+="$Font_Green[$2]$Font_Suffix"
else
tmp_txt+="${sfactor[na]}"
fi
tmp_txt+="    "
if [[ $3 == "true" ]];then
tmp_txt+="${sfactor[yes]}"
elif [[ $3 == "false" ]];then
tmp_txt+="${sfactor[no]}"
elif [ ${#3} -eq 2 ];then
tmp_txt+="$Font_Green[$3]$Font_Suffix"
else
tmp_txt+="${sfactor[na]}"
fi
tmp_txt+="    "
if [[ $4 == "true" ]];then
tmp_txt+="${sfactor[yes]}"
elif [[ $4 == "false" ]];then
tmp_txt+="${sfactor[no]}"
elif [ ${#4} -eq 2 ];then
tmp_txt+="$Font_Green[$4]$Font_Suffix"
else
tmp_txt+="${sfactor[na]}"
fi
if [[ $mode_lite -eq 0 ]];then
tmp_txt+="    "
if [[ $5 == "true" ]];then
tmp_txt+="${sfactor[yes]}"
elif [[ $5 == "false" ]];then
tmp_txt+="${sfactor[no]}"
elif [ ${#5} -eq 2 ];then
tmp_txt+="$Font_Green[$5]$Font_Suffix"
else
tmp_txt+="${sfactor[na]}"
fi
tmp_txt+="    "
if [[ $6 == "true" ]];then
tmp_txt+="${sfactor[yes]}"
elif [[ $6 == "false" ]];then
tmp_txt+="${sfactor[no]}"
elif [ ${#6} -eq 2 ];then
tmp_txt+="$Font_Green[$6]$Font_Suffix"
else
tmp_txt+="${sfactor[na]}"
fi
tmp_txt+="    "
if [[ $7 == "true" ]];then
tmp_txt+="${sfactor[yes]}"
elif [[ $7 == "false" ]];then
tmp_txt+="${sfactor[no]}"
elif [ ${#7} -eq 2 ];then
tmp_txt+="$Font_Green[$7]$Font_Suffix"
else
tmp_txt+="${sfactor[na]}"
fi
tmp_txt+="    "
if [[ $8 == "true" ]];then
tmp_txt+="${sfactor[yes]}"
elif [[ $8 == "false" ]];then
tmp_txt+="${sfactor[no]}"
elif [ ${#8} -eq 2 ];then
tmp_txt+="$Font_Green[$8]$Font_Suffix"
else
tmp_txt+="${sfactor[na]}"
fi
fi
echo "$tmp_txt"
}
show_factor(){
local tmp_factor=""
echo -ne "\r${sfactor[title]}\n"
echo -ne "\r$Font_Cyan${sfactor[factor]}${Font_I}IP2Location ipapi ipregistry IPQS Scamalytics ipdata IPinfo DB-IP$Font_Suffix\n"
tmp_factor=$(format_factor "${ip2location[countrycode]}" "${ipapi[countrycode]}" "${ipregistry[countrycode]}" "${ipqs[countrycode]}" "${scamalytics[countrycode]}" "${ipdata[countrycode]}" "${ipinfo[countrycode]}" "${dbip[countrycode]}")
echo -ne "\r$Font_Cyan${sfactor[countrycode]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ip2location[proxy]}" "${ipapi[proxy]}" "${ipregistry[proxy]}" "${ipqs[proxy]}" "${scamalytics[proxy]}" "${ipdata[proxy]}" "${ipinfo[proxy]}" "${dbip[proxy]}")
echo -ne "\r$Font_Cyan${sfactor[proxy]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ip2location[tor]}" "${ipapi[tor]}" "${ipregistry[tor]}" "${ipqs[tor]}" "${scamalytics[tor]}" "${ipdata[tor]}" "${ipinfo[tor]}" "${dbip[tor]}")
echo -ne "\r$Font_Cyan${sfactor[tor]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ip2location[vpn]}" "${ipapi[vpn]}" "${ipregistry[vpn]}" "${ipqs[vpn]}" "${scamalytics[vpn]}" "${ipdata[vpn]}" "${ipinfo[vpn]}" "${dbip[vpn]}")
echo -ne "\r$Font_Cyan${sfactor[vpn]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ip2location[server]}" "${ipapi[server]}" "${ipregistry[server]}" "${ipqs[server]}" "${scamalytics[server]}" "${ipdata[server]}" "${ipinfo[server]}" "${dbip[server]}")
echo -ne "\r$Font_Cyan${sfactor[server]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ip2location[abuser]}" "${ipapi[abuser]}" "${ipregistry[abuser]}" "${ipqs[abuser]}" "${scamalytics[abuser]}" "${ipdata[abuser]}" "${ipinfo[abuser]}" "${dbip[abuser]}")
echo -ne "\r$Font_Cyan${sfactor[abuser]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ip2location[robot]}" "${ipapi[robot]}" "${ipregistry[robot]}" "${ipqs[robot]}" "${scamalytics[robot]}" "${ipdata[robot]}" "${ipinfo[robot]}" "${dbip[robot]}")
echo -ne "\r$Font_Cyan${sfactor[robot]}$Font_Suffix$tmp_factor\n"
}
show_factor_lite(){
local tmp_factor=""
echo -ne "\r${sfactor[title]}\n"
echo -ne "\r$Font_Cyan${sfactor[factor]}$Font_I    ipapi ipregistry IPinfo DB-IP$Font_Suffix\n"
tmp_factor=$(format_factor "${ipapi[countrycode]}" "${ipregistry[countrycode]}" "${ipinfo[countrycode]}" "${dbip[countrycode]}")
echo -ne "\r$Font_Cyan${sfactor[countrycode]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ipapi[proxy]}" "${ipregistry[proxy]}" "${ipinfo[proxy]}" "${dbip[proxy]}")
echo -ne "\r$Font_Cyan${sfactor[proxy]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ipapi[tor]}" "${ipregistry[tor]}" "${ipinfo[tor]}" "${dbip[tor]}")
echo -ne "\r$Font_Cyan${sfactor[tor]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ipapi[vpn]}" "${ipregistry[vpn]}" "${ipinfo[vpn]}" "${dbip[vpn]}")
echo -ne "\r$Font_Cyan${sfactor[vpn]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ipapi[server]}" "${ipregistry[server]}" "${ipinfo[server]}" "${dbip[server]}")
echo -ne "\r$Font_Cyan${sfactor[server]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ipapi[abuser]}" "${ipregistry[abuser]}" "${ipinfo[abuser]}" "${dbip[abuser]}")
echo -ne "\r$Font_Cyan${sfactor[abuser]}$Font_Suffix$tmp_factor\n"
tmp_factor=$(format_factor "${ipapi[robot]}" "${ipregistry[robot]}" "${ipinfo[robot]}" "${dbip[robot]}")
echo -ne "\r$Font_Cyan${sfactor[robot]}$Font_Suffix$tmp_factor\n"
}
show_media(){
echo -ne "\r${smedia[title]}\n"
echo -ne "\r$Font_Cyan${smedia[meida]}$Font_I TikTok   Disney+  Netflix Youtube  AmazonPV  Reddit   ChatGPT $Font_Suffix\n"
echo -ne "\r$Font_Cyan${smedia[status]}${tiktok[ustatus]}${disney[ustatus]}${netflix[ustatus]}${youtube[ustatus]}${amazon[ustatus]}${reddit[ustatus]}${chatgpt[ustatus]}$Font_Suffix\n"
echo -ne "\r$Font_Cyan${smedia[region]}$Font_Green${tiktok[uregion]}${disney[uregion]}${netflix[uregion]}${youtube[uregion]}${amazon[uregion]}${reddit[uregion]}${chatgpt[uregion]}$Font_Suffix\n"
echo -ne "\r$Font_Cyan${smedia[type]}${tiktok[utype]}${disney[utype]}${netflix[utype]}${youtube[utype]}${amazon[utype]}${reddit[utype]}${chatgpt[utype]}$Font_Suffix\n"
}
show_mail(){
echo -ne "\r${smail[title]}\n"
if [ ${smail[local]} -eq 1 ];then
echo -ne "\r$Font_Cyan${smail[port]}$Font_Suffix${smail[yes]}\n"
elif [ ${smail[local]} -eq 2 ];then
echo -ne "\r$Font_Cyan${smail[port]}$Font_Suffix${smail[occupied]}\n"
else
echo -ne "\r$Font_Cyan${smail[port]}$Font_Suffix${smail[no]}\n"
fi
if [ ${smail[remote]} -eq 1 ];then
echo -ne "\r$Font_Cyan${smail[provider]}$Font_Suffix"
for service in "${services[@]}";do
echo -ne "${smail[$service]}"
done
echo ""
else
echo -ne "\r$Font_Cyan${smail[provider]}${smail[blocked]}$Font_Suffix\n"
fi
[[ $1 -eq 4 ]]&&echo -ne "\r${smail[sdnsbl]}\n"
}
show_tail(){
echo -ne "\r$(printf '%72s'|tr ' ' '=')\n"
echo -ne "\r$Font_I${stail[stoday]}${stail[today]}${stail[stotal]}${stail[total]}${stail[thanks]} $Font_Suffix\n"
echo -e ""
}
get_opts(){
while getopts "i:l:o:x:fhjnpyEM46" opt;do
case $opt in
4)if
[[ IPV4check -ne 0 ]]
then
IPV6check=0
else
ERRORcode=4
fi
;;
6)if
[[ IPV6check -ne 0 ]]
then
IPV4check=0
else
ERRORcode=6
fi
;;
f)fullIP=1
;;
h)show_help
;;
i)iface="$OPTARG"
useNIC=" --interface $iface"
CurlARG+="$useNIC"
get_ipv4
get_ipv6
is_valid_ipv4 $IPV4
is_valid_ipv6 $IPV6
[[ $IPV4work -eq 0 && $IPV6work -eq 0 ]]&&ERRORcode=7
;;
j)mode_json=1
;;
l)YY=$(echo "$OPTARG"|tr '[:upper:]' '[:lower:]')
;;
n)mode_no=1
;;
o)mode_output=1
outputfile="$OPTARG"
[[ -z $outputfile ]]&&{
ERRORcode=1
break
}
[[ -e $outputfile ]]&&{
ERRORcode=10
break
}
touch "$outputfile" 2>/dev/null||{
ERRORcode=11
break
}
;;
p)mode_privacy=1
;;
x)xproxy="$OPTARG"
usePROXY=" -x $xproxy"
CurlARG+="$usePROXY"
get_ipv4
get_ipv6
is_valid_ipv4 $IPV4
is_valid_ipv6 $IPV6
[[ $IPV4work -eq 0 && $IPV6work -eq 0 ]]&&ERRORcode=8
;;
y)mode_yes=1
;;
E)YY="en"
;;
M)mode_menu=1
;;
\?)ERRORcode=1
esac
done
if [[ $mode_menu -eq 1 ]];then
if [[ $YY == "cn" ]];then
eval "bash <(curl -sL https://Check.Place) -I"
else
eval "bash <(curl -sL https://Check.Place) -EI"
fi
exit 0
fi
[[ $IPV4check -eq 1 && $IPV6check -eq 0 && $IPV4work -eq 0 ]]&&ERRORcode=40
[[ $IPV4check -eq 0 && $IPV6check -eq 1 && $IPV6work -eq 0 ]]&&ERRORcode=60
CurlARG="$useNIC$usePROXY"
}
show_help(){
echo -ne "\r$shelp\n"
exit 0
}
show_ad(){
RANDOM=$(date +%s)
local -a ads=()
local i=1
while :;do
local content
content=$(curl -fsL --max-time 5 "${rawgithub}main/ref/ad$i.ans")||break
ads+=("$content")
((i++))
done
ADLines=0
local adCount=${#ads[@]}
[[ $adCount -eq 0 ]]&&return
local -a indices=()
for ((i=1; i<=adCount; i++));do indices+=("$i");done
for ((i=adCount-1; i>0; i--));do
local j=$((RANDOM%(i+1)))
local tmp=${indices[i]}
indices[i]=${indices[j]}
indices[j]=$tmp
done
local -a aad
aad[0]=$(curl -sL --max-time 5 "${rawgithub}main/ref/sponsor.ans")
for ((i=0; i<adCount; i++));do
aad[${indices[i]}]="${ads[i]}"
done
local rows cols
if ! read rows cols < <(stty size 2>/dev/null);then cols=0;fi
print_pair(){
local left="$1" right="$2"
local -a L R
mapfile -t L <<<"$left"
mapfile -t R <<<"$right"
local i
for ((i=0; i<12; i++));do
printf "%-72s$Font_Suffix     %-72s\n" "${L[i]}" "${R[i]}" 1>&2
done
ADLines=$((ADLines+12))
}
print_block(){
echo "$1" 1>&2
ADLines=$((ADLines+12))
}
if [[ $cols -ge 150 ]];then
if ((adCount==0));then
print_block "${aad[0]}"
elif ((adCount%2==1));then
print_pair "${aad[0]}" "${aad[1]}"
local k
for ((k=2; k<=adCount; k+=2));do
print_pair "${aad[$k]}" "${aad[$((k+1))]}"
done
else
print_block "${aad[0]}"
local k
for ((k=1; k<=adCount; k+=2));do
print_pair "${aad[$k]}" "${aad[$((k+1))]}"
done
fi
else
echo "${aad[0]}" 1>&2
for ((i=1; i<=adCount; i++));do
echo "${aad[$i]}" 1>&2
done
ADLines=$(((adCount+1)*12))
fi
}
read_ref(){
Media_Cookie=$(curl $CurlARG -sL --retry 3 --max-time 10 "${rawgithub}main/ref/cookies.txt")
IATA_Database="${rawgithub}main/ref/iata-icao.csv"
}
clean_ansi(){
local input="$1"
input=$(echo "$input"|sed 's/\\033/\x1b/g')
input=$(echo "$input"|sed 's/\x1b\[[0-9;]*m//g')
input=$(echo "$input"|sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
echo -n "$input"
}
factor_bool(){
local tmp_txt=""
if [[ $1 == "true" ]];then
tmp_txt+=".Factor |= . * { $3: { $2: true } } | "
elif [[ $1 == "false" ]];then
tmp_txt+=".Factor |= . * { $3: { $2: false } } | "
elif [ ${#1} -eq 2 ];then
tmp_txt+=".Factor |= . * { $3: { $2: \"$1\" } } | "
else
tmp_txt+=".Factor |= . * { $3: { $2: null } } | "
fi
[[ -z $tmp_txt ]]&&tmp_txt="null"
echo "$tmp_txt"
}
save_json(){
local head_updates=""
local basic_updates=""
local type_updates=""
local score_updates=""
local factor_updates=""
local media_updates=""
local mail_updates=""
if [ $fullIP -eq 1 ];then
head_updates+=".Head |= . + { IP: \"${IP:-null}\" } | "
else
head_updates+=".Head |= . + { IP: \"${IPhide:-null}\" } | "
fi
head_updates+=".Head |= . + { Command: \"${shead[bash]:-null}\" } | "
head_updates+=".Head |= . + { GitHub: \"${shead[git]:-null}\" } | "
head_updates+=".Head |= . + { Time: \"${shead[time_raw]:-null}\" } | "
head_updates+=".Head |= . + { Version: \"${script_version:-null}\" } | "
if [ $mode_lite -eq 0 ];then
basic_updates+=".Info |= . + { ASN: \"${maxmind[asn]:-null}\" } | "
basic_updates+=".Info |= . + { Organization: \"${maxmind[org]:-null}\" } | "
basic_updates+=".Info |= . + { Latitude: \"${maxmind[lat]:-null}\" } | "
basic_updates+=".Info |= . + { Longitude: \"${maxmind[lon]:-null}\" } | "
basic_updates+=".Info |= . + { DMS: \"${maxmind[dms]:-null}\" } | "
basic_updates+=".Info |= . + { Map: \"${maxmind[map]:-null}\" } | "
basic_updates+=".Info |= . + { TimeZone: \"${maxmind[timezone]:-null}\" } | "
basic_updates+=".Info |= . * { City: { Name: \"${maxmind[city]:-null}\" } } | "
basic_updates+=".Info |= . * { City: { PostalCode: \"${maxmind[post]:-null}\" } } | "
basic_updates+=".Info |= . * { City: { SubCode: \"${maxmind[subcode]:-null}\" } } | "
basic_updates+=".Info |= . * { City: { Subdivisions: \"${maxmind[sub]:-null}\" } } | "
basic_updates+=".Info |= . * { Region: { Code: \"${maxmind[countrycode]:-null}\" } } | "
basic_updates+=".Info |= . * { Region: { Name: \"${maxmind[country]:-null}\" } } | "
basic_updates+=".Info |= . * { Continent: { Code: \"${maxmind[continentcode]:-null}\" } } | "
basic_updates+=".Info |= . * { Continent: { Name: \"${maxmind[continent]:-null}\" } } | "
basic_updates+=".Info |= . * { RegisteredRegion: { Code: \"${maxmind[regcountrycode]:-null}\" } } | "
basic_updates+=".Info |= . * { RegisteredRegion: { Name: \"${maxmind[regcountry]:-null}\" } } | "
if [[ -n ${maxmind[countrycode]} && ${maxmind[countrycode]} != "null" ]];then
if [ "${maxmind[countrycode]}" == "${maxmind[regcountrycode]}" ];then
basic_updates+=".Info |= . + { Type: \"$(clean_ansi "${sbasic[type0]:-null}")\" } | "
else
basic_updates+=".Info |= . + { Type: \"$(clean_ansi "${sbasic[type1]:-null}")\" } | "
fi
else
basic_updates+='.Info |= . + { Type: "null" } | '
fi
else
basic_updates+=".Info |= . + { ASN: \"${ipinfo[asn]:-null}\" } | "
basic_updates+=".Info |= . + { Organization: \"${ipinfo[org]:-null}\" } | "
basic_updates+=".Info |= . + { Latitude: \"${ipinfo[lat]:-null}\" } | "
basic_updates+=".Info |= . + { Longitude: \"${ipinfo[lon]:-null}\" } | "
basic_updates+=".Info |= . + { DMS: \"${ipinfo[dms]:-null}\" } | "
basic_updates+=".Info |= . + { Map: \"${ipinfo[map]:-null}\" } | "
basic_updates+=".Info |= . + { TimeZone: \"${ipinfo[timezone]:-null}\" } | "
basic_updates+=".Info |= . * { City: { Name: \"${ipinfo[city]:-null}\" } } | "
basic_updates+=".Info |= . * { City: { PostalCode: \"${ipinfo[post]:-null}\" } } | "
basic_updates+='.Info |= . * { City: { SubCode: "null" } } | '
basic_updates+='.Info |= . * { City: { Subdivisions: "null" } } | '
basic_updates+=".Info |= . * { Region: { Code: \"${ipinfo[countrycode]:-null}\" } } | "
basic_updates+=".Info |= . * { Region: { Name: \"${ipinfo[country]:-null}\" } } | "
basic_updates+='.Info |= . * { Continent: { Code: "null" } } | '
basic_updates+=".Info |= . * { Continent: { Name: \"${ipinfo[continent]:-null}\" } } | "
basic_updates+=".Info |= . * { RegisteredRegion: { Code: \"${ipinfo[regcountrycode]:-null}\" } } | "
basic_updates+=".Info |= . * { RegisteredRegion: { Name: \"${ipinfo[regcountry]:-null}\" } } | "
if [[ -n ${ipinfo[countrycode]} && ${ipinfo[countrycode]} != "null" ]];then
if [ "${ipinfo[countrycode]}" == "${ipinfo[regcountrycode]}" ];then
basic_updates+=".Info |= . + { Type: \"$(clean_ansi "${sbasic[type0]:-null}")\" } | "
else
basic_updates+=".Info |= . + { Type: \"$(clean_ansi "${sbasic[type1]:-null}")\" } | "
fi
else
basic_updates+='.Info |= . + { Type: "null" } | '
fi
fi
type_updates+=".Type |= . * { Usage: { IPinfo: \"$(clean_ansi "${ipinfo[susetype]:-null}")\" } } | "
type_updates+=".Type |= . * { Usage: { ipregistry: \"$(clean_ansi "${ipregistry[susetype]:-null}")\" } } | "
type_updates+=".Type |= . * { Usage: { ipapi: \"$(clean_ansi "${ipapi[susetype]:-null}")\" } } | "
type_updates+=".Type |= . * { Usage: { AbuseIPDB: \"$(clean_ansi "${abuseipdb[susetype]:-null}")\" } } | "
type_updates+=".Type |= . * { Usage: { IP2LOCATION: \"$(clean_ansi "${ip2location[susetype]:-null}")\" } } | "
type_updates+=".Type |= . * { Company: { IPinfo: \"$(clean_ansi "${ipinfo[scomtype]:-null}")\" } } | "
type_updates+=".Type |= . * { Company: { ipregistry: \"$(clean_ansi "${ipregistry[scomtype]:-null}")\" } } | "
type_updates+=".Type |= . * { Company: { ipapi: \"$(clean_ansi "${ipapi[scomtype]:-null}")\" } } | "
score_updates+=".Score |= . + { IP2LOCATION: \"${ip2location[score]:-null}\" } | "
score_updates+=".Score |= . + { SCAMALYTICS: \"${scamalytics[score]:-null}\" } | "
score_updates+=".Score |= . + { ipapi: \"${ipapi[score]:-null}\" } | "
score_updates+=".Score |= . + { AbuseIPDB: \"${abuseipdb[score]:-null}\" } | "
score_updates+=".Score |= . + { IPQS: \"${ipapi[ipqs]:-null}\" } | "
score_updates+=".Score |= . + { DBIP: \"${dbip[score]:-null}\" } | "
factor_updates+=$(factor_bool "${ip2location[countrycode]}" "IP2LOCATION" "CountryCode")
factor_updates+=$(factor_bool "${ipapi[countrycode]}" "ipapi" "CountryCode")
factor_updates+=$(factor_bool "${ipregistry[countrycode]}" "ipregistry" "CountryCode")
factor_updates+=$(factor_bool "${ipqs[countrycode]}" "IPQS" "CountryCode")
factor_updates+=$(factor_bool "${scamalytics[countrycode]}" "SCAMALYTICS" "CountryCode")
factor_updates+=$(factor_bool "${ipdata[countrycode]}" "ipdata" "CountryCode")
factor_updates+=$(factor_bool "${ipinfo[countrycode]}" "IPinfo" "CountryCode")
factor_updates+=$(factor_bool "${ipwhois[countrycode]}" "IPWHOIS" "CountryCode")
factor_updates+=$(factor_bool "${dbip[countrycode]}" "DBIP" "CountryCode")
factor_updates+=$(factor_bool "${ip2location[proxy]}" "IP2LOCATION" "Proxy")
factor_updates+=$(factor_bool "${ipapi[proxy]}" "ipapi" "Proxy")
factor_updates+=$(factor_bool "${ipregistry[proxy]}" "ipregistry" "Proxy")
factor_updates+=$(factor_bool "${ipqs[proxy]}" "IPQS" "Proxy")
factor_updates+=$(factor_bool "${scamalytics[proxy]}" "SCAMALYTICS" "Proxy")
factor_updates+=$(factor_bool "${ipdata[proxy]}" "ipdata" "Proxy")
factor_updates+=$(factor_bool "${ipinfo[proxy]}" "IPinfo" "Proxy")
factor_updates+=$(factor_bool "${ipwhois[proxy]}" "IPWHOIS" "Proxy")
factor_updates+=$(factor_bool "${dbip[proxy]}" "DBIP" "Proxy")
factor_updates+=$(factor_bool "${ip2location[tor]}" "IP2LOCATION" "Tor")
factor_updates+=$(factor_bool "${ipapi[tor]}" "ipapi" "Tor")
factor_updates+=$(factor_bool "${ipregistry[tor]}" "ipregistry" "Tor")
factor_updates+=$(factor_bool "${ipqs[tor]}" "IPQS" "Tor")
factor_updates+=$(factor_bool "${scamalytics[tor]}" "SCAMALYTICS" "Tor")
factor_updates+=$(factor_bool "${ipdata[tor]}" "ipdata" "Tor")
factor_updates+=$(factor_bool "${ipinfo[tor]}" "IPinfo" "Tor")
factor_updates+=$(factor_bool "${ipwhois[tor]}" "IPWHOIS" "Tor")
factor_updates+=$(factor_bool "${dbip[tor]}" "DBIP" "Tor")
factor_updates+=$(factor_bool "${ip2location[vpn]}" "IP2LOCATION" "VPN")
factor_updates+=$(factor_bool "${ipapi[vpn]}" "ipapi" "VPN")
factor_updates+=$(factor_bool "${ipregistry[vpn]}" "ipregistry" "VPN")
factor_updates+=$(factor_bool "${ipqs[vpn]}" "IPQS" "VPN")
factor_updates+=$(factor_bool "${scamalytics[vpn]}" "SCAMALYTICS" "VPN")
factor_updates+=$(factor_bool "${ipdata[vpn]}" "ipdata" "VPN")
factor_updates+=$(factor_bool "${ipinfo[vpn]}" "IPinfo" "VPN")
factor_updates+=$(factor_bool "${ipwhois[vpn]}" "IPWHOIS" "VPN")
factor_updates+=$(factor_bool "${dbip[vpn]}" "DBIP" "VPN")
factor_updates+=$(factor_bool "${ip2location[server]}" "IP2LOCATION" "Server")
factor_updates+=$(factor_bool "${ipapi[server]}" "ipapi" "Server")
factor_updates+=$(factor_bool "${ipregistry[server]}" "ipregistry" "Server")
factor_updates+=$(factor_bool "${ipqs[server]}" "IPQS" "Server")
factor_updates+=$(factor_bool "${scamalytics[server]}" "SCAMALYTICS" "Server")
factor_updates+=$(factor_bool "${ipdata[server]}" "ipdata" "Server")
factor_updates+=$(factor_bool "${ipinfo[server]}" "IPinfo" "Server")
factor_updates+=$(factor_bool "${ipwhois[server]}" "IPWHOIS" "Server")
factor_updates+=$(factor_bool "${dbip[server]}" "DBIP" "Server")
factor_updates+=$(factor_bool "${ip2location[abuser]}" "IP2LOCATION" "Abuser")
factor_updates+=$(factor_bool "${ipapi[abuser]}" "ipapi" "Abuser")
factor_updates+=$(factor_bool "${ipregistry[abuser]}" "ipregistry" "Abuser")
factor_updates+=$(factor_bool "${ipqs[abuser]}" "IPQS" "Abuser")
factor_updates+=$(factor_bool "${scamalytics[abuser]}" "SCAMALYTICS" "Abuser")
factor_updates+=$(factor_bool "${ipdata[abuser]}" "ipdata" "Abuser")
factor_updates+=$(factor_bool "${ipinfo[abuser]}" "IPinfo" "Abuser")
factor_updates+=$(factor_bool "${ipwhois[abuser]}" "IPWHOIS" "Abuser")
factor_updates+=$(factor_bool "${dbip[abuser]}" "DBIP" "Abuser")
factor_updates+=$(factor_bool "${ip2location[robot]}" "IP2LOCATION" "Robot")
factor_updates+=$(factor_bool "${ipapi[robot]}" "ipapi" "Robot")
factor_updates+=$(factor_bool "${ipregistry[robot]}" "ipregistry" "Robot")
factor_updates+=$(factor_bool "${ipqs[robot]}" "IPQS" "Robot")
factor_updates+=$(factor_bool "${scamalytics[robot]}" "SCAMALYTICS" "Robot")
factor_updates+=$(factor_bool "${ipdata[robot]}" "ipdata" "Robot")
factor_updates+=$(factor_bool "${ipinfo[robot]}" "IPinfo" "Robot")
factor_updates+=$(factor_bool "${ipwhois[robot]}" "IPWHOIS" "Robot")
factor_updates+=$(factor_bool "${dbip[robot]}" "DBIP" "Robot")
media_updates+=".Media |= . * { TikTok: { Status: \"$(clean_ansi "${tiktok[ustatus]:-null}")\" } } | "
media_updates+=".Media |= . * { DisneyPlus: { Status: \"$(clean_ansi "${disney[ustatus]:-null}")\" } } | "
media_updates+=".Media |= . * { Netflix: { Status: \"$(clean_ansi "${netflix[ustatus]:-null}")\" } } | "
media_updates+=".Media |= . * { Youtube: { Status: \"$(clean_ansi "${youtube[ustatus]:-null}")\" } } | "
media_updates+=".Media |= . * { AmazonPrimeVideo: { Status: \"$(clean_ansi "${amazon[ustatus]:-null}")\" } } | "
media_updates+=".Media |= . * { Reddit: { Status: \"$(clean_ansi "${reddit[ustatus]:-null}")\" } } | "
media_updates+=".Media |= . * { ChatGPT: { Status: \"$(clean_ansi "${chatgpt[ustatus]:-null}")\" } } | "
media_updates+=".Media |= . * { TikTok: { Region: \"$(clean_ansi "${tiktok[uregion]//[][]/}")\" } } | "
media_updates+=".Media |= . * { DisneyPlus: { Region: \"$(clean_ansi "${disney[uregion]//[][]/}")\" } } | "
media_updates+=".Media |= . * { Netflix: { Region: \"$(clean_ansi "${netflix[uregion]//[][]/}")\" } } | "
media_updates+=".Media |= . * { Youtube: { Region: \"$(clean_ansi "${youtube[uregion]//[][]/}")\" } } | "
media_updates+=".Media |= . * { AmazonPrimeVideo: { Region: \"$(clean_ansi "${amazon[uregion]//[][]/}")\" } } | "
media_updates+=".Media |= . * { Reddit: { Region: \"$(clean_ansi "${reddit[uregion]//[][]/}")\" } } | "
media_updates+=".Media |= . * { ChatGPT: { Region: \"$(clean_ansi "${chatgpt[uregion]//[][]/}")\" } } | "
media_updates+=".Media |= . * { TikTok: { Type: \"$(clean_ansi "${tiktok[utype]:-null}")\" } } | "
media_updates+=".Media |= . * { DisneyPlus: { Type: \"$(clean_ansi "${disney[utype]:-null}")\" } } | "
media_updates+=".Media |= . * { Netflix: { Type: \"$(clean_ansi "${netflix[utype]:-null}")\" } } | "
media_updates+=".Media |= . * { Youtube: { Type: \"$(clean_ansi "${youtube[utype]:-null}")\" } } | "
media_updates+=".Media |= . * { AmazonPrimeVideo: { Type: \"$(clean_ansi "${amazon[utype]:-null}")\" } } | "
media_updates+=".Media |= . * { Reddit: { Type: \"$(clean_ansi "${reddit[utype]:-null}")\" } } | "
media_updates+=".Media |= . * { ChatGPT: { Type: \"$(clean_ansi "${chatgpt[utype]:-null}")\" } } | "
if [[ ${smail[local]} -eq 1 ]];then
mail_updates+=".Mail |= . + { Port25: true } | "
for service in "${services[@]}";do
if [[ ${smailstatus[$service]} == "true" ]];then
mail_updates+=".Mail |= . + { \"$service\": true } | "
else
mail_updates+=".Mail |= . + { \"$service\": false } | "
fi
done
elif [[ ${smail[local]} -eq 2 ]];then
mail_updates+=".Mail |= . + { Port25: null } | "
for service in "${services[@]}";do
mail_updates+=".Mail |= . + { \"$service\": null } | "
done
else
mail_updates+=".Mail |= . + { Port25: false } | "
for service in "${services[@]}";do
mail_updates+=".Mail |= . + { \"$service\": false } | "
done
fi
mail_updates+=".Mail |= . * { DNSBlacklist: { Total: ${smail[t]:-null} } } | "
mail_updates+=".Mail |= . * { DNSBlacklist: { Clean: ${smail[c]:-null} } } | "
mail_updates+=".Mail |= . * { DNSBlacklist: { Marked: ${smail[m]:-null} } } | "
mail_updates+=".Mail |= . * { DNSBlacklist: { Blacklisted: ${smail[b]:-null} } } | "
ipjson=$(echo "$ipjson"|jq "$head_updates$basic_updates$type_updates$score_updates$factor_updates$media_updates$mail_updates.")
}
check_IP(){
IP=$1
ibar_step=0
ipjson='{
      "Head": {},
      "Info": {},
      "Type": {},
      "Score": {},
      "Factor": {},
      "Media": {},
      "Mail": {}
    }'
[[ $2 -eq 4 ]]&&hide_ipv4 $IP
[[ $2 -eq 6 ]]&&hide_ipv6 $IP
countRunTimes
db_maxmind $2
db_ipinfo
[[ $mode_lite -eq 0 ]]&&db_scamalytics $2||scamalytics=()
db_ipregistry $2
db_ipapi $2
[[ $mode_lite -eq 0 ]]&&db_abuseipdb $2||abuseipdb=()
[[ $mode_lite -eq 0 ]]&&db_ip2location $2||ip2location=()
db_dbip
[[ $mode_lite -eq 0 ]]&&db_ipdata $2||ipdata=()
[[ $mode_lite -eq 0 ]]&&db_ipqs $2||ipqs=()
MediaUnlockTest_TikTok $2
MediaUnlockTest_DisneyPlus $2
MediaUnlockTest_Netflix $2
MediaUnlockTest_YouTube_Premium $2
MediaUnlockTest_PrimeVideo_Region $2
MediaUnlockTest_Reddit $2
OpenAITest $2
check_mail
[[ $2 -eq 4 ]]&&check_dnsbl "$IP" 50
echo -ne "$Font_LineClear" 1>&2
if [ $2 -eq 4 ]||[[ $IPV4work -eq 0 || $IPV4check -eq 0 ]];then
for ((i=0; i<ADLines; i++));do
echo -ne "$Font_LineUp" 1>&2
echo -ne "$Font_LineClear" 1>&2
done
fi
if [[ $mode_lite -eq 0 ]];then
local ip_report=$(show_head
show_basic
show_type
show_score
show_factor
show_media
show_mail $2
show_tail)
else
local ip_report=$(show_head
show_basic_lite
show_type_lite
show_score
show_factor_lite
show_media
show_mail $2
show_tail)
fi
local report_link=""
[[ mode_json -eq 1 || mode_output -eq 1 || mode_privacy -eq 0 ]]&&save_json
[[ $mode_lite -eq 0 && mode_privacy -eq 0 ]]&&report_link=$(curl -$2 -s -X POST https://upload.check.place -d "type=ip" --data-urlencode "json=$ipjson" --data-urlencode "content=$ip_report")
[[ mode_json -eq 0 ]]&&echo -ne "\r$ip_report\n"
[[ mode_json -eq 0 && mode_privacy -eq 0 && $report_link == *"https://Report.Check.Place/"* ]]&&echo -ne "\r${stail[link]}$report_link$Font_Suffix\n"
[[ mode_json -eq 1 ]]&&echo -ne "\r$ipjson\n"
echo -ne "\r\n"
if [[ mode_output -eq 1 ]];then
case "$outputfile" in
*.[aA][nN][sS][iI])echo "$ip_report" >>"$outputfile" 2>/dev/null
;;
*.[jJ][sS][oO][nN])echo "$ipjson" >>"$outputfile" 2>/dev/null
;;
*)echo -e "$ip_report"|sed 's/\x1b\[[0-9;]*[mGKHF]//g' >>"$outputfile" 2>/dev/null
esac
fi
}
generate_random_user_agent
adapt_locale
check_connectivity
read_ref
get_ipv4
get_ipv6
is_valid_ipv4 $IPV4
is_valid_ipv6 $IPV6
get_opts "$@"
[[ mode_no -eq 0 ]]&&install_dependencies 1>&2
set_language
if [[ $ERRORcode -ne 0 ]];then
echo -ne "\r$Font_B$Font_Red${swarn[$ERRORcode]}$Font_Suffix\n"
exit $ERRORcode
fi
clear
show_ad
[[ $IPV4work -ne 0 && $IPV4check -ne 0 ]]&&check_IP "$IPV4" 4
[[ $IPV6work -ne 0 && $IPV6check -ne 0 ]]&&check_IP "$IPV6" 6


================================================
FILE: ref/ad1.ans
================================================
LISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOST
LISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOST
LISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOST
LISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOST
LISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOST
LISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOST
LISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOST
LISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOST
LISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOST
LISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOSTLISAHOST
丽萨主机 Lisahost.com 港/台/美/新 ISP优质IP 优化线路 Tiktok运营 专业服务



================================================
FILE: ref/ad2.ans
================================================
VIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVI
RCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRC
SVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSV
IRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIR
CSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCS
VIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVI
RCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRC
SVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSV
IRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIRCSVIR
洛杉矶自有4公寓 部署120条住宅宽带 7320+美国本地IP 适合银行/TikTok 等场景
折扣码 VIRCS 下单享受终身95折优惠 https://www.vircs.com/promotion?code=6




================================================
FILE: ref/ad3.ans
================================================
RAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRA
PIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPI
DPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDP
ROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPRO
XYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXY
RAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRA
PIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPI
DPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDP
ROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPROXYRAPIDPRO
访问RapidProxy 7000万+高质量IP|免费测试|流量时效永久|支持HTTP(S)和SOCKS5
轻松采集 无惧CAPTCHA与IP封禁 https://www.rapidproxy.io/?ref=gitipquality


================================================
FILE: ref/ad4.ans
================================================
HNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHN
CLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCL
OUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOU
DHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDH
NCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNC
LOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLO
UDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUD
HNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHN
CLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCLOUDHNCL
华纳云 精品CN2GIA中国优化资源独享 安全稳定低延迟 香港/新/美/日多地点部署
https://www.hncloud.com/activity/activity_2026spring.html/?g=nodequality


================================================
FILE: ref/cookies.txt
================================================
grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&latitude=0&longitude=0&platform=browser&subject_token=DISNEYASSERTION&subject_token_type=urn%3Abamtech%3Aparams%3Aoauth%3Atoken-type%3Adevice
'authorization: Bearer ZGlzbmV5JmJyb3dzZXImMS4wLjA.Cu56AgSfBTDag5NiRA81oLHkDZfu5L3CKadnefEAY84'
"AMCVS_CFAF55745DD2611E0A495C82%40AdobeOrg=1; s_pvDate=2021%2F06%2F17; s_cc=true; wowow2_mem_guide=visited; wowow2_MGSID=4440260aa4011f0162393267600028772; wowow2_MGSID_AuthTicket=fd28d6b1349fd2e672af97370c4eaa4d42a4fdf2; demographics=01301; u-demographics=BAD81A3D84A07B32EC333E1BEFE72F10; wowow2_sls=1; wowow2_ext_MGSID=4440260aa4011f0162393267600028772; wod_auth=CfDJ8D-H-2bqdw1AjJk3TVDbKLaZydf2DfrFVw51ktRQdWqpml0TtbTZudBFfOd-ReyghPDX8aTlo8Ys_shmm-Nv7GBeFMrsM-pUufuTmiSYX7yEa5D9h6YDRA7OviqDLyAKDHUpZifwVToT1vKg_A9G1UMaS0exxBx_TcoOe9U_3Ex4HAb98A5106gj-6ztKoSPVxxKEneO1JdtLe3uVCZ_HMqh6oCeJCZvvlOVN_w_lECjchu58NGtZWmV3mE02DZ-SK5X6xT6GTetvr5EvFKJAxNfaNvkHoS_e-20dz-c-8huuTuvXTg3-i5OAQSyG5UQ_VRz-qqMVV-JR2xmRyxPuEifLU3Iy_B0IWvE65YZlexmL2KVEP745nB7-wCRuVzu9zEdO1IRHQ3fruQ_8RJqb0g; wod_secret=1e4c8db631cd4d2f986102a87811e8e5; s_ips=1010; s_sq=%5B%5BB%5D%5D; x_xsrf_token=1623934360j1T6bPwpGswOnPp3IrcHFZ5vPMo8LE; s_gpvPage=www%3Awowow%3Amember%3Alogin.php%3Ard%3Ahttps%3A%2B%2Bwww.wowow.co.jp%2Bsupport%2Bregist_self.php; s_tp=1010; s_ppv=www%253Awowow%253Amember%253Alogin.php%253Ard%253Ahttps%253A%2B%2Bwww.wowow.co.jp%2Bsupport%2Bregist_self.php%2C100%2C100%2C1010%2C1%2C1; s_nr365=1623934367877-Repeat; AMCV_CFAF55745DD2611E0A495C82%40AdobeOrg=-432600572%7CMCIDTS%7C18796%7CMCMID%7C30796674720677405047057880592301178864%7CMCOPTOUT-1623941567s%7CNONE%7CvVersion%7C4.5.2"
"Accept: application/json;pk=BCpkADawqM3ZdH8iYjCnmIpuIRqzCn12gVrtpk_qOePK3J9B6h7MuqOw5T_qIqdzpLvuvb_hTvu7hs-7NsvXnPTYKd9Cgw7YiwI9kFfOOCDDEr20WDEYMjGiLptzWouXXdfE996WWM8myP3Z"
{"device_identifier":"2B3BACF5B121715649E5D667D863612E:2ea6","deejay_device_id":190,"version":1,"all_cdn":true,"content_eab_id":"EAB::ea0def9a-afa3-4371-b126-964e1c6bea89::60515729::2000604","region":"US","xlink_support":false,"device_ad_id":"7DC1A194-92E0-117A-A072-E22535FD3B8D","limit_ad_tracking":false,"ignore_kids_block":false,"language":"en","guid":"2B3BACF5B121715649E5D667D863612E","rv":838281,"kv":451730,"unencrypted":true,"include_t2_revenue_beacon":"1","cp_session_id":"D5A29AC4-45C5-28EC-2D90-310D8B603665","interface_version":"1.11.0","network_mode":"wifi","play_intent":"resume","lat":23.1192247,"long":113.2199658,"playback":{"version":2,"video":{"codecs":{"values":[{"type":"H264","width":1920,"height":1080,"framerate":60,"level":"4.2","profile":"HIGH"}],"selection_mode":"ONE"}},"audio":{"codecs":{"values":[{"type":"AAC"}],"selection_mode":"ONE"}},"drm":{"values":[{"type":"WIDEVINE","version":"MODULAR","security_level":"L3"},{"type":"PLAYREADY","version":"V2","security_level":"SL2000"}],"selection_mode":"ALL"},"manifest":{"type":"DASH","https":true,"multiple_cdns":true,"patch_updates":true,"hulu_types":true,"live_dai":true,"multiple_periods":false,"xlink":false,"secondary_audio":true,"live_fragment_delay":3},"segments":{"values":[{"type":"FMP4","encryption":{"mode":"CENC","type":"CENC"},"https":true}],"selection_mode":"ONE"}}}
_h_csrf_id=7409960e2a4c5cacdf4ad0b40d02f1f419ec19a5cf5efde88838f56154d36dab; _hulu_uid=201194534; _hulu_e_id=f49WXX_ScBCK8xPpPfT7JA; _hulu_bluekai_hashed_uid=c0e4c9575742fe7542cbc0eb475f6585; _hulu_dt=CJDtoJLb0AF7xJTRQLO7v6aOJ7I-dqaPkHo8l6LPP1bcLnYA_A--PkyDXJwUJG3o0hWDnKkYILcL_%2FBrDxIXAlyoHDx14NHeeJfctC29Xzsx4tNJedYQZuy1w%2FZLgczSI3qt8nirWwAobE0wmi8OhdO_%2FLmh7Ln7bRqner5sqC0xIsSvDYv%2FkpKdrRyPCzLX0GNhWEcU1sjqGNJhcNySujfMh%2Fq%2FfTe6Gz9vb7rtjpGCRWKNdPWG3vSyNnOKd8J6HLZIWQpVkUuvYqF_D0HrdhVRRAEAu9cpfgW%2F_bPgaG_mWKAt3%2F9_iF0ksf1trvm4Vw01HA1ufRMi1kxTrMfcQ%2FRfmsIL0lVIoUPtdCNWJuQ_xyncNryUK27dYEBI1ZBKpVWk9QO_0F_6XtIjq2etmGLG98e%2Fx74yefigQ7aQACuedPlvDRHOm2Dx7ElxcIBzKGnOBtLt66wPzOHIxa94awZzpjhjBjEJ4JdhngP0DSsaFGzvzXlio9QivBgeAh8FgAl%2F3odQ8mLstQH1Cslz1NiPU9rruTuGmLASk%2F%2FLpYUyOYUOJl%2FfD7K02Xq7nF3MnWv4PTC79Gl5AoxZeGKy9WBFQAVCUKI6OYx_oc3I1McQXBNK1GFkegEHahWO7qUgA6547ucmytiM0llw%2Fyvv8M%2FTuIebc0fGdeV6Ym2AK5ElvBmqMCPVUTrAOP1qK8JC7CkZQ6Cm5U7qw8AEyRrpPfNqdZK00Abne0RAyrbthfzy7bfoMktRMqiP704AgaT3M_YRn9SshQ081Fx8uHI1GE5YmJvo7umw0ZtV0gGxXexxtaZQgqrAx75uyLoWyG2uvuvNCmufWvJrNJ9uEAiXIrghWdtQYYXqbVjFTa6gt4DKKpiDW_J39vf6EeSQyu0jCzlFYrVGmweLDbVXWLk_zeqUBzcbuB4-; _hulu_pid=201194639; _hulu_pname=Bill%20Gates; _hulu_is_p_kids=0; guid=051BDA2EDE200DE1E7C1E48FBE9BE703; AMCVS_0A19F13A598372E90A495D62%40AdobeOrg=1; _hulu_uname=Bill+Gates; _hulu_utype=plus%3Aios; _hulu_pgid=3; _hulu_plid=70828; _hulu_psh=0; _hulu_psvh=0; _csrf_id=75e11783d40cc993792dad9e0816af9443362c9b53e92ef7797f0355a8b95d68; s_cc=true; _hulu_assignments=eyJ2MSI6W3siZSI6OTc5LCJ0IjoyNjk3LCJuIjoiaHVsdV8xMzU3OF93ZWxjb21lX2Jfd2hpdGVfY3RhIn1dfQ%3D%3D; _hulu_hbc=1624194121035; _hulu_session=k2JE4gPqVlM3LtStdErz12jw0U8-lI3d5nWPy2Q8W4tMGGbtzg--atiahdg9XQKv5WqAhkS9t7POnyCifqFVkGE3tpGy6tEMl9UPrfBQ6_RsNDR%2FcGVnz%2FPILVruTsa58eLUq5zdtqFb9nNbvQ53lrRn3WYess8Gs1IMI6Hxj1Zkknh0FbxUcS18um%2FqAeWcyLKTSjJ_FtHwRBzw34fufh0UgyvdcygP_yif9jJ4vLy7W7vhyhRVS_9wLMi206arcdFKfgMNglamSjyxVcBJFEzs91vHiZyK0UEfnpzCpKCujWu38bUIiGbHfpR06kuQ4P80OBp7PXFZ5U3w%2FQT5PzfCdutdQoHbjqw_W8yCdwp0HTzdwmDuRCGKrqBk6KArHtLZA4zFAoovr_d9dKWsZDnWXMc4RjomDzNRP0cjyAa7vXnV_viWf3BoGRuuyBLEwEak%2Fj86fHOW1frY94bdSSQidgZck_8yKl6zHY8Uk_e_TMMrItdSRGO7NwkoWDjl_%2FtbTcahUBhHqVTSOTnVO3U1IzIWW3o8JA0568k92g5roSTKBI6EUD9SktBFcfrzPszL5CJtjt_FuWp9agQyLcQODapMEYhq9USPsnM9MWJatxpHhgY%2FlFmOdOx6z1QK8fBdYuWSK9ExYmr9xYh10DzsO7tYlJn0P6pq65Zv1_US61CVtsHNHOXr4DEsvWuAJGi17f6s2boUrKJiCIxQOuJMwZiJTpjkW2eTH3oeg4nisbUlnb15IrdMdtdwTG26vOGjG5ByHeXZ721mVZfNbm7ghx0nSrKLb_gmM0mdtUM9qyTSB_cyJM5aqQB2LctzuaEaIeLKkUIlXIPGsSiLSDmNX3HGRLdLKuQl1Yoq_7TNkv%2FRXN7t7ybUTTTo6cFsTp7JbbS4%2Ft3HT04m3jY9UhBN80l29hwft0M3eeE2tASFnn90KZs8jd43l0xHu4on9Vbsd2cjHbPi2FyF_utXqI0OUBAQltuNyC9mXW755KbryCErZnb7xkt3VrK5eqdPS70ZdLgfGtID4NGrPCCLgMsPEqNwK4pKbK1kH4exmksjDnwyj5YVIRYywj9LoipgKEnFJzD6IUqhB5ybA8bKLc8qFXPJbUZnmn_u6lEwtUh_heet1mu5; bm_mi=C7288944D1321EF6C7049F7B9FA20378~0QSp6QjTtRiEjeSjIpWX2cS6CplgPGcGlXazUQnps1dJF2Nv2BNe3oqUpw+u+oCKfOR1BMCbrHb3VOpz5cOed+rbDVzxclxodIKKJC/ZXNjTo15F5PC9vIkYqgNSAk5yU4gWV2SaLwT+JBsOydzNcPRwuY+z6+gkCw6eqGSQx0kZQfE/d+xMaJiStH+uUD6tNyCA4nIps5JpeEaNLzWjwuE4EaOuOCC8yZyLh7x8W0AsdEdkeEQEz1GLYgJmwnS0954PSECxwS5zQyqMB2vJSg==; ak_bmsc=72FC22728A28C7F3DC94376C9C3554F3~000000000000000000000000000000~YAAQTXZiaOhghx96AQAAWha6KQwV7/I2tiArb8nII7tGbF20EEmg3lH9OsRYJE/tzpyywpT3eeD2Td/IVRmVmurRrQ5Vp+YIs++zYbvI4XVQKXRtmv7mM0lDDhqOeR+dpM4CRBdT7Vv9eNYchfzID5cd7xzgYLqubfP70LR0zfaTubjfFdjMvawyOIQwAPfaErrsX0iiEpmy4G/nonxdTGB3bBQ7kAYoVpWAtAon8QoYoRx5HCjFzE/c7TKqZ/iDXcUq5tvZjptzNfnF5iChraxr5wlkiDh9eyWWCk/rTJozMeI1tX1HwH+In8iv4T7cTtZJh5MRq+IH/bXrwJtty51jvGu8B5mCaDUsHZKWRtEJpJMp7ta5o1nHrAQuiymFNRMEIPDqxDLbAA==; XSRF-TOKEN=8335e11a-8c68-483e-9a80-2d7f79856b44; AMCV_0A19F13A598372E90A495D62%40AdobeOrg=-408604571%7CMCIDTS%7C18799%7CMCMID%7C59607436576250353666502608938647993204%7CMCAID%7CNONE%7CMCOPTOUT-1624204908s%7CNONE%7CvVersion%7C4.6.0; bm_sv=A5945B0C79D7AA8B5A878BCDD21707C7~uii8SKBBdtZtDcwf0sopMCO3ldEL6L8p4F4PuMBF2DW9zw1kwgQO3b0dRgkojZaH5rNoMisLrt4Fz4c+JeL/zj4YKNr/3DOgt3wK7/tUvEZZPpLFFMlSPjel2Y7D3Gt7N8JMW42t9Gj2gAXFO4nCFA==; _hulu_metrics_context_v1_=%7B%22cookie_session_guid%22%3A%228d152d975a317957990c7d80022cd87c%22%2C%22referrer_url%22%3A%22%22%2C%22curr_page_uri%22%3A%22app%3Awatch%22%2C%22primary_ref_page_uri%22%3A%22urn%3Ahulu%3Ahub%3Ahome%22%2C%22secondary_ref_page_uri%22%3Anull%2C%22curr_page_type%22%3A%22watch%22%2C%22primary_ref_page_type%22%3A%22home%22%2C%22secondary_ref_page_type%22%3Anull%2C%22secondary_ref_click%22%3Anull%2C%22primary_ref_click%22%3A%22Demon%20Slayer%20Kimetsu%20No%20Yaiba%22%2C%22primary_ref_collection%22%3A%22282%22%2C%22secondary_ref_collection%22%3Anull%2C%22primary_ref_collection_source%22%3A%22heimdall%22%2C%22secondary_ref_collection_source%22%3Anull%2C%22ref_collection_position%22%3A0%7D; metrics_tracker_session_manager=%7B%22session_id%22%3A%22051BDA2EDE200DE1E7C1E48FBE9BE703-4040a0e1-3ec2-4b14-b7d2-85115b386d30%22%2C%22creation_time%22%3A1624197697579%2C%22visit_count%22%3A1%2C%22session_seq%22%3A11%2C%22idle_time%22%3A1624197708635%7D
{"query":"mutation refreshToken($input: RefreshTokenInput!) {\n            refreshToken(refreshToken: $input) {\n                activeSession {\n                    sessionId\n                }\n            }\n        }","variables":{"input":{"refreshToken":"eyJ6aXAiOiJERUYiLCJraWQiOiJLcTYtNW1Ia3BxOXdzLUtsSUUyaGJHYkRIZFduRjU3UjZHY1h6aFlvZi04IiwiY3R5IjoiSldUIiwiZW5jIjoiQzIwUCIsImFsZyI6ImRpciJ9..qnHbUZQXPtEv5n5s.kKfiwHFTT-u6b92OIDNGE8HBbJd_1EsCx3apaucHSvIj44bbLVvwDWkvtnD67qgtqY08_ohitM51nawYdPbLOE45hA2j7d7kaksYtDcj3rVg_Vys_Mxjs_HMdIDn8MdY71SqRl-f9848oDdzTrEswgW-fYqzWjY1Ur7mwmqDTumWWDhzjWCl_-aQWJuHp4CD8UdvfcIr7kVAbJR4_NL0VN69cYCMnBslxo53zNSc8v2MWYsENLxvpU1RD38EoJRjAWCYYmToeqNkxehEemn_qDJNxLdilp40ca4xcLCOCQgjl2hQnLDL4SFj6lIo1Gz2nWI8SOtQECia3Y9Rm778rjfPt2VYsmGux_rnRjipjiCnSSjy2VEjx
Download .txt
gitextract_n772nbuf/

├── .github/
│   └── FUNDING.yml
├── LICENSE
├── README.md
├── README_EN.md
├── ip.sh
├── ref/
│   ├── ad1.ans
│   ├── ad2.ans
│   ├── ad3.ans
│   ├── ad4.ans
│   ├── cookies.txt
│   ├── dnsbl.list
│   ├── iata-icao.csv
│   ├── iso3166.json
│   ├── sponsor.ans
│   └── upgrade_bash.sh
└── res/
    └── output.json
Condensed preview — 16 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,168K chars).
[
  {
    "path": ".github/FUNDING.yml",
    "chars": 950,
    "preview": "# These are supported funding model platforms\n\ngithub: xykt # Replace with up to 4 GitHub Sponsors-enabled usernames e.g"
  },
  {
    "path": "LICENSE",
    "chars": 34523,
    "preview": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C)"
  },
  {
    "path": "README.md",
    "chars": 7117,
    "preview": "<p align=\"center\">\n<img src=\"https://hits.xykt.de/ip.svg?action=view&count_bg=%2379C83D&title_bg=%23555555&title=Runs&ed"
  },
  {
    "path": "README_EN.md",
    "chars": 8934,
    "preview": "<p align=\"center\">\n<img src=\"https://hits.xykt.de/ip.svg?action=view&count_bg=%2379C83D&title_bg=%23555555&title=Runs&ed"
  },
  {
    "path": "ip.sh",
    "chars": 106492,
    "preview": "#!/bin/bash\nscript_version=\"v2026-03-13\"\ncheck_bash(){\ncurrent_bash_version=$(bash --version|head -n 1|awk -F ' ' '{for "
  },
  {
    "path": "ref/ad1.ans",
    "chars": 9635,
    "preview": "\u001b[48;2;0;0;0m\u001b[38;2;0;0;255mL\u001b[38;2;0;0;245mI\u001b[38;2;16;83;255mS\u001b[38;2;186;229;255mA\u001b[38;2;0;0;255mH\u001b[38;2;0;0;235mO\u001b[38;"
  },
  {
    "path": "ref/ad2.ans",
    "chars": 8610,
    "preview": "\u001b[38;2;0;141;188mV\u001b[38;2;0;192;241mI\u001b[38;2;255;255;255mRCS\u001b[38;2;0;244;255mV\u001b[38;2;0;142;54mI\u001b[38;2;255;255;0mR\u001b[38;2;25"
  },
  {
    "path": "ref/ad3.ans",
    "chars": 5562,
    "preview": "\u001b[38;2;255;37;0mR\u001b[38;2;255;38;0mA\u001b[38;2;255;51;0mP\u001b[38;2;255;47;0mI\u001b[38;2;255;46;0mD\u001b[38;2;255;80;0mP\u001b[38;2;255;82;0mR\u001b"
  },
  {
    "path": "ref/ad4.ans",
    "chars": 7988,
    "preview": "\u001b[38;2;112;0;255mHN\u001b[38;2;106;0;255mC\u001b[38;2;104;0;255mL\u001b[38;2;100;0;255mO\u001b[38;2;95;0;255mUD\u001b[38;2;119;0;255mH\u001b[38;2;0;0;"
  },
  {
    "path": "ref/cookies.txt",
    "chars": 19900,
    "preview": "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&latitude=0&longitude=0&platform=browser&subject_tok"
  },
  {
    "path": "ref/dnsbl.list",
    "chars": 9113,
    "preview": "0outspam.fusionzero.com\n0spam.fusionzero.com\n0spam-killlist.fusionzero.com\n0spamtrust.fusionzero.com\n0spamurl.fusionzero"
  },
  {
    "path": "ref/iata-icao.csv",
    "chars": 692256,
    "preview": "\"country_code\",\"region_name\",\"iata\",\"icao\",\"airport\",\"latitude\",\"longitude\"\r\n\"AE\",\"Abu Zaby\",\"AAN\",\"OMAL\",\"Al Ain Intern"
  },
  {
    "path": "ref/iso3166.json",
    "chars": 65311,
    "preview": "[{\"name\":\"Afghanistan\",\"alpha-2\":\"AF\",\"alpha-3\":\"AFG\",\"country-code\":\"004\",\"iso_3166-2\":\"ISO 3166-2:AF\",\"region\":\"Asia\","
  },
  {
    "path": "ref/sponsor.ans",
    "chars": 8559,
    "preview": "\u001b[48;2;0;0;0m\u001b[38;2;0;140;249mS\u001b[38;2;0;136;255mP\u001b[38;2;0;139;255mO\u001b[38;2;0;138;255mN\u001b[38;2;0;132;255mS\u001b[38;2;0;127;255m"
  },
  {
    "path": "ref/upgrade_bash.sh",
    "chars": 2598,
    "preview": "#!/bin/bash\nupgrade_bash() {\n    # 检查当前的 Bash 版本\n    current_bash_version=$(bash --version | head -n 1 | awk -F ' ' '{fo"
  },
  {
    "path": "res/output.json",
    "chars": 3998,
    "preview": "{\n  \"Head\": {\n    \"IP\": \"36.235.*.*\",\n    \"Command\": \"bash <(curl -sL https://Check.Place) -EI\",\n    \"GitHub\": \"https://"
  }
]

About this extraction

This page contains the full source code of the xykt/IPQuality GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 16 files (968.3 KB), approximately 370.4k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!