661
LICENSE
Normal file
|
|
@ -0,0 +1,661 @@
|
|||
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/>.
|
||||
20
README.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<h1 align="center">FbIN-LibreY</h1>
|
||||
|
||||
> FbIN-LibreY is a fork of LibreX, a framework-less and javascript-free privacy respecting meta search engine, made by [hnhx](https://github.com/hnhx). FbIN-LibreY changed some features like automatic redirection (now instance fallback), added scrapers for more search engines and various other changes. The original code is written by [hnhx and contributors](https://github.com/hnhx/LibreX/contributors)
|
||||
|
||||
### How to host FbIN-LibreY
|
||||
|
||||
[This section has been moved](https://git.flossboxin.org.in/FbIN/LibreY/src/branch/main/docs) to clear up some README space.
|
||||
|
||||
### About FbIN-LibreY
|
||||
|
||||
FbIN-LibreY gives you text results from Google, DuckDuckGo, Brave Search, Ecosia, Yandex Search and Mojeek. LibreY provides images from Qwant, and torrents from i.e. Ahmia and popular torrent sites. FbIN-LibreY does this without spying on you.
|
||||
<br>FbIN-LibreY doesn't save **any** type of data about the user, there are no logs (except NGINX logs if the host sets them).
|
||||
|
||||
### FbIN-LibreY compared to other metasearch engines
|
||||
|
||||
| Name | Works without JS | Privacy frontend redirect | Torrent results | API | No 3rd party libs used |
|
||||
| ------------ | -------------------- | ------------------------- | --------------- | --- | ---------------------- |
|
||||
| FbIN-LibreY | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| SearXNG | ❓ Not user friendly | ❓ Only host can set it | ✅ | ✅ | ❌ |
|
||||
| Whoogle | ✅ | ❓ Only host can set it | ❌ | ❌ | ❌ |
|
||||
9
SECURITY.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Basically the latest commit. We don't really do versioning with FbIN-LibreY.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please email me; dev *at* flossboxin *dot* org *dot* in
|
||||
32
api.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
require_once "misc/search_engine.php";
|
||||
require_once "locale/localization.php";
|
||||
|
||||
$opts = load_opts();
|
||||
if ($opts->disable_api) {
|
||||
echo "<p>" . TEXTS["api_unavailable"] . "</p>";
|
||||
die();
|
||||
}
|
||||
|
||||
require_once "misc/tools.php";
|
||||
|
||||
if (!$opts->query) {
|
||||
echo "<p>Example API request: <a href=\"./api.php?q=gentoo&p=2&t=0\">./api.php?q=gentoo&p=2&t=0</a></p>
|
||||
<br/>
|
||||
<p>\"q\" is the keyword</p>
|
||||
<p>\"p\" is the result page (the first page is 0)</p>
|
||||
<p>\"t\" is the search type (0=text, 1=image, 2=video, 3=torrent, 4=tor)</p>
|
||||
<br/>
|
||||
<p>The results are going to be in JSON format.</p>
|
||||
<p>The API supports both POST and GET requests.</p>";
|
||||
|
||||
die();
|
||||
}
|
||||
|
||||
$results = fetch_search_results($opts, false);
|
||||
if (array_key_exists("error", $results)) {
|
||||
http_response_code(500);
|
||||
}
|
||||
header("Content-Type: application/json");
|
||||
echo json_encode($results);
|
||||
?>
|
||||
6
auto_updater.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
while true; do
|
||||
git stash
|
||||
git pull
|
||||
sleep 60
|
||||
done
|
||||
173
config.php
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
<?php
|
||||
return (object) array(
|
||||
|
||||
// e.g.: fr -> https://google.fr/
|
||||
"google_domain" => "com",
|
||||
|
||||
// Results will be in this language
|
||||
"language" => "",
|
||||
"number_of_results" => 20,
|
||||
|
||||
// The default theme css to use
|
||||
// use `ls --ignore={styles,auto}.css static/css | cut -d. -f1` to list valid themes
|
||||
"default_theme" => "catppuccin_macchiato",
|
||||
|
||||
// You can use any Invidious instance here (alternate instance: https://invidious.perennialte.ch)
|
||||
"invidious_instance_for_video_results" => "https://inv.nadeko.net",
|
||||
|
||||
// Fallback tracker list: https://git.flossboxin.org.in/FbIN/trackerslist/raw/branch/master/trackers_best.txt
|
||||
"disable_bittorrent_search" => false,
|
||||
// "bittorrent_trackers" => "&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://open.stealth.si:80/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://exodus.desync.com:6969/announce&tr=udp://tracker.torrent.eu.org:451/announce",
|
||||
"bittorrent_trackers" => "&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://open.tracker.cl:1337/announce&tr=udp://tracker.torrent.eu.org:451/announce&tr=udp://open.stealth.si:80/announce&tr=udp://explodie.org:6969/announce&tr=udp://exodus.desync.com:6969/announce&tr=udp://tracker.tiny-vps.com:6969/announce&tr=udp://open.free-tracker.ga:6969/announce&tr=http://t.jaekr.sh:6969/announce&tr=http://shubt.net:2710/announce&tr=http://share.hkg-fansub.info:80/announce.php&tr=http://servandroidkino.ru:80/announce&tr=http://retracker.spark-rostov.ru:80/announce&tr=http://home.yxgz.club:6969/announce&tr=http://finbytes.org:80/announce.php&tr=http://0123456789nonexistent.com:80/announce&tr=udp://wepzone.net:6969/announce&tr=udp://ttk2.nbaonlineservice.com:6969/announce&tr=udp://tracker2.dler.org:80/announce&tr=udp://tracker.tryhackx.org:6969/announce",
|
||||
|
||||
"disable_hidden_service_search" => false,
|
||||
|
||||
// Fallback to another librex instance if google search fails
|
||||
// More instances for services can be found here: https://perennialte.ch/services/#alternative-front-ends
|
||||
// This may greatly increase the time it takes to get a result, if a direct search is not possible
|
||||
"instance_fallback" => true,
|
||||
|
||||
// how long in minutes to put google/other instances on cooldown if they aren't responding
|
||||
"request_cooldown" => 25,
|
||||
|
||||
// how long in minutes to store results for in the cache, set -1 to disable cache
|
||||
"cache_time" => 20,
|
||||
|
||||
// Disable requests to /api.php - HIGHLY recommended to keep this at false, this is what allows FbIN-LibreY to still show results when Google/DuckDuckGo blocks the requests.
|
||||
"disable_api" => false,
|
||||
|
||||
// whether to show where the result is from on the results page
|
||||
"show_result_source" => true,
|
||||
|
||||
/*
|
||||
Preset privacy friendly frontends for users, these can be overwritten by users in the settings
|
||||
e.g.: Preset the invidious instance URL: "instance_url" => "https://inv.nadeko.net",
|
||||
*/
|
||||
|
||||
"frontends" => array(
|
||||
"invidious" => array(
|
||||
"instance_url" => "https://inv.nadeko.net",
|
||||
"project_url" => "https://docs.invidious.io/instances/",
|
||||
"original_name" => "YouTube",
|
||||
"original_url" => "youtube.com"
|
||||
),
|
||||
"rimgo" => array(
|
||||
"instance_url" => "https://ri.nadeko.net",
|
||||
"project_url" => "https://codeberg.org/video-prize-ranch/rimgo#instances",
|
||||
"original_name" => "Imgur",
|
||||
"original_url" => "imgur.com"
|
||||
),
|
||||
"scribe" => array(
|
||||
"instance_url" => "https://scribe.rip",
|
||||
"project_url" => "https://git.sr.ht/~edwardloveall/scribe/tree/main/docs/instances.md",
|
||||
"original_name" => "Medium",
|
||||
"original_url" => "medium.com"
|
||||
),
|
||||
"gothub" => array(
|
||||
"instance_url" => "",
|
||||
"project_url" => "https://codeberg.org/gothub/gothub#instances",
|
||||
"original_name" => "GitHub",
|
||||
"original_url" => "github.com"
|
||||
),
|
||||
"nitter" => array(
|
||||
"instance_url" => "https://xcancel.com",
|
||||
"project_url" => "https://github.com/zedeus/nitter/wiki/Instances",
|
||||
"original_name" => "Twitter",
|
||||
"original_url" => "twitter.com"
|
||||
),
|
||||
|
||||
"redlib" => array(
|
||||
"instance_url" => "https://redlib.nadeko.net",
|
||||
"project_url" => "https://github.com/redlib-org/redlib-instances/blob/main/instances.md",
|
||||
"original_name" => "Reddit",
|
||||
"original_url" => "reddit.com"
|
||||
),
|
||||
"proxitok" => array(
|
||||
"instance_url" => "",
|
||||
"project_url" => "https://github.com/pablouser1/ProxiTok/wiki/Public-instances",
|
||||
"original_name" => "TikTok",
|
||||
"original_url" => "tiktok.com"
|
||||
),
|
||||
"wikiless" => array(
|
||||
"instance_url" => "https://wl.vern.cc",
|
||||
"project_url" => "https://github.com/Metastem/wikiless",
|
||||
"original_name" => "Wikipedia",
|
||||
"original_url" => "wikipedia.org"
|
||||
),
|
||||
"quetre" => array(
|
||||
"instance_url" => "https://quetre.pussthecat.org",
|
||||
"project_url" => "https://github.com/zyachel/quetre#instances",
|
||||
"original_name" => "Quora",
|
||||
"original_url" => "quora.com"
|
||||
),
|
||||
"libremdb" => array(
|
||||
"instance_url" => "https://libremdb.pussthecat.org",
|
||||
"project_url" => "https://github.com/zyachel/libremdb#instances",
|
||||
"original_name" => "IMDb",
|
||||
"original_url" => "imdb.com"
|
||||
),
|
||||
"breezewiki" => array(
|
||||
"instance_url" => "https://breezewiki.nadeko.net",
|
||||
"project_url" => "https://docs.breezewiki.com/Links.html",
|
||||
"original_name" => "Fandom",
|
||||
"original_url" => "fandom.com"
|
||||
),
|
||||
"anonymousoverflow" => array(
|
||||
"instance_url" => "https://overflow.adminforge.de",
|
||||
"project_url" => "https://github.com/httpjamesm/AnonymousOverflow?tab=readme-ov-file#instances",
|
||||
"original_name" => "StackOverflow",
|
||||
"original_url" => "stackoverflow.com"
|
||||
),
|
||||
"suds" => array(
|
||||
"instance_url" => "https://sd.vern.cc",
|
||||
"project_url" => "https://git.vern.cc/cobra/Suds/src/branch/main/instances.json",
|
||||
"original_name" => "Snopes",
|
||||
"original_url" => "snopes.com"
|
||||
),
|
||||
"biblioreads" => array(
|
||||
"instance_url" => "https://bl.vern.cc",
|
||||
"project_url" => "https://github.com/nesaku/BiblioReads#instances",
|
||||
"original_name" => "Goodreads",
|
||||
"original_url" => "goodreads.com"
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
"preferred_engines" => array(
|
||||
/* search engine to use to search, auto will automatically balance between all scrapers, which is recommended. */
|
||||
"text" => "auto"
|
||||
// "text" => "google"
|
||||
// "text" => "duckduckgo"
|
||||
),
|
||||
|
||||
|
||||
/*
|
||||
To send requests through a proxy uncomment CURLOPT_PROXY and CURLOPT_PROXYTYPE:
|
||||
|
||||
CURLOPT_PROXYTYPE options:
|
||||
|
||||
CURLPROXY_HTTP
|
||||
CURLPROXY_SOCKS4
|
||||
CURLPROXY_SOCKS4A
|
||||
CURLPROXY_SOCKS5
|
||||
CURLPROXY_SOCKS5_HOSTNAME
|
||||
|
||||
!!! ONLY CHANGE THE OTHER OPTIONS IF YOU KNOW WHAT YOU ARE DOING !!!
|
||||
*/
|
||||
"curl_settings" => array(
|
||||
// CURLOPT_PROXY => "ip:port",
|
||||
// CURLOPT_PROXYTYPE => CURLPROXY_HTTP,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => "",
|
||||
CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0", // For a normal Windows 10 PC running Firefox x64
|
||||
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_WHATEVER,
|
||||
CURLOPT_CUSTOMREQUEST => "GET",
|
||||
CURLOPT_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP,
|
||||
CURLOPT_REDIR_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP,
|
||||
CURLOPT_MAXREDIRS => 5,
|
||||
CURLOPT_TIMEOUT => 5,
|
||||
CURLOPT_VERBOSE => false,
|
||||
CURLOPT_FOLLOWLOCATION => true
|
||||
)
|
||||
);
|
||||
?>
|
||||
75
docs/README.md
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
# Installing
|
||||
|
||||
To host FbIN-LibreY using your OS's native package manager and PHP+NGINX, you can use the following steps as a guide.
|
||||
|
||||
These instructions are specific to Debian GNU/Linux but should be similar on most *nix variants (differences may include commands for package management, init system, php-fpm.sock location and availability of fastcgi-php.conf)
|
||||
|
||||
Install the packages (Debian GNU/Linux):
|
||||
|
||||
```sh
|
||||
apt install php php-fpm php-dom php-curl php-apcu nginx git
|
||||
```
|
||||
|
||||
Install the packages (Arch Linux):
|
||||
```sh
|
||||
pacman -S php php-fpm php-apcu nginx git
|
||||
```
|
||||
|
||||
Clone FbIN-LibreY:
|
||||
|
||||
```sh
|
||||
mkdir -p /var/www/html
|
||||
git clone https://git.flossboxin.org.in/FbIN/LibreY.git /var/www/html/LibreY
|
||||
```
|
||||
|
||||
Rename the config and opensearch files, edit manually if needed:
|
||||
|
||||
```sh
|
||||
cd /var/www/html/LibreY/
|
||||
mv config.php.example config.php
|
||||
mv opensearch.xml.example opensearch.xml
|
||||
```
|
||||
|
||||
Change opensearch.xml to point to your domain:
|
||||
|
||||
```sh
|
||||
sed -i 's/http:\/\/localhost:80/https:\/\/your.domain/g' opensearch.xml
|
||||
```
|
||||
|
||||
An nginx configuration similar to the one below should be placed in your `http { ... }` block or a file that is automatically detected as such.
|
||||
|
||||
```sh
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
server_name your.domain;
|
||||
|
||||
root /var/www/html/LibreY;
|
||||
index index.php;
|
||||
|
||||
location ~ \.php$ {
|
||||
include snippets/fastcgi-php.conf;
|
||||
fastcgi_pass unix:/run/php/php-fpm.sock;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can optionally remove the .php extension in URLs by adding this code your `server { ... }` block.
|
||||
|
||||
```sh
|
||||
location / {
|
||||
try_files $uri $uri/ @extensionless-php;
|
||||
}
|
||||
|
||||
location @extensionless-php {
|
||||
rewrite ^(.*)$ $1.php last;
|
||||
}
|
||||
```
|
||||
|
||||
Start php-fpm and nginx immediately and on every boot:
|
||||
|
||||
```sh
|
||||
systemctl enable --now php-fpm nginx
|
||||
```
|
||||
|
||||
Now FbIN-LibreY should be running at the port you specified!
|
||||
62
docs/system-tor-proxy.md
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
> [!IMPORTANT]
|
||||
> Please note that this heavily relies on [@codedipper](https://github.com/codedipper)'s [work and is basically a copy of his wiki](https://github.com/codedipper/LibreY-Tor/wiki/LibreY-Tor-Proxy-‐-System-tor).
|
||||
|
||||
0. This was tested on an Arch Linux setup, packages `base` and `tor` must be installed to get the proxy working.\
|
||||
FbIN-LibreY has other requirements as well.\
|
||||
Slight differences in Tor configurations may be needed across different systems.
|
||||
|
||||
1. Create `/etc/tor/torrc` and edit it to your liking
|
||||
```
|
||||
SOCKSPort 127.0.0.1:9050
|
||||
SOCKSPolicy accept 127.0.0.1/32
|
||||
SOCKSPolicy reject *
|
||||
|
||||
DataDirectory /var/lib/tor
|
||||
User tor
|
||||
|
||||
Log notice stdout
|
||||
RunAsDaemon 0
|
||||
|
||||
# UseBridges 1
|
||||
# Bridge xx.xxx.xxx.xxx:xx
|
||||
```
|
||||
|
||||
2. Secure directory permissions
|
||||
```
|
||||
chown -R tor: /usr/share/tor
|
||||
chown -R tor: /var/lib/tor
|
||||
chown -R tor: /etc/tor
|
||||
chmod -R 0700 /usr/share/tor
|
||||
chmod -R 0700 /var/lib/tor
|
||||
chmod -R 0700 /etc/tor
|
||||
```
|
||||
|
||||
3. Start Tor and enable it on boot
|
||||
```
|
||||
systemctl enable --now tor.service
|
||||
```
|
||||
|
||||
4. Install FbIN-LibreY
|
||||
https://git.flossboxin.org.in/FbIN/LibreY/src/branch/main/docs#readme
|
||||
|
||||
5. Edit configuration files
|
||||
In your `config.php`, uncomment and change the following options to match the port you're running Tor on.
|
||||
```
|
||||
// CURLOPT_PROXY => "ip:port",
|
||||
// CURLOPT_PROXYTYPE => CURLPROXY_HTTP,
|
||||
```
|
||||
|
||||
For our configuration, they would be changed to:
|
||||
```
|
||||
CURLOPT_PROXY => "127.0.0.1",
|
||||
CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5_HOSTNAME,
|
||||
```
|
||||
|
||||
|
||||
6. Start FbIN-LibreY! You can use a tool like [iftop](https://archlinux.org/packages/extra/x86_64/iftop/) to make sure your FbIN-LibreY instance is connecting to guard nodes or a bridge instead of Google servers.
|
||||
|
||||
To update Tor and FbIN-LibreY:
|
||||
```
|
||||
pacman -Syu
|
||||
git pull
|
||||
```
|
||||
40
engines/ahmia/hidden_service.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
require_once "engines/text/text.php";
|
||||
|
||||
class TorSearch extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
return "https://ahmia.fi/search/?q=" . urlencode($this->query);
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$results = array();
|
||||
$xpath = get_xpath($response);
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
foreach($xpath->query("//ol[@class='searchResults']//li[@class='result']") as $result)
|
||||
{
|
||||
$url = "http://" . $xpath->evaluate(".//cite", $result)[0]->textContent;
|
||||
$title = remove_special($xpath->evaluate(".//h4", $result)[0]->textContent);
|
||||
$description = $xpath->evaluate(".//p", $result)[0]->textContent;
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"title" => $title ? htmlspecialchars($title) : TEXTS["result_no_description"],
|
||||
"url" => htmlspecialchars($url),
|
||||
// base_url is to be removed in the future, see #47
|
||||
"base_url" => htmlspecialchars(get_base_url($url)),
|
||||
"description" => htmlspecialchars($description)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public static function print_results($results, $opts) {
|
||||
TextSearch::print_results($results, $opts);
|
||||
}
|
||||
}
|
||||
?>
|
||||
38
engines/bittorrent/1337x.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
class _1337xRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
$query = urlencode($this->query);
|
||||
return "https://1337x.to/search/$query/1/";
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$xpath = get_xpath($response);
|
||||
$results = array();
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
foreach($xpath->query("//table/tbody/tr") as $result) {
|
||||
$name = $xpath->evaluate(".//td[@class='coll-1 name']/a", $result)[1]->textContent;
|
||||
$magnet = "./engines/bittorrent/get_magnet_1337x.php?url=https://1337x.to" . $xpath->evaluate(".//td[@class='coll-1 name']/a/@href", $result)[1]->textContent;
|
||||
$size_unformatted = explode(" ", $xpath->evaluate(".//td[contains(@class, 'coll-4 size')]", $result)[0]->textContent);
|
||||
$size = $size_unformatted[0] . " " . preg_replace("/[0-9]+/", "", $size_unformatted[1]);
|
||||
$seeders = $xpath->evaluate(".//td[@class='coll-2 seeds']", $result)[0]->textContent;
|
||||
$leechers = $xpath->evaluate(".//td[@class='coll-3 leeches']", $result)[0]->textContent;
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"name" => htmlspecialchars($name),
|
||||
"seeders" => (int) $seeders,
|
||||
"leechers" => (int) $leechers,
|
||||
"magnet" => htmlspecialchars($magnet),
|
||||
"size" => htmlspecialchars($size),
|
||||
"source" => "1337x.to"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
?>
|
||||
15
engines/bittorrent/get_magnet_1337x.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
require_once "../../misc/tools.php";
|
||||
$config = require_once "../../config.php";
|
||||
|
||||
$url = $_REQUEST["url"];
|
||||
|
||||
$response = request($url, $config->curl_settings);
|
||||
$xpath = get_xpath($response);
|
||||
|
||||
$magnet = $xpath->query("//main/div/div/div/div/div/ul/li/a/@href")[0]->textContent;
|
||||
$magnet_without_tracker = explode("&tr=", $magnet)[0];
|
||||
$magnet = $magnet_without_tracker . $config->bittorrent_trackers;
|
||||
|
||||
header("Location: $magnet")
|
||||
?>
|
||||
69
engines/bittorrent/merge.php
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
class TorrentSearch extends EngineRequest {
|
||||
protected $requests;
|
||||
public function __construct($opts, $mh) {
|
||||
parent::__construct($opts, $mh);
|
||||
|
||||
require_once "engines/bittorrent/thepiratebay.php";
|
||||
require_once "engines/bittorrent/rutor.php";
|
||||
require_once "engines/bittorrent/yts.php";
|
||||
require_once "engines/bittorrent/torrentgalaxy.php";
|
||||
require_once "engines/bittorrent/1337x.php";
|
||||
require_once "engines/bittorrent/sukebei.php";
|
||||
|
||||
$this->requests = array(
|
||||
new PirateBayRequest($opts, $mh),
|
||||
new _1337xRequest($opts, $mh),
|
||||
new NyaaRequest($opts, $mh),
|
||||
new RutorRequest($opts, $mh),
|
||||
new SukebeiRequest($opts, $mh),
|
||||
new TorrentGalaxyRequest($opts, $mh),
|
||||
new YTSRequest($opts, $mh),
|
||||
);
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$results = array();
|
||||
foreach ($this->requests as $request) {
|
||||
if ($request->successful())
|
||||
$results = array_merge($results, $request->get_results());
|
||||
}
|
||||
|
||||
$seeders = array_column($results, "seeders");
|
||||
array_multisort($seeders, SORT_DESC, $results);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public static function print_results($results, $opts) {
|
||||
echo "<div class=\"text-result-container\">";
|
||||
|
||||
if (empty($results)) {
|
||||
echo "<p>" . TEXTS["failure_empty"] . "</p>";
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($results as $result) {
|
||||
$source = $result["source"];
|
||||
$name = $result["name"];
|
||||
$magnet = $result["magnet"];
|
||||
$seeders = $result["seeders"];
|
||||
$leechers = $result["leechers"];
|
||||
$size = $result["size"];
|
||||
|
||||
echo "<div class=\"text-result-wrapper\">";
|
||||
echo "<a href=\"$magnet\">";
|
||||
echo "$source";
|
||||
echo "<h2>$name</h2>";
|
||||
echo "</a>";
|
||||
echo "<span>SE: <span class=\"seeders\">$seeders</span> - ";
|
||||
echo "LE: <span class=\"leechers\">$leechers</span> - ";
|
||||
echo "$size</span>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
52
engines/bittorrent/nyaa.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
class NyaaRequest extends EngineRequest {
|
||||
public $SOURCE = "nyaa.si";
|
||||
|
||||
public function get_request_url() {
|
||||
return "https://$this->SOURCE/?q=" . urlencode($this->query);
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$xpath = get_xpath($response);
|
||||
$results = array();
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
foreach($xpath->query("//tbody/tr") as $result)
|
||||
{
|
||||
$name_node = $xpath->evaluate(".//td[@colspan='2']//a[not(contains(@class, 'comments'))]/@title", $result);
|
||||
if ($name_node->length > 0) {
|
||||
$name = $name_node[0]->textContent;
|
||||
} else {
|
||||
$name = "";
|
||||
}
|
||||
$centered = $xpath->evaluate(".//td[@class='text-center']", $result);
|
||||
$magnet_node = $xpath->evaluate(".//a[2]/@href", $centered[0]);
|
||||
if ($magnet_node->length > 0) {
|
||||
$magnet = $magnet_node[0]->textContent;
|
||||
$magnet_without_tracker = explode("&tr=", $magnet)[0];
|
||||
$magnet = $magnet_without_tracker . $this->opts->bittorrent_trackers;
|
||||
} else {
|
||||
$magnet = "";
|
||||
}
|
||||
$size = $centered[1]->textContent;
|
||||
$seeders = $centered[3]->textContent;
|
||||
$leechers = $centered[4]->textContent;
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"name" => htmlspecialchars($name),
|
||||
"seeders" => (int) $seeders,
|
||||
"leechers" => (int) $leechers,
|
||||
"magnet" => htmlspecialchars($magnet),
|
||||
"size" => htmlspecialchars($size),
|
||||
"source" => $this->SOURCE
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
?>
|
||||
40
engines/bittorrent/rutor.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
class RutorRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
return "http://rutor.info/search/" . urlencode($this->query);
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$xpath = get_xpath($response);
|
||||
$results = array();
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
foreach($xpath->query("//table/tr[@class='gai' or @class='tum']") as $result)
|
||||
{
|
||||
$name = $xpath->evaluate(".//td/a", $result)[2]->textContent;
|
||||
$magnet = $xpath->evaluate(".//td/a/@href", $result)[1]->textContent;
|
||||
$magnet_without_tracker = explode("&tr=", $magnet)[0];
|
||||
$magnet = $magnet_without_tracker . $this->opts->bittorrent_trackers;
|
||||
$td = $xpath->evaluate(".//td", $result);
|
||||
$size = $td[count($td) == 5 ? 3 : 2]->textContent;
|
||||
$seeders = $xpath->evaluate(".//span", $result)[0]->textContent;
|
||||
$leechers = $xpath->evaluate(".//span", $result)[1]->textContent;
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"name" => htmlspecialchars($name),
|
||||
"seeders" => (int) filter_var($seeders, FILTER_SANITIZE_NUMBER_INT),
|
||||
"leechers" => (int) filter_var($leechers, FILTER_SANITIZE_NUMBER_INT),
|
||||
"magnet" => htmlspecialchars($magnet),
|
||||
"size" => htmlspecialchars($size),
|
||||
"source" => "rutor.info"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
?>
|
||||
6
engines/bittorrent/sukebei.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
include_once "engines/bittorrent/nyaa.php";
|
||||
class SukebeiRequest extends NyaaRequest {
|
||||
public $SOURCE = "sukebei.nyaa.si";
|
||||
}
|
||||
?>
|
||||
45
engines/bittorrent/thepiratebay.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
class PirateBayRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
return "https://apibay.org/q.php?q=" . urlencode($this->query);
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$results = array();
|
||||
$json_response = json_decode($response, true);
|
||||
|
||||
if (empty($json_response))
|
||||
{
|
||||
return $results;
|
||||
}
|
||||
|
||||
foreach ($json_response as $response)
|
||||
{
|
||||
$size = human_filesize($response["size"]);
|
||||
$hash = $response["info_hash"];
|
||||
$name = $response["name"];
|
||||
$seeders = (int) $response["seeders"];
|
||||
$leechers = (int) $response["leechers"];
|
||||
|
||||
$magnet = "magnet:?xt=urn:btih:$hash&dn=$name" . $this->opts->bittorrent_trackers;
|
||||
|
||||
if ($name == "No results returned")
|
||||
break;
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"size" => htmlspecialchars($size),
|
||||
"name" => htmlspecialchars($name),
|
||||
"seeders" => (int) htmlspecialchars($seeders),
|
||||
"leechers" => (int) htmlspecialchars($leechers),
|
||||
"magnet" => htmlspecialchars($magnet),
|
||||
"source" => "thepiratebay.org"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
40
engines/bittorrent/torrentgalaxy.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
class TorrentGalaxyRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
$query = urlencode($this->query);
|
||||
return "https://torrentgalaxy.to/torrents.php?search=$query#results";
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$xpath = get_xpath($response);
|
||||
$results = array();
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
foreach($xpath->query("//div[@class='tgxtablerow txlight']") as $result)
|
||||
{
|
||||
$name = $xpath->evaluate(".//div[contains(@class, 'clickable-row')]", $result)[0]->textContent;
|
||||
$magnet = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/a/@href", $result)[1]->textContent;
|
||||
$magnet_without_tracker = explode("&tr=", $magnet)[0];
|
||||
$magnet = $magnet_without_tracker . $this->opts->bittorrent_trackers;
|
||||
$size = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/span", $result)[0]->textContent;
|
||||
$seeders = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/span/font", $result)[1]->textContent;
|
||||
$leechers = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/span/font", $result)[2]->textContent;
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"name" => htmlspecialchars($name),
|
||||
"seeders" => (int) $seeders,
|
||||
"leechers" => (int) $leechers,
|
||||
"magnet" => htmlspecialchars($magnet),
|
||||
"size" => htmlspecialchars($size),
|
||||
"source" => "torrentgalaxy.to"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
?>
|
||||
46
engines/bittorrent/yts.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
class YTSRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
return "https://yts.mx/api/v2/list_movies.json?query_term=" . urlencode($this->query);
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$response = curl_multi_getcontent($this->ch);
|
||||
$results = array();
|
||||
$json_response = json_decode($response, true);
|
||||
|
||||
if ($json_response["status"] != "ok" || $json_response["data"]["movie_count"] == 0)
|
||||
return $results;
|
||||
|
||||
foreach ($json_response["data"]["movies"] as $movie)
|
||||
{
|
||||
$name = $movie["title"];
|
||||
$name_encoded = urlencode($name);
|
||||
|
||||
foreach ($movie["torrents"] as $torrent)
|
||||
{
|
||||
|
||||
$hash = $torrent["hash"];
|
||||
$seeders = $torrent["seeds"];
|
||||
$leechers = $torrent["peers"];
|
||||
$size = $torrent["size"];
|
||||
|
||||
$magnet = "magnet:?xt=urn:btih:$hash&dn=$name_encoded" . $this->opts->bittorrent_trackers;
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"size" => htmlspecialchars($size),
|
||||
"name" => htmlspecialchars($name),
|
||||
"seeders" => htmlspecialchars($seeders),
|
||||
"leechers" => htmlspecialchars($leechers),
|
||||
"magnet" => htmlspecialchars($magnet),
|
||||
"source" => "yts.mx"
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
?>
|
||||
77
engines/invidious/video.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
require_once "misc/tools.php";
|
||||
class VideoSearch extends EngineRequest {
|
||||
protected $instance_url;
|
||||
public function get_request_url() {
|
||||
$this->instance_url = $this->opts->invidious_instance_for_video_results;
|
||||
$query = urlencode($this->query);
|
||||
return "$this->instance_url/api/v1/search?q=$query";
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$results = array();
|
||||
$json_response = json_decode($response, true);
|
||||
|
||||
foreach ($json_response ?: [] as $response) {
|
||||
if ($response["type"] == "video") {
|
||||
$title = $response["title"];
|
||||
$url = "https://youtube.com/watch?v=" . $response["videoId"];
|
||||
$uploader = $response["author"];
|
||||
$views = $response["viewCountText"];
|
||||
$date = $response["publishedText"];
|
||||
$lengthSeconds = $response["lengthSeconds"];
|
||||
$thumbnail = $this->instance_url . "/vi/" . explode("/vi/" ,$response["videoThumbnails"][4]["url"])[1];
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"title" => htmlspecialchars($title),
|
||||
"url" => htmlspecialchars($url),
|
||||
// base_url is to be removed in the future, see #47
|
||||
"base_url" => htmlspecialchars(get_base_url($url)),
|
||||
"uploader" => htmlspecialchars($uploader),
|
||||
"views" => htmlspecialchars($views),
|
||||
"date" => htmlspecialchars($date),
|
||||
"lengthSeconds" => htmlspecialchars($lengthSeconds),
|
||||
"thumbnail" => htmlspecialchars($thumbnail)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public static function print_results($results, $opts) {
|
||||
echo "<div class=\"text-result-container\">";
|
||||
|
||||
foreach ($results as $key => $result) {
|
||||
if ($key == "results_source") continue;
|
||||
$title = $result["title"] ?? '';
|
||||
$url = $result["url"] ?? '';
|
||||
$url = check_for_privacy_frontend($url, $opts);
|
||||
$base_url = get_base_url($url);
|
||||
$uploader = $result["uploader"] ?? '';
|
||||
$views = $result["views"] ?? '';
|
||||
$date = $result["date"] ?? '';
|
||||
$lengthSeconds = $result["lengthSeconds"] ?? '';
|
||||
$length = seconds_to_human_readable($lengthSeconds) ?? '';
|
||||
$thumbnail = "https://i.ytimg.com/vi/" . htmlspecialchars(explode("=", $url)[1]) . "/mqdefault.jpg" ?? '';
|
||||
|
||||
echo "<div class=\"text-result-wrapper\">";
|
||||
echo "<a rel=\"noreferer noopener\" href=\"$url\">";
|
||||
echo "$base_url";
|
||||
echo "<h2>$title</h2>";
|
||||
echo "<img class=\"video-img\" src=\"image_proxy.php?url=$thumbnail\">";
|
||||
echo "<br>";
|
||||
echo "<span>$uploader - $date - $views views</span>";
|
||||
echo "<br>";
|
||||
echo "<span>$length</span>";
|
||||
echo "</a>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
81
engines/librex/fallback.php
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
class LibreXFallback extends EngineRequest {
|
||||
protected $instance;
|
||||
public function __construct($instance, $opts, $mh) {
|
||||
$this->instance = $instance;
|
||||
parent::__construct($opts, $mh);
|
||||
}
|
||||
|
||||
public function get_request_url() {
|
||||
return $this->instance . "api.php?" . opts_to_params($this->opts) . "&nfb=1";
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$response = json_decode($response, true);
|
||||
if (!$response)
|
||||
return array();
|
||||
|
||||
return array_values($response);
|
||||
}
|
||||
}
|
||||
|
||||
function load_instances($cooldowns) {
|
||||
$instances_json = json_decode(file_get_contents("instances.json"), true);
|
||||
|
||||
if (empty($instances_json["instances"]))
|
||||
return array();
|
||||
|
||||
$instances = array_map(fn($n) => $n['clearnet'], array_filter($instances_json['instances'], fn($n) => !is_null($n['clearnet'])));
|
||||
$instances = array_filter($instances, fn($n) => !has_cooldown($n, $cooldowns));
|
||||
shuffle($instances);
|
||||
return $instances;
|
||||
}
|
||||
|
||||
function get_librex_results($opts) {
|
||||
if (!$opts->do_fallback)
|
||||
return array();
|
||||
|
||||
$cooldowns = $opts->cooldowns;
|
||||
$instances = load_instances($cooldowns);
|
||||
|
||||
$results = array();
|
||||
$tries = 0;
|
||||
|
||||
do {
|
||||
$tries++;
|
||||
|
||||
$instance = array_pop($instances);
|
||||
|
||||
if (!$instance)
|
||||
break;
|
||||
|
||||
if (!(filter_var($instance, FILTER_VALIDATE_URL)))
|
||||
continue;
|
||||
|
||||
if (parse_url($instance)["host"] == $_SERVER['HTTP_HOST'])
|
||||
continue;
|
||||
|
||||
$librex_request = new LibreXFallback($instance, $opts, null);
|
||||
|
||||
$results = $librex_request->get_results();
|
||||
|
||||
if (!empty($results)) {
|
||||
$results["results_source"] = parse_url($instance)["host"];
|
||||
return $results;
|
||||
}
|
||||
|
||||
// on fail then do this
|
||||
$timeout = ($opts->request_cooldown ?? "1") * 60;
|
||||
$cooldowns = set_cooldown($instance, $timeout, $cooldowns);
|
||||
|
||||
} while (!empty($instances));
|
||||
|
||||
return array(
|
||||
"error" => array(
|
||||
"message" => TEXTS["failure_fallback"]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
37
engines/maps/openstreetmap.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
require_once "engines/text/text.php";
|
||||
class OSMRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
|
||||
$query_encoded = str_replace("%22", "\"", urlencode($this->query));
|
||||
$results = array();
|
||||
|
||||
// TODO allow the nominatim instance to be customised
|
||||
$url = "https://nominatim.openstreetmap.org/search?q=$query_encoded&format=json";
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
public function parse_results($response) {
|
||||
$json_response = json_decode($response, true);
|
||||
if (!$json_response)
|
||||
return array();
|
||||
|
||||
$results = array();
|
||||
foreach ($json_response as $item) {
|
||||
array_push($results, array(
|
||||
"title" => $item["name"],
|
||||
"description" => $item["display_name"],
|
||||
"url" => "https://www.openstreetmap.org/" . $item["osm_type"] . "/" . $item["osm_id"],
|
||||
"base_url" => "www.openstreetmap.org"
|
||||
));
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
public static function print_results($results, $opts) {
|
||||
TextSearch::print_results($results, $opts);
|
||||
}
|
||||
}
|
||||
?>
|
||||
55
engines/qwant/image.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
class QwantImageSearch extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
$offset = $this->page * 5; // load 50 images per page
|
||||
$query = urlencode($this->query);
|
||||
return "https://api.qwant.com/v3/search/images?q=$query&t=images&count=50&locale=en_us&offset=$offset&device=desktop&tgp=3&safesearch=1";
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$json = json_decode($response, true);
|
||||
$results = array();
|
||||
|
||||
if ($json["status"] != "success")
|
||||
return $results; // no results
|
||||
|
||||
$imgs = $json["data"]["result"]["items"];
|
||||
$imgCount = $json["data"]["result"]["total"];
|
||||
|
||||
for ($i = 0; $i < $imgCount; $i++)
|
||||
{
|
||||
array_push($results,
|
||||
array (
|
||||
"thumbnail" => htmlspecialchars($imgs[$i]["thumbnail"]),
|
||||
"alt" => htmlspecialchars($imgs[$i]["title"]),
|
||||
"url" => htmlspecialchars($imgs[$i]["url"])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public static function print_results($results, $opts) {
|
||||
echo "<div class=\"image-result-container\">";
|
||||
|
||||
foreach($results as $result)
|
||||
{
|
||||
if (!$result
|
||||
|| !array_key_exists("url", $result)
|
||||
|| !array_key_exists("alt", $result))
|
||||
continue;
|
||||
$thumbnail = urlencode($result["thumbnail"]);
|
||||
$alt = $result["alt"];
|
||||
$url = $result["url"];
|
||||
$url = check_for_privacy_frontend($url, $opts);
|
||||
|
||||
echo "<a title=\"$alt\" href=\"$url\" rel=\"noreferer noopener\" target=\"_blank\">";
|
||||
echo "<img src=\"image_proxy.php?url=$thumbnail\">";
|
||||
echo "</a>";
|
||||
}
|
||||
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
35
engines/special/currency.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
class CurrencyRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
return "https://cdn.moneyconvert.net/api/latest.json";
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$split_query = explode(" ", $this->query);
|
||||
|
||||
$base_currency = strtoupper($split_query[1]);
|
||||
$currency_to_convert = strtoupper($split_query[3]);
|
||||
$amount_to_convert = floatval($split_query[0]);
|
||||
|
||||
$json_response = json_decode($response, true);
|
||||
|
||||
$rates = $json_response["rates"];
|
||||
|
||||
if (!array_key_exists($base_currency, $rates) || !array_key_exists($currency_to_convert, $rates))
|
||||
return array();
|
||||
$base_currency_response = $rates[$base_currency];
|
||||
$currency_to_convert_response = $rates[$currency_to_convert];
|
||||
|
||||
$conversion_result = ($currency_to_convert_response / $base_currency_response) * $amount_to_convert;
|
||||
|
||||
$formatted_response = "$amount_to_convert $base_currency = $conversion_result $currency_to_convert";
|
||||
$source = "https://moneyconvert.net/";
|
||||
return array(
|
||||
"special_response" => array(
|
||||
"response" => htmlspecialchars($formatted_response),
|
||||
"source" => $source
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
32
engines/special/definition.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
class DefinitionRequest extends EngineRequest {
|
||||
|
||||
public function get_request_url() {
|
||||
$split_query = explode(" ", $this->query);
|
||||
$reversed_split_q = array_reverse($split_query);
|
||||
$word_to_define = $reversed_split_q[1] == "define" ? $reversed_split_q[0] : $reversed_split_q[1];
|
||||
return "https://api.dictionaryapi.dev/api/v2/entries/en/$word_to_define";
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$json_response = json_decode($response, true);
|
||||
|
||||
if (!$json_response)
|
||||
return array();
|
||||
|
||||
if (!array_key_exists("title", $json_response))
|
||||
{
|
||||
$definition = $json_response[0]["meanings"][0]["definitions"][0]["definition"];
|
||||
|
||||
$source = "https://dictionaryapi.dev";
|
||||
return array(
|
||||
"special_response" => array(
|
||||
"response" => htmlspecialchars($definition),
|
||||
"source" => $source
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
12
engines/special/ip.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
class IPRequest extends EngineRequest {
|
||||
public function parse_results($response) {
|
||||
return array(
|
||||
"special_response" => array(
|
||||
"response" => $_SERVER["REMOTE_ADDR"],
|
||||
"source" => null
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
91
engines/special/special.php
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
|
||||
function check_for_special_search($query) {
|
||||
if (isset($_COOKIE["disable_special"]))
|
||||
return 0;
|
||||
|
||||
$query_lower = strtolower($query);
|
||||
$split_query = explode(" ", $query);
|
||||
|
||||
if (strpos($query_lower, "to") && count($split_query) >= 4) // currency
|
||||
{
|
||||
$amount_to_convert = floatval($split_query[0]);
|
||||
if ($amount_to_convert != 0)
|
||||
return 1;
|
||||
}
|
||||
else if ((strpos($query_lower, "mean") || str_starts_with($query_lower, "define")) && count($split_query) >= 2) // definition
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (strpos($query_lower, "my") !== false)
|
||||
{
|
||||
if (strpos($query_lower, "ip"))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (strpos($query_lower, "user agent") || strpos($query_lower, "ua"))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
else if (strpos($query_lower, "weather") !== false)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if ($query_lower == "tor")
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (3 > count(explode(" ", $query))) // wikipedia
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function get_special_search_request($opts, $mh) {
|
||||
if ($opts->page != 0)
|
||||
return null;
|
||||
|
||||
$special_search = check_for_special_search($opts->query);
|
||||
$special_request = null;
|
||||
$url = null;
|
||||
|
||||
if ($special_search == 0)
|
||||
return null;
|
||||
|
||||
switch ($special_search) {
|
||||
case 1:
|
||||
require_once "engines/special/currency.php";
|
||||
$special_request = new CurrencyRequest($opts, $mh);
|
||||
break;
|
||||
case 2:
|
||||
require_once "engines/special/definition.php";
|
||||
$special_request = new DefinitionRequest($opts, $mh);
|
||||
break;
|
||||
case 3:
|
||||
require_once "engines/special/ip.php";
|
||||
$special_request = new IPRequest($opts, $mh);
|
||||
break;
|
||||
case 4:
|
||||
require_once "engines/special/user_agent.php";
|
||||
$special_request = new UserAgentRequest($opts, $mh);
|
||||
break;
|
||||
case 5:
|
||||
require_once "engines/special/weather.php";
|
||||
$special_request = new WeatherRequest($opts, $mh);
|
||||
break;
|
||||
case 6:
|
||||
require_once "engines/special/tor.php";
|
||||
$special_request = new TorRequest($opts, $mh);
|
||||
break;
|
||||
case 7:
|
||||
require_once "engines/special/wikipedia.php";
|
||||
$special_request = new WikipediaRequest($opts, $mh);
|
||||
break;
|
||||
}
|
||||
|
||||
return $special_request;
|
||||
}
|
||||
?>
|
||||
20
engines/special/tor.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
class TorRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
return "https://check.torproject.org/torbulkexitlist";
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$formatted_response = strpos($response, $_SERVER["REMOTE_ADDR"]) ? "It seems like you are using Tor" : "It seems like you are not using Tor";
|
||||
$source = "https://check.torproject.org";
|
||||
|
||||
return array(
|
||||
"special_response" => array(
|
||||
"response" => $formatted_response,
|
||||
"source" => $source
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
12
engines/special/user_agent.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
class UserAgentRequest extends EngineRequest {
|
||||
public function parse_results($response) {
|
||||
return array(
|
||||
"special_response" => array(
|
||||
"response" => $_SERVER["HTTP_USER_AGENT"],
|
||||
"source" => null
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
30
engines/special/weather.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
class WeatherRequest extends EngineRequest {
|
||||
public function get_request_url () {
|
||||
return "https://wttr.in/@" . $_SERVER["REMOTE_ADDR"] . "?format=j1";
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$json_response = json_decode($response, true);
|
||||
|
||||
if (!$json_response)
|
||||
return array();
|
||||
|
||||
$current_weather = $json_response["current_condition"][0];
|
||||
|
||||
$temp_c = $current_weather["temp_C"];
|
||||
$temp_f = $current_weather["temp_F"];
|
||||
$description = $current_weather["weatherDesc"][0]["value"];
|
||||
|
||||
$formatted_response = "$description - $temp_c °C | $temp_f °F";
|
||||
|
||||
$source = "https://wttr.in";
|
||||
return array(
|
||||
"special_response" => array(
|
||||
"response" => htmlspecialchars($formatted_response),
|
||||
"source" => $source
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
44
engines/special/wikipedia.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
class WikipediaRequest extends EngineRequest {
|
||||
protected $wikipedia_domain;
|
||||
public function get_request_url() {
|
||||
$this->wikipedia_domain = "wikipedia.org";
|
||||
$query_encoded = urlencode($this->query);
|
||||
|
||||
$languages = json_decode(file_get_contents("static/misc/languages.json"), true);
|
||||
|
||||
if (array_key_exists($this->opts->language, $languages))
|
||||
$this->wikipedia_domain = $languages[$this->opts->language]["wikipedia"] . ".wikipedia.org";
|
||||
|
||||
return "https://$this->wikipedia_domain/w/api.php?format=json&action=query&prop=extracts%7Cpageimages&exintro&explaintext&redirects=1&pithumbsize=500&titles=$query_encoded";
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$json_response = json_decode($response, true);
|
||||
if (!$json_response)
|
||||
return array();
|
||||
|
||||
$first_page = array_values($json_response["query"]["pages"])[0];
|
||||
|
||||
if (array_key_exists("missing", $first_page))
|
||||
return array();
|
||||
|
||||
$description = substr($first_page["extract"], 0, 250) . "...";
|
||||
|
||||
$source = "https://$this->wikipedia_domain/wiki/$this->query";
|
||||
$response = array(
|
||||
"special_response" => array(
|
||||
"response" => htmlspecialchars($description),
|
||||
"source" => $source
|
||||
)
|
||||
);
|
||||
|
||||
if (array_key_exists("thumbnail", $first_page)) {
|
||||
$image_url = $first_page["thumbnail"]["source"];
|
||||
$response["special_response"]["image"] = $image_url;
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
?>
|
||||
71
engines/text/brave.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
class BraveSearchRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
$query_encoded = str_replace("%22", "\"", urlencode($this->query));
|
||||
|
||||
$results_language = $this->opts->language;
|
||||
$number_of_results = $this->opts->number_of_results;
|
||||
|
||||
// TODO find the right parameters for the url
|
||||
$url = "https://search.brave.com/search?q=$query_encoded&nfpr=1&spellcheck=0&start=$this->page";
|
||||
|
||||
if (3 > strlen($results_language) && 0 < strlen($results_language)) {
|
||||
$url .= "&lr=lang_$results_language";
|
||||
$url .= "&hl=$results_language";
|
||||
}
|
||||
|
||||
if (3 > strlen($number_of_results) && 0 < strlen($number_of_results))
|
||||
$url .= "&num=$number_of_results";
|
||||
|
||||
if (isset($_COOKIE["safe_search"]))
|
||||
$url .= "&safe=medium";
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$results = array();
|
||||
$xpath = get_xpath($response);
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
foreach($xpath->query("//div[@id='results']//div[contains(@class, 'snippet')]") as $result) {
|
||||
$url = $xpath->evaluate(".//a[contains(@class, 'h')]//@href", $result)[0];
|
||||
|
||||
if ($url == null)
|
||||
continue;
|
||||
|
||||
$url = $url->textContent;
|
||||
|
||||
if (!empty($results) && array_key_exists("url", end($results)) && end($results)["url"] == $url->textContent)
|
||||
continue;
|
||||
|
||||
$title = $xpath->evaluate(".//a[contains(@class, 'h')]//div[contains(@class, 'url')]", $result)[0];
|
||||
|
||||
if ($title == null)
|
||||
continue;
|
||||
$title = $title->textContent;
|
||||
|
||||
$title = end(explode("›", $title));
|
||||
|
||||
$description = ($xpath->evaluate(".//div[contains(@class, 'snippet-content')]//div[contains(@class, 'snippet-description')]", $result)[0] ?? null) ?->textContent ?? '';
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"title" => htmlspecialchars($title),
|
||||
"url" => htmlspecialchars($url),
|
||||
// base_url is to be removed in the future, see #47
|
||||
"base_url" => htmlspecialchars(get_base_url($url)),
|
||||
"description" => $description == null ?
|
||||
TEXTS["result_no_description"] :
|
||||
htmlspecialchars($description)
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
64
engines/text/duckduckgo.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
class DuckDuckGoRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
$query_encoded = str_replace("%22", "\"", urlencode($this->query));
|
||||
$results = array();
|
||||
|
||||
$domain = 'com';
|
||||
$results_language = $this->opts->language;
|
||||
$number_of_results = $this->opts->number_of_results;
|
||||
|
||||
$url = "https://html.duckduckgo.$domain/html/?q=$query_encoded&kd=-1&s=" . 3 * $this->page;
|
||||
|
||||
if (3 > strlen($results_language) && 0 < strlen($results_language))
|
||||
$url .= "&lr=lang_$results_language";
|
||||
|
||||
if (3 > strlen($number_of_results) && 0 < strlen($number_of_results))
|
||||
$url .= "&num=$number_of_results";
|
||||
|
||||
if (isset($_COOKIE["safe_search"]))
|
||||
$url .= "&safe=medium";
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$results = array();
|
||||
$xpath = get_xpath($response);
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
foreach($xpath->query("/html/body/div[1]/div[". count($xpath->query('/html/body/div[1]/div')) ."]/div/div/div[contains(@class, 'web-result')]/div") as $result) {
|
||||
$url = $xpath->evaluate(".//h2[@class='result__title']//a/@href", $result)[0];
|
||||
|
||||
if ($url == null)
|
||||
continue;
|
||||
|
||||
if (!empty($results)) { // filter duplicate results
|
||||
if (end($results)["url"] == $url->textContent)
|
||||
continue;
|
||||
}
|
||||
|
||||
$url = $url->textContent;
|
||||
|
||||
$title = $xpath->evaluate(".//h2[@class='result__title']", $result)[0];
|
||||
$description = $xpath->evaluate(".//a[@class='result__snippet']", $result)[0];
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"title" => htmlspecialchars($title->textContent),
|
||||
"url" => htmlspecialchars($url),
|
||||
// base_url is to be removed in the future, see #47
|
||||
"base_url" => htmlspecialchars(get_base_url($url)),
|
||||
"description" => $description == null ?
|
||||
TEXTS["result_no_description"] :
|
||||
htmlspecialchars($description->textContent)
|
||||
)
|
||||
);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
63
engines/text/ecosia.php
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
class EcosiaSearchRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
$query_encoded = str_replace("%22", "\"", urlencode($this->query));
|
||||
|
||||
$results_language = $this->opts->language;
|
||||
$number_of_results = $this->opts->number_of_results;
|
||||
|
||||
// TODO figure out how to not autocorrect
|
||||
$url = "https://www.ecosia.org/search?method=index&q=$query_encoded&p=$this->page";
|
||||
|
||||
if (!is_null($results_language))
|
||||
$url .= "&lang=$results_language";
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$results = array();
|
||||
$xpath = get_xpath($response);
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
|
||||
foreach($xpath->query("//div[contains(@class, 'mainline__result-wrapper')]") as $result) {
|
||||
$url = $xpath->evaluate(".//article//div[contains(@class, 'result__body')]//div[contains(@class, 'result__header')]//div[contains(@class, 'result__info')]//a[contains(@class, 'result__link')]//@href", $result)[0];
|
||||
|
||||
if ($url == null)
|
||||
continue;
|
||||
|
||||
$url = $url->textContent;
|
||||
|
||||
if (!empty($results) && array_key_exists("url", end($results)) && end($results)["url"] == $url->textContent)
|
||||
continue;
|
||||
|
||||
$title = $xpath->evaluate(".//article//div[contains(@class, 'result__body')]//div[contains(@class, 'result__header')]//div[contains(@class, 'result__title')]//a//h2", $result)[0];
|
||||
|
||||
if ($title == null)
|
||||
continue;
|
||||
|
||||
$title = $title->textContent;
|
||||
|
||||
$description = $xpath->evaluate(".//article//div[contains(@class, 'result__body')]//div[contains(@class, 'result__columns')]//div[contains(@class, 'result__columns-start')]//div//div//div/p", $result)[0]->textContent;
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"title" => htmlspecialchars($title),
|
||||
"url" => htmlspecialchars($url),
|
||||
// base_url is to be removed in the future, see #47
|
||||
"base_url" => htmlspecialchars(get_base_url($url)),
|
||||
"description" => $description == null ?
|
||||
TEXTS["result_no_description"] :
|
||||
htmlspecialchars($description)
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
79
engines/text/google.php
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
class GoogleRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
|
||||
$query_encoded = str_replace("%22", "\"", urlencode($this->query));
|
||||
$results = array();
|
||||
|
||||
$domain = $this->opts->google_domain;
|
||||
$results_language = $this->opts->language;
|
||||
$number_of_results = $this->opts->number_of_results;
|
||||
|
||||
$url = "https://www.google.$domain/search?q=$query_encoded&nfpr=1&start=$this->page";
|
||||
|
||||
if (3 > strlen($results_language) && 0 < strlen($results_language)) {
|
||||
$url .= "&lr=lang_$results_language";
|
||||
$url .= "&hl=$results_language";
|
||||
}
|
||||
|
||||
if (3 > strlen($number_of_results) && 0 < strlen($number_of_results))
|
||||
$url .= "&num=$number_of_results";
|
||||
|
||||
if (isset($_COOKIE["safe_search"]))
|
||||
$url .= "&safe=medium";
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
public function parse_results($response) {
|
||||
$results = array();
|
||||
$xpath = get_xpath($response);
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
$didyoumean = $xpath->query(".//a[@class='gL9Hy']")[0];
|
||||
|
||||
if (!is_null($didyoumean))
|
||||
array_push($results, array(
|
||||
"did_you_mean" => $didyoumean->textContent
|
||||
));
|
||||
|
||||
foreach($xpath->query("//div[@id='search']//div[contains(@class, 'g')]") as $result) {
|
||||
$url = $xpath->evaluate(".//div[@class='yuRUbf']//a/@href", $result)[0];
|
||||
|
||||
if ($url == null)
|
||||
continue;
|
||||
|
||||
if (!empty($results) && array_key_exists("url", end($results)) && end($results)["url"] == $url->textContent)
|
||||
continue;
|
||||
|
||||
$url = $url->textContent;
|
||||
|
||||
$title = $xpath->evaluate(".//h3", $result)[0];
|
||||
$description = $xpath->evaluate(".//div[contains(@class, 'VwiC3b')]", $result)[0];
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"title" => htmlspecialchars($title->textContent),
|
||||
"url" => htmlspecialchars($url),
|
||||
// base_url is to be removed in the future, see #47
|
||||
"base_url" => htmlspecialchars(get_base_url($url)),
|
||||
"description" => $description == null ?
|
||||
TEXTS["result_no_description"] :
|
||||
htmlspecialchars($description->textContent)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($results) && !str_contains($response, "Our systems have detected unusual traffic from your computer network.")) {
|
||||
$results["error"] = array(
|
||||
"message" => TEXTS["failure_empty"]
|
||||
);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
?>
|
||||
64
engines/text/mojeek.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
class MojeekSearchRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
$query_encoded = str_replace("%22", "\"", urlencode($this->query));
|
||||
|
||||
$results_language = $this->opts->language;
|
||||
$number_of_results = $this->opts->number_of_results;
|
||||
|
||||
// TODO figure out how to not autocorrect
|
||||
$url = "https://www.mojeek.com/search?q=$query_encoded&p=$this->page";
|
||||
|
||||
// TODO language setting
|
||||
if (!is_null($results_language))
|
||||
$url .= "&lang=$results_language";
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$results = array();
|
||||
$xpath = get_xpath($response);
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
|
||||
foreach($xpath->query("//ul[contains(@class, 'results-standard')]//li") as $result) {
|
||||
$url = $xpath->evaluate(".//h2//a[contains(@class, 'title')]//@href", $result)[0];
|
||||
|
||||
if ($url == null)
|
||||
continue;
|
||||
|
||||
$url = $url->textContent;
|
||||
|
||||
if (!empty($results) && array_key_exists("url", $results) && end($results)["url"] == $url->textContent)
|
||||
continue;
|
||||
|
||||
$title = $xpath->evaluate(".//h2//a[contains(@class, 'title')]", $result)[0];
|
||||
|
||||
if ($title == null)
|
||||
continue;
|
||||
|
||||
$title = $title->textContent;
|
||||
|
||||
$description = ($xpath->evaluate(".//p[contains(@class, 's')]", $result)[0] ?? null) ?->textContent ?? '';
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"title" => htmlspecialchars($title),
|
||||
"url" => htmlspecialchars($url),
|
||||
// base_url is to be removed in the future, see #47
|
||||
"base_url" => htmlspecialchars(get_base_url($url)),
|
||||
"description" => $description == null ?
|
||||
TEXTS["result_no_description"] :
|
||||
htmlspecialchars($description)
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
220
engines/text/text.php
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
<?php
|
||||
function get_engines() {
|
||||
return array("google", "duckduckgo", "brave", "yandex", "ecosia", "mojeek");
|
||||
}
|
||||
|
||||
class TextSearch extends EngineRequest {
|
||||
protected $cache_key, $engine, $engines, $engine_request, $special_request;
|
||||
public function __construct($opts, $mh) {
|
||||
$this->engines = get_engines();
|
||||
shuffle($this->engines);
|
||||
|
||||
$this->query = $opts->query;
|
||||
$this->cache_key = "text:" . $this->query . "p" . $opts->page . "l" . $opts->language;
|
||||
|
||||
$this->page = $opts->page;
|
||||
$this->opts = $opts;
|
||||
|
||||
$this->engine = $opts->engine;
|
||||
|
||||
$query_parts = explode(" ", $this->query);
|
||||
$last_word_query = end($query_parts);
|
||||
if (substr($this->query, 0, 1) == "!" || substr($last_word_query, 0, 1) == "!")
|
||||
check_ddg_bang($this->query, $opts);
|
||||
|
||||
if (has_cached_results($this->cache_key))
|
||||
return;
|
||||
|
||||
if ($this->engine == "auto")
|
||||
$this->engine = $this->select_engine();
|
||||
|
||||
// no engine was selected
|
||||
if (is_null($this->engine))
|
||||
return;
|
||||
|
||||
// this only happens if a specific engine was selected, not if auto is used
|
||||
if (has_cooldown($this->engine, $this->opts->cooldowns))
|
||||
return;
|
||||
|
||||
$this->engine_request = $this->get_engine_request($this->engine, $opts, $mh);
|
||||
|
||||
if (is_null($this->engine_request))
|
||||
return;
|
||||
|
||||
require_once "engines/special/special.php";
|
||||
$this->special_request = get_special_search_request($opts, $mh);
|
||||
}
|
||||
private function select_engine() {
|
||||
if (sizeof($this->engines) == 0)
|
||||
return null;
|
||||
|
||||
$engine = array_pop($this->engines);
|
||||
|
||||
// if this engine is on cooldown, try again
|
||||
if (!has_cooldown($engine, $this->opts->cooldowns))
|
||||
return $engine;
|
||||
|
||||
return $this->select_engine();
|
||||
}
|
||||
|
||||
private function get_engine_request($engine, $opts, $mh) {
|
||||
if ($engine == "google") {
|
||||
require_once "engines/text/google.php";
|
||||
return new GoogleRequest($opts, $mh);
|
||||
}
|
||||
|
||||
if ($engine == "duckduckgo") {
|
||||
require_once "engines/text/duckduckgo.php";
|
||||
return new DuckDuckGoRequest($opts, $mh);
|
||||
}
|
||||
|
||||
if ($engine == "brave") {
|
||||
require_once "engines/text/brave.php";
|
||||
return new BraveSearchRequest($opts, $mh);
|
||||
}
|
||||
|
||||
if ($engine == "yandex") {
|
||||
require_once "engines/text/yandex.php";
|
||||
return new YandexSearchRequest($opts, $mh);
|
||||
}
|
||||
|
||||
if ($engine == "ecosia") {
|
||||
require_once "engines/text/ecosia.php";
|
||||
return new EcosiaSearchRequest($opts, $mh);
|
||||
}
|
||||
|
||||
if ($engine == "mojeek") {
|
||||
require_once "engines/text/mojeek.php";
|
||||
return new MojeekSearchRequest($opts, $mh);
|
||||
}
|
||||
|
||||
// if an invalid engine is selected, don't give any results
|
||||
return null;
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
if (has_cached_results($this->cache_key))
|
||||
return fetch_cached_results($this->cache_key);
|
||||
|
||||
if (!isset($this->engine_request))
|
||||
return array();
|
||||
|
||||
$results = $this->engine_request->get_results();
|
||||
|
||||
if (empty($results)) {
|
||||
set_cooldown($this->engine, ($this->opts->request_cooldown ?? "1") * 60, $this->opts->cooldowns);
|
||||
} else {
|
||||
if ($this->special_request) {
|
||||
$special_result = $this->special_request->get_results();
|
||||
|
||||
if ($special_result)
|
||||
$results = array_merge(array($special_result), $results);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($results)) {
|
||||
$results["results_source"] = parse_url($this->engine_request->url)["host"];
|
||||
store_cached_results($this->cache_key, $results, $this->opts->cache_time * 60);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public static function print_results($results, $opts) {
|
||||
|
||||
if (empty($results)) {
|
||||
echo "<div class=\"text-result-container\"><p>An error occured fetching results</p></div>";
|
||||
return;
|
||||
}
|
||||
|
||||
if (array_key_exists("error", $results)) {
|
||||
echo "<div class=\"text-result-container\"><p>" . $results["error"]["message"] . "</p></div>";
|
||||
return;
|
||||
}
|
||||
|
||||
$special = $results[0];
|
||||
|
||||
if (array_key_exists("did_you_mean", $special)) {
|
||||
$didyoumean = $special["did_you_mean"];
|
||||
$new_url = "/search.php?q=" . urlencode($didyoumean);
|
||||
echo "<p class=\"did-you-mean\">Did you mean ";
|
||||
echo "<a href=\"$new_url\">$didyoumean</a>";
|
||||
echo "?</p>";
|
||||
}
|
||||
|
||||
if (array_key_exists("special_response", $special)) {
|
||||
$response = $special["special_response"]["response"];
|
||||
$source = $special["special_response"]["source"];
|
||||
|
||||
echo "<p class=\"special-result-container\">";
|
||||
if (array_key_exists("image", $special["special_response"])) {
|
||||
$image_url = $special["special_response"]["image"];
|
||||
echo "<img src=\"image_proxy.php?url=$image_url\">";
|
||||
}
|
||||
echo $response;
|
||||
if ($source) {
|
||||
$source = check_for_privacy_frontend($source, $opts);
|
||||
echo "<a href=\"$source\" rel=\"noreferer noopener\" target=\"_blank\">$source</a>";
|
||||
}
|
||||
echo "</p>";
|
||||
}
|
||||
|
||||
echo "<div class=\"text-result-container\">";
|
||||
|
||||
foreach($results as $result) {
|
||||
if (!is_array($result))
|
||||
continue;
|
||||
if (!array_key_exists("title", $result))
|
||||
continue;
|
||||
|
||||
$title = $result["title"];
|
||||
$url = $result["url"];
|
||||
$url = check_for_privacy_frontend($url, $opts);
|
||||
|
||||
$base_url = get_base_url($url);
|
||||
$description = $result["description"];
|
||||
|
||||
echo "<div class=\"text-result-wrapper\">";
|
||||
echo "<a rel=\"noreferer noopener\" href=\"$url\">";
|
||||
echo "$base_url";
|
||||
echo "<h2>$title</h2>";
|
||||
echo "</a>";
|
||||
echo "<span>$description</span>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
function check_ddg_bang($query, $opts) {
|
||||
|
||||
$bangs_json = file_get_contents("static/misc/ddg_bang.json");
|
||||
$bangs = json_decode($bangs_json, true);
|
||||
|
||||
if (substr($query, 0, 1) == "!")
|
||||
$search_word = substr(explode(" ", $query)[0], 1);
|
||||
else
|
||||
$search_word = substr(end(explode(" ", $query)), 1);
|
||||
|
||||
$bang_url = null;
|
||||
|
||||
foreach($bangs as $bang) {
|
||||
if ($bang["t"] == $search_word) {
|
||||
$bang_url = $bang["u"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($bang_url) {
|
||||
$bang_query_array = explode("!" . $search_word, $query);
|
||||
$bang_query = trim(implode("", $bang_query_array));
|
||||
|
||||
$request_url = str_replace("{{{s}}}", str_replace('%26quot%3B','%22', urlencode($bang_query)), $bang_url);
|
||||
|
||||
header("Location: " . $request_url);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
68
engines/text/yandex.php
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
class YandexSearchRequest extends EngineRequest {
|
||||
public function get_request_url() {
|
||||
$query_encoded = str_replace("%22", "\"", urlencode($this->query));
|
||||
|
||||
$results_language = $this->opts->language;
|
||||
$number_of_results = $this->opts->number_of_results;
|
||||
|
||||
$url = "https://yandex.com/search?text=$query_encoded&nfpr=1&p=$this->page&noreask=1";
|
||||
|
||||
if (!is_null($results_language))
|
||||
$url .= "&lang=$results_language";
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
public function parse_results($response) {
|
||||
$results = array();
|
||||
$xpath = get_xpath($response);
|
||||
|
||||
if (!$xpath)
|
||||
return $results;
|
||||
|
||||
$r = $xpath->query("//ul[@id='search-result']");
|
||||
if (empty($r))
|
||||
return array("error" => array(
|
||||
"message" => TEXTS["failure_empty"]
|
||||
));
|
||||
|
||||
foreach($xpath->query("//li[contains(@class, 'serp-item')]") as $result) {
|
||||
$url = $xpath->evaluate(".//div//div//a[contains(@class, 'link')]//@href", $result)[0];
|
||||
|
||||
if ($url == null)
|
||||
continue;
|
||||
|
||||
$url = $url->textContent;
|
||||
|
||||
if (!empty($results) && array_key_exists("url", $results) && end($results)["url"] == $url->textContent)
|
||||
continue;
|
||||
|
||||
$title = $xpath->evaluate(".//div//div//a[contains(@class, 'link')]//h2[contains(@class, 'OrganicTitle-LinkText')]//span", $result)[0];
|
||||
|
||||
if ($title == null)
|
||||
continue;
|
||||
|
||||
$title = $title->textContent;
|
||||
|
||||
$description = $xpath->evaluate(".//div[contains(@class, 'Organic-ContentWrapper')]//div[contains(@class, 'text-container')]//span", $result)[0]->textContent;
|
||||
|
||||
array_push($results,
|
||||
array (
|
||||
"title" => htmlspecialchars($title),
|
||||
"url" => htmlspecialchars($url),
|
||||
// base_url is to be removed in the future, see #47
|
||||
"base_url" => htmlspecialchars(get_base_url($url)),
|
||||
"description" => $description == null ?
|
||||
TEXTS["result_no_description"] :
|
||||
htmlspecialchars($description)
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
BIN
favicon.ico
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
19
image_proxy.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
$config = require_once "config.php";
|
||||
require_once "misc/tools.php";
|
||||
|
||||
$url = $_REQUEST["url"];
|
||||
$requested_root_domain = get_root_domain($url);
|
||||
|
||||
$allowed_domains = array("i.ytimg.com", "s2.qwant.com", "s1.qwant.com", "upload.wikimedia.org");
|
||||
|
||||
if (in_array($requested_root_domain, $allowed_domains))
|
||||
{
|
||||
$image = $url;
|
||||
$image_src = request($image, $config->curl_settings);
|
||||
|
||||
header("Content-Type: image/png");
|
||||
echo $image_src;
|
||||
}
|
||||
?>
|
||||
20
index.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php require_once "misc/header.php"; ?>
|
||||
|
||||
<title>FbIN Search</title>
|
||||
</head>
|
||||
<body>
|
||||
<form class="search-container" action="search.php" method="get" autocomplete="on">
|
||||
<h1>Fb<span class="Y">IN</span></h1>
|
||||
<input type="text" name="q" autofocus/>
|
||||
<input type="hidden" name="p" value="0"/>
|
||||
<input type="hidden" name="t" value="0"/>
|
||||
<input type="submit" class="hide"/>
|
||||
<div class="search-button-wrapper">
|
||||
<button name="t" value="0" type="submit"><?php printtext("search_button"); ?></button>
|
||||
<?php if (!$opts->disable_bittorrent_search) {
|
||||
echo '<button name="t" value="3" type="submit">', printtext("torrent_search_button"), '</button>';
|
||||
} ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php require_once "misc/footer.php"; ?>
|
||||
123
instances.json
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
{
|
||||
"instances": [
|
||||
{
|
||||
"clearnet": "https://link.flossboxin.org.in/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "DE",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://search.revvy.de/",
|
||||
"tor": "http://search.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/",
|
||||
"i2p": "http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/",
|
||||
"country": "FI",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://search.davidovski.xyz/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "GB",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://ly.owo.si/",
|
||||
"tor": "http://ly.pk47sgwhncn5cgidm7bofngmh7lc7ukjdpk5bjwfemmyp27ovl25ikyd.onion/",
|
||||
"i2p": null,
|
||||
"country": "DE",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://libre-find.online/",
|
||||
"tor": "http://ug3lz3wdjxljv5fxyoicgcugmcsuym5e4zgxggotjdscdrdwid7s2mqd.onion/",
|
||||
"i2p": null,
|
||||
"country": "DE",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://librey.darkness.services/",
|
||||
"tor": "http://librey.darknessrdor43qkl2ngwitj72zdavfz2cead4t5ed72bybgauww5lyd.onion/",
|
||||
"i2p": null,
|
||||
"country": "US",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://librey.org/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "US",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://search.technicalvoid.dev/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "RO",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://search.uwabaki.party/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "DE",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://librey.4o1x5.dev/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "HU",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://search.funami.tech/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "KR",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://librex.nohost.network/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "MX",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://librey.baczek.me/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "PL",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://libre.blitzw.in/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "ZA",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://serp.catswords.net/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "KR",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://librey.sny.sh/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "DE",
|
||||
"librey": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://search.liv.town/",
|
||||
"tor": null,
|
||||
"i2p": null,
|
||||
"country": "NL",
|
||||
"librey": true
|
||||
}
|
||||
]
|
||||
}
|
||||
64
instances.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
require_once "misc/header.php";
|
||||
require_once "misc/tools.php";
|
||||
|
||||
$instances_json = json_decode(file_get_contents("instances.json"), true);
|
||||
|
||||
$librey_instances = array_filter($instances_json['instances'], fn($n) => $n['librey']);
|
||||
$librex_instances = array_filter($instances_json['instances'], fn($n) => !$n['librey']);
|
||||
|
||||
|
||||
function list_instances($instances)
|
||||
{
|
||||
echo "<table><tr>";
|
||||
echo "<th>Clearnet</th>";
|
||||
echo "<th>Tor</th>";
|
||||
echo "<th>I2P</th>";
|
||||
echo "<th>Country</th>";
|
||||
echo "</tr>";
|
||||
|
||||
foreach($instances as $instance) {
|
||||
$hostname = parse_url($instance["clearnet"])["host"];
|
||||
$country = get_country_emote($instance["country"]) . $instance["country"];
|
||||
|
||||
$is_tor = !is_null($instance["tor"]);
|
||||
$is_i2p = !is_null($instance["i2p"]);
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td><a href=\"" . $instance["clearnet"] . "\">" . $hostname . "</a></td>";
|
||||
|
||||
echo $is_tor
|
||||
? "<td><a href=\"" . $instance["tor"] . "\">\u{2705}</a></td>"
|
||||
: "<td>\u{274C}</td>";
|
||||
|
||||
echo $is_i2p
|
||||
? "<td><a href=\"" . $instance["i2p"] . "\">\u{2705}</a></td>"
|
||||
:"<td>\u{274C}</td>";
|
||||
|
||||
echo "<td>$country</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
?>
|
||||
// <title>FbIN-Librey Instances</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="misc-container">
|
||||
<center>
|
||||
<h2>Fb<span class="Y">IN</span>-Librey Instances</h2>
|
||||
<?php
|
||||
list_instances($librey_instances);
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (sizeof($librex_instances) > 0){
|
||||
echo "<p>"; printftext("instances_librex", "<a href=\"https://github.com/hnhx/librex\">LibreX</a>:</p>");
|
||||
list_instances($librex_instances);
|
||||
}
|
||||
?>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
|
||||
<?php require_once "misc/footer.php"; ?>
|
||||
57
locale/bn.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
return array(
|
||||
"page_title" => "FbIN দিয়ে অনুসন্ধান",
|
||||
"search_button" => "FbIN দিয়ে অনুসন্ধান করুন",
|
||||
"torrent_search_button" => "FbIN দিয়ে টরেন্ট সার্চ অনুসন্ধান করুন",
|
||||
|
||||
"source_code_link" => "কোডের উৎসস্থল",
|
||||
"instances_link" => "আলাদা মেসিনগুলি",
|
||||
"settings_link" => "সেটিংস",
|
||||
"api_link" => "API",
|
||||
"donate_link" => "ডোনেট করুন ❤️",
|
||||
|
||||
"latest_commit" => "সর্বশেষ অবদান: %s",
|
||||
|
||||
"category_general" => "জেনার্যাল",
|
||||
"category_images" => "ছবি",
|
||||
"category_videos" => "ভিডিও",
|
||||
"category_torrents" => "টরেন্ট",
|
||||
"category_tor" => "টর",
|
||||
"category_maps" => "ম্যাপ",
|
||||
|
||||
"feature_disabled" => "হোস্ট এই ফিছারসগুলি নিষ্ক্রিয় করেছে :C",
|
||||
|
||||
"settings_title" => "সেটিংস",
|
||||
"settings_theme" => "থিম",
|
||||
"settings_special_warning" => "এই চেকবক্সটি 'রিসেট' বোতাম বা আপনার cookies সাফ না হওয়া পর্যন্ত বজায় থাকবে।",
|
||||
"settings_special_disabled" => "বিশেষ অনুসন্ধানগুলি নিষ্ক্রিয় করুন (যেমন: মুদ্রা রূপান্তর)",
|
||||
|
||||
"settings_frontends" => "গোপনীয়তা-বান্ধব ফ্রন্টএন্ড",
|
||||
"settings_frontends_description" => "যদি আপনি ইউটিউব দেখতে চান প্রাইভেসি সমেত, তাহলে \"Invidious\" এ ক্লিক করুন, আপনার জন্য সবচেয়ে উপযুক্ত ইনস্ট্যান্সটি খুঁজুন এবং এটি এখানে পেস্ট করুন (সঠিক ফর্ম্যাট: https://example.com)",
|
||||
"settings_frontends_disable" => "ফ্রন্টএন্ড নিষ্ক্রিয় করুন",
|
||||
|
||||
"settings_search_settings" => "অনুসন্ধান সেটিংস",
|
||||
"settings_language" => "ভাষা",
|
||||
"settings_preferred_engine" => "পছন্দের ইঞ্জিনটি",
|
||||
|
||||
"settings_number_of_results" => "প্রতি পৃষ্ঠায় ফলাফলের সংখ্যা",
|
||||
|
||||
"settings_safe_search" => "নিরাপদ অনুসন্ধান",
|
||||
"settings_save" => "সেটিংস সেভ করুন",
|
||||
"settings_reset" => "সেটিংস রিসেট করুন",
|
||||
|
||||
|
||||
"failure_fallback" => "কোনও ফলাফল পাওয়া যায়নি। অন্যান্য ইনস্ট্যান্সগুলিতে ফেরত যেতে ব্যর্থ হয়েছে।",
|
||||
"failure_empty" => "কোনও ফলাফল পাওয়া যায়নি। দয়া করে ভিন্ন কীওয়ার্ড চেষ্টা করুন!",
|
||||
"result_no_description" => "এই সাইটটির জন্য কোনও বর্ণনা প্রদান করা হয়নি।",
|
||||
|
||||
"instances_librex" => "নিম্নলিখিত ইনস্ট্যান্সগুলি পুরানো %s চালাচ্ছে",
|
||||
|
||||
"donate_original_developer" => "%s এর আসল ডেভেলপারকে দান করুন, একটি প্রকল্প যা FbIN উন্নত করার চেষ্টা করে।",
|
||||
"donate_fork" => "FbIN তে %s কে ফর্ক করে দান করুন",
|
||||
|
||||
"api_unavailable" => "এই FbIN API বর্তমানে উপলব্ধ নয়"
|
||||
);
|
||||
|
||||
?>
|
||||
57
locale/en.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
return array(
|
||||
"page_title" => "FbIN Search",
|
||||
"search_button" => "Search with FbIN",
|
||||
"torrent_search_button" => "Search torrents with FbIN",
|
||||
|
||||
"source_code_link" => "Source",
|
||||
"instances_link" => "Instances",
|
||||
"settings_link" => "Settings",
|
||||
"api_link" => "API",
|
||||
"donate_link" => "Donate ❤️",
|
||||
|
||||
"latest_commit" => "Latest commit: %s",
|
||||
|
||||
"category_general" => "General",
|
||||
"category_images" => "Images",
|
||||
"category_videos" => "Videos",
|
||||
"category_torrents" => "Torrents",
|
||||
"category_tor" => "Tor",
|
||||
"category_maps" => "Maps",
|
||||
|
||||
"feature_disabled" => "The host has disabled this feature :C",
|
||||
|
||||
"settings_title" => "Settings",
|
||||
"settings_theme" => "Theme",
|
||||
"settings_special_warning" => "This checkbox will persist until the 'Reset' button is clicked or your cookies are cleared.",
|
||||
"settings_special_disabled" => "Disable special queries (e.g.: currency conversion)",
|
||||
|
||||
"settings_frontends" => "Privacy friendly frontends",
|
||||
"settings_frontends_description" => "For an example if you want to view YouTube without getting spied on, click on \"Invidious\", find the instance that is most suitable for you then paste it in (correct format: https://example.com)",
|
||||
"settings_frontends_disable" => "Disable frontends",
|
||||
|
||||
"settings_search_settings" => "Search settings",
|
||||
"settings_language" => "Language",
|
||||
"settings_preferred_engine" => "Preferred Engine",
|
||||
|
||||
"settings_number_of_results" => "Number of results per page",
|
||||
|
||||
"settings_safe_search" => "Safe search",
|
||||
"settings_save" => "Save",
|
||||
"settings_reset" => "Reset",
|
||||
|
||||
|
||||
"failure_fallback" => "No results found. Unable to fallback to other instances.",
|
||||
"failure_empty" => "No results found. Please try different keywords!",
|
||||
"result_no_description" => "No description was provided for this site.",
|
||||
|
||||
"instances_librex" => "The following instances are running the older %s",
|
||||
|
||||
"donate_original_developer" => "Donate to the original developer of %s, a project FbIN tries to improve.",
|
||||
"donate_fork" => "Donate to the person that forked %s into FbIN",
|
||||
|
||||
"api_unavailable" => "This FbIN API is unavailable at the moment"
|
||||
);
|
||||
|
||||
?>
|
||||
59
locale/fr.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
// github.com/codedipper
|
||||
|
||||
return array(
|
||||
"page_title" => "Recherche de FbIN",
|
||||
"search_button" => "Chercher avec FbIN",
|
||||
"torrent_search_button" => "Chercher les bit-torrents avec FbIN",
|
||||
|
||||
"source_code_link" => "Code source",
|
||||
"instances_link" => "Instances",
|
||||
"settings_link" => "Paramètres",
|
||||
"api_link" => "API",
|
||||
"donate_link" => "Donner ❤️",
|
||||
|
||||
"latest_commit" => "Commit plus récent : %s",
|
||||
|
||||
"category_general" => "Général",
|
||||
"category_images" => "Images",
|
||||
"category_videos" => "Vidéos",
|
||||
"category_torrents" => "Bit-torrents",
|
||||
"category_tor" => "Tor",
|
||||
"category_maps" => "Cartes",
|
||||
|
||||
"feature_disabled" => "L'hôt(e) a désactivé cette fonction :C",
|
||||
|
||||
"settings_title" => "Paramètres",
|
||||
"settings_theme" => "Thème",
|
||||
"settings_special_warning" => "Cette case à cocher va durer jusqu'à le bouton de 'Réinitialiser' c'est cliqué ou tes cookies sont dégagés.",
|
||||
"settings_special_disabled" => "Désactiver les requêtes spéciaux (par ex. : conversion de la monnaie)",
|
||||
|
||||
"settings_frontends" => "Front-ends d'utilisateurs font pour intimité",
|
||||
"settings_frontends_description" => "Par exemple, si vous voulez voir YouTube sans de s'être espionné, cliquer sur \"Invidious\", trouver l'instance qu'est le plus approprié pour vous et le coller (format correcte : https://example.com)",
|
||||
"settings_frontends_disable" => "Désactiver front-ends de utilisateurs",
|
||||
|
||||
"settings_search_settings" => "Paramètres de la recherche",
|
||||
"settings_language" => "Langue",
|
||||
"settings_preferred_engine" => "Moteur de recherche préféré",
|
||||
|
||||
"settings_number_of_results" => "Nombre des résultats pour chaque page",
|
||||
|
||||
"settings_safe_search" => "SafeSearch",
|
||||
"settings_save" => "Enregistrer",
|
||||
"settings_reset" => "Réinitialiser",
|
||||
|
||||
|
||||
"failure_fallback" => "Pas de résultats trouvés. Ne peux pas faire de rechange sur les autres instances.",
|
||||
"failure_empty" => "Pas de résultats trouvés. S'il vous plaît essayez des mot-clés différents!",
|
||||
"result_no_description" => "Une description n'était pas fouri pour ce site web.",
|
||||
|
||||
"instances_librex" => "Les suivantes instances utiliser le vieux %s",
|
||||
|
||||
"donate_original_developer" => "Donner au développeur original de %s, un projet FbIN essaye d'améliorer.",
|
||||
"donate_fork" => "Donner à la personne qui a dérivé FbIN de %s",
|
||||
|
||||
"api_unavailable" => "Ce API de FbIN est indisponible en ce moment"
|
||||
);
|
||||
|
||||
?>
|
||||
58
locale/hr.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
// github.com/SectorV5
|
||||
|
||||
return array(
|
||||
"page_title" => "FbIN Pretraživanje",
|
||||
"search_button" => "FbIN Pretraživanje",
|
||||
"torrent_search_button" => "Pretraži torrente sa FbIN-om",
|
||||
|
||||
"source_code_link" => "Izvorni kod",
|
||||
"instances_link" => "Instancije",
|
||||
"settings_link" => "Postavke",
|
||||
"api_link" => "API",
|
||||
"donate_link" => "Donirajte ❤️",
|
||||
|
||||
"latest_commit" => "Posljednji commit: %s",
|
||||
|
||||
"category_general" => "Općenito",
|
||||
"category_images" => "Slike",
|
||||
"category_videos" => "Video zapisi",
|
||||
"category_torrents" => "Torrenti",
|
||||
"category_tor" => "Tor",
|
||||
"category_maps" => "Karte",
|
||||
|
||||
"feature_disabled" => "Operater je onemogućio ovu funkciju :C",
|
||||
|
||||
"settings_title" => "Postavke",
|
||||
"settings_theme" => "Tema",
|
||||
"settings_special_disabled" => "Onemogući posebne upite (npr.: konverzija valuta)",
|
||||
|
||||
"settings_frontends" => "Privatni frontendi",
|
||||
"settings_frontends_description" => "Na primjer, ako želite gledati YouTube s privatnošću, kliknite na „Invidious“, pronađite instancu koja vam najviše odgovara, a zatim je zalijepite (ispravan format: https://example.hr)",
|
||||
"settings_frontends_disable" => "Onemogući frontende",
|
||||
|
||||
"settings_search_settings" => "Postavke pretraživanja",
|
||||
"settings_language" => "Jezik",
|
||||
"settings_preferred_engine" => "Preferirani pretraživač",
|
||||
|
||||
"settings_number_of_results" => "Broj rezultata po stranici",
|
||||
|
||||
"settings_safe_search" => "Sigurna pretraga",
|
||||
"settings_save" => "Spremi",
|
||||
"settings_reset" => "Poništi",
|
||||
|
||||
|
||||
"failure_fallback" => "Nema rezultata. Pokušaj prebacivanja na drugu instancu nije uspio.",
|
||||
"failure_empty" => "Nema rezultata. Probajte sa drugim ključnim riječima!",
|
||||
"result_no_description" => "Nisu date dovoljno informacije o ovoj web stranici.",
|
||||
|
||||
"instances_librex" => "Sljedeće instance rade na starijoj verziji %s",
|
||||
|
||||
"donate_original_developer" => "Donirajte programeru koji je razvio projekt %s, koji FbIN pokušava poboljšati",
|
||||
"donate_fork" => "Donirajte osobi koja je napravila fork %s u FbIN",
|
||||
|
||||
"api_unavailable" => "Ovaj FbIN API trenutno nije dostupan"
|
||||
);
|
||||
|
||||
?>
|
||||
59
locale/it.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
// github.com/ThomasDC84 github.com/codedipper
|
||||
|
||||
return array(
|
||||
"page_title" => "FbIN Ricerca",
|
||||
"search_button" => "Cerca con FbIN",
|
||||
"torrent_search_button" => "Cerca torrent con FbIN",
|
||||
|
||||
"source_code_link" => "Sorgente",
|
||||
"instances_link" => "Instanze",
|
||||
"settings_link" => "Impostazioni",
|
||||
"api_link" => "API",
|
||||
"donate_link" => "Dona ❤️",
|
||||
|
||||
"latest_commit" => "Ultimo aggiornamento: %s",
|
||||
|
||||
"category_general" => "Generale",
|
||||
"category_images" => "Immagini",
|
||||
"category_videos" => "Video",
|
||||
"category_torrents" => "Torrent",
|
||||
"category_tor" => "Tor",
|
||||
"category_maps" => "Mappe",
|
||||
|
||||
"feature_disabled" => "L'istanza ha disabilitato questa funzione :C",
|
||||
|
||||
"settings_title" => "Impostazioni",
|
||||
"settings_theme" => "Tema",
|
||||
"settings_special_warning" => "Questa casella di spunta persisterà fino a il bottone di 'Ripristina' è cliccato o i tui cookies sono sgombrati.",
|
||||
"settings_special_disabled" => "Disabilitare le ricerche speciali (ad es.: conversione di valuta)",
|
||||
|
||||
"settings_frontends" => "Intermediari che rispettano la privacy",
|
||||
"settings_frontends_description" => "Per esempio, se volete vedere YouTube senza essere spiati, cliccate su “Invidious”, trovate l'istanza più adatta a voi e incollatela (formato corretto: https://example.com).",
|
||||
"settings_frontends_disable" => "Disabilita gli intermediari",
|
||||
|
||||
"settings_search_settings" => "Impostazioni di ricerca",
|
||||
"settings_language" => "Lingua",
|
||||
"settings_preferred_engine" => "Motore preferito",
|
||||
|
||||
"settings_number_of_results" => "Numero di risultati per pagina",
|
||||
|
||||
"settings_safe_search" => "Ricerca sicura",
|
||||
"settings_save" => "Salva",
|
||||
"settings_reset" => "Ripristina",
|
||||
|
||||
|
||||
"failure_fallback" => "Nessun risultato trovato. Impossibile passare ad altre istanze",
|
||||
"failure_empty" => "Nessun risultato trovato. Provare con altri termini di ricerca!",
|
||||
"result_no_description" => "Non è stata fornita alcuna descrizione per questo sito.",
|
||||
|
||||
"instances_librex" => "Le seguenti istanze stanno eseguendo la vecchia %s",
|
||||
|
||||
"donate_original_developer" => "Fate una donazione allo sviluppatore originale di %s, un progetto che FbIN cerca di migliorare.",
|
||||
"donate_fork" => "Donare alla persona che ha fatto il fork di %s in FbIN",
|
||||
|
||||
"api_unavailable" => "Questa API di FbIN non è al momento disponibile."
|
||||
);
|
||||
|
||||
?>
|
||||
59
locale/ko.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
// github.com/NoaHimesaka1873
|
||||
|
||||
return array(
|
||||
"page_title" => "FbIN 검색",
|
||||
"search_button" => "FbIN로 검색하기",
|
||||
"torrent_search_button" => "FbIN로 토렌트 검색하기",
|
||||
|
||||
"source_code_link" => "소스 코드",
|
||||
"instances_link" => "인스턴스",
|
||||
"settings_link" => "설정",
|
||||
"api_link" => "API",
|
||||
"donate_link" => "후원하기 ❤️",
|
||||
|
||||
"latest_commit" => "마지막 커밋: %s",
|
||||
|
||||
"category_general" => "일반",
|
||||
"category_images" => "이미지",
|
||||
"category_videos" => "영상",
|
||||
"category_torrents" => "토렌트",
|
||||
"category_tor" => "Tor",
|
||||
"category_maps" => "지도",
|
||||
|
||||
"feature_disabled" => "운영자가 이 기능을 비활성화 했습니다 :C",
|
||||
|
||||
"settings_title" => "설정",
|
||||
"settings_theme" => "테마",
|
||||
"settings_special_warning" => "이 체크박스는 '초기화' 버튼을 누르거나 쿠키를 제거하기 전까지 선택이 유지됩니다.",
|
||||
"settings_special_disabled" => "특수 검색어 비활성화 (예: 환전 등)",
|
||||
|
||||
"settings_frontends" => "프라이버시 친화적 프론트엔드",
|
||||
"settings_frontends_description" => "예를 들어 YouTube를 감시 없이 보고 싶다면, \"Invidious\"를 클릭하고, 당신에게 가장 맞는 인스턴스를 고른 다음 링크를 붙여넣으세요. (링크는 https://example.com 처럼 생겨야 합니다)",
|
||||
"settings_frontends_disable" => "프론트엔드 비활성화",
|
||||
|
||||
"settings_search_settings" => "검색 설정",
|
||||
"settings_language" => "언어",
|
||||
"settings_preferred_engine" => "선호하는 검색 엔진",
|
||||
|
||||
"settings_number_of_results" => "페이지 당 표시할 결과 수",
|
||||
|
||||
"settings_safe_search" => "세이프서치",
|
||||
"settings_save" => "저장",
|
||||
"settings_reset" => "초기화",
|
||||
|
||||
|
||||
"failure_fallback" => "결과 없음. 다른 인스턴스로 대체 시도 실패.",
|
||||
"failure_empty" => "결과 없음. 다른 검색어로 시도 해 보세요!",
|
||||
"result_no_description" => "이 사이트에 대한 정보가 없습니다.",
|
||||
|
||||
"instances_librex" => "다음 인스턴스들은 예전 %s을(를) 구동 중입니다",
|
||||
|
||||
"donate_original_developer" => "FbIN가 개선하고자 하는 프로젝트인 %s을(를) 개발한 사람에게 기부하기",
|
||||
"donate_fork" => "%s을(를) FbIN로 포크 한 사람에게 기부하기",
|
||||
|
||||
"api_unavailable" => "이 FbIN API는 현재 사용할 수 없습니다"
|
||||
);
|
||||
|
||||
?>
|
||||
28
locale/localization.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
function printtext($key) {
|
||||
echo TEXTS[$key];
|
||||
}
|
||||
|
||||
function printftext() {
|
||||
$argv = func_get_args();
|
||||
$key = array_shift($argv);
|
||||
return vprintf(TEXTS[$key], $argv);
|
||||
}
|
||||
|
||||
// default to language "en"
|
||||
$locale = "en";
|
||||
|
||||
if (array_key_exists("HTTP_ACCEPT_LANGUAGE", $_SERVER)) {
|
||||
$accept_language_header = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
|
||||
|
||||
foreach(explode(",", explode(";", $accept_language_header)[0]) as $header_language) {
|
||||
if (file_exists("locale/$header_language.php")) {
|
||||
$locale = $header_language;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
define("TEXTS", require_once "locale/$locale.php");
|
||||
?>
|
||||
59
locale/nl.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
// github.com/Ahwxorg
|
||||
|
||||
return array(
|
||||
"page_title" => "FbIN Search",
|
||||
"search_button" => "Zoek met FbIN",
|
||||
"torrent_search_button" => "Zoek naar torrents met FbIN",
|
||||
|
||||
"source_code_link" => "Broncode",
|
||||
"instances_link" => "Instances",
|
||||
"settings_link" => "Instellingen",
|
||||
"api_link" => "API",
|
||||
"donate_link" => "Doneer ❤️",
|
||||
|
||||
"latest_commit" => "Laatste commit: %s",
|
||||
|
||||
"category_general" => "Algemeen",
|
||||
"category_images" => "Foto's",
|
||||
"category_videos" => "Videos",
|
||||
"category_torrents" => "Torrents",
|
||||
"category_tor" => "Tor",
|
||||
"category_maps" => "Kaarten",
|
||||
|
||||
"feature_disabled" => "De host heeft deze functie uitgeschakeld :C",
|
||||
|
||||
"settings_title" => "Instellingen",
|
||||
"settings_theme" => "Thema",
|
||||
"settings_special_warning" => "Als u dit selectievakje inschakelt, blijft de instelling actief totdat u op de Reset knop klikt of uw cookies op andere wijze aangepast worden.",
|
||||
"settings_special_disabled" => "Schakel speciale zoekopdrachten uit (bijvoorbeeld: valutaconversie)",
|
||||
|
||||
"settings_frontends" => "Privacyvriendelijke frontends",
|
||||
"settings_frontends_description" => "Als je - bijvoorbeeld - naar YouTube wil kijken zonder bespioneerd te worden, klik dan op \"Invidious\", zoek een instance die het best voor jou is en plak de URL hier in (correct formaat: https://example.com)",
|
||||
"settings_frontends_disable" => "Frontends uitschakelen",
|
||||
|
||||
"settings_search_settings" => "Zoek-gerelateerde instellingen",
|
||||
"settings_language" => "Taal",
|
||||
"settings_preferred_engine" => "Favoriete zoekmachine",
|
||||
|
||||
"settings_number_of_results" => "Resulaten per pagina (in nummers)",
|
||||
|
||||
"settings_safe_search" => "Safe search",
|
||||
"settings_save" => "Opslaan",
|
||||
"settings_reset" => "Reset",
|
||||
|
||||
|
||||
"failure_fallback" => "Geen resultaten gevonden. Kan niet terugvallen op andere instances.",
|
||||
"failure_empty" => "Geen resultaten gevonden. Probeer een andere zoekterm/andere keywords!",
|
||||
"result_no_description" => "Voor deze website is geen omschrijving gegeven.",
|
||||
|
||||
"instances_librex" => "De volgende instances draaien de oudere versie; %s",
|
||||
|
||||
"donate_original_developer" => "Doneer aan de originele ontwikkelaar van %s, een project dat FbIN probeert te verbeteren.",
|
||||
"donate_fork" => "Doneer aan de persoon die %s heeft geforkt naar FbIN",
|
||||
|
||||
"api_unavailable" => "De FbIN API is op dit moment niet beschikbaar"
|
||||
);
|
||||
|
||||
?>
|
||||
58
locale/sr.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
// github.com/SectorV5
|
||||
|
||||
return array(
|
||||
"page_title" => "FbIN Претрага",
|
||||
"search_button" => "Претражи са FbIN-ем",
|
||||
"torrent_search_button" => "Претражи торенте са FbIN-ем",
|
||||
|
||||
"source_code_link" => "Изворни код",
|
||||
"instances_link" => "Инстанце",
|
||||
"settings_link" => "Подешавања",
|
||||
"api_link" => "API",
|
||||
"donate_link" => "Донирајте ❤️",
|
||||
|
||||
"latest_commit" => "Последњи комит: %s",
|
||||
|
||||
"category_general" => "Опште",
|
||||
"category_images" => "Слике",
|
||||
"category_videos" => "Видео снимци",
|
||||
"category_torrents" => "Торенти",
|
||||
"category_tor" => "Tor",
|
||||
"category_maps" => "Мапе",
|
||||
|
||||
"feature_disabled" => "Оператор је онемогућио ову функцију :C",
|
||||
|
||||
"settings_title" => "Подешавања",
|
||||
"settings_theme" => "Тема",
|
||||
"settings_special_disabled" => "Онемогући посебне упите (нпр.: конверзија валута)",
|
||||
|
||||
"settings_frontends" => "Приватни фронтендови",
|
||||
"settings_frontends_description" => "На пример, ако желите да гледате YouTube са приватношћу, кликните на „Invidious“, пронађите инстанцу која вам највише одговара, а затим је налепите (исправан формат: https://example.rs)",
|
||||
"settings_frontends_disable" => "Онемогући фронтендове",
|
||||
|
||||
"settings_search_settings" => "Подешавања претраге",
|
||||
"settings_language" => "Језик",
|
||||
"settings_preferred_engine" => "Преферирани претраживач",
|
||||
|
||||
"settings_number_of_results" => "Број резултата по страници",
|
||||
|
||||
"settings_safe_search" => "Безбедна претрага",
|
||||
"settings_save" => "Сачувај",
|
||||
"settings_reset" => "Ресетуј",
|
||||
|
||||
|
||||
"failure_fallback" => "Нема резултата. Покушај пребацивања на другу инстанцију није успео.",
|
||||
"failure_empty" => "Нема резултата. Пробајте са другачијим кључним речима!",
|
||||
"result_no_description" => "Нису дате довољно информације о овој Веб страници.",
|
||||
|
||||
"instances_librex" => "Следеће инстанце раде на старијој верзији %s",
|
||||
|
||||
"donate_original_developer" => "Донирајте програмеру који је развио пројекат %s, који FbIN покушава да побољша",
|
||||
"donate_fork" => "Донирајте особи која је направила форк %s у FbIN",
|
||||
|
||||
"api_unavailable" => "Овај FbIN API тренутно није доступан"
|
||||
);
|
||||
|
||||
?>
|
||||
61
locale/sv.php
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
// github.com/norrlandxyz
|
||||
|
||||
return array(
|
||||
"page_title" => "FbIN Search",
|
||||
"search_button" => "Sök med FbIN",
|
||||
"torrent_search_button" => "Sök torrents med FbIN",
|
||||
|
||||
"source_code_link" => "Källkod",
|
||||
"instances_link" => "Instanser",
|
||||
"settings_link" => "Inställningar",
|
||||
"api_link" => "API",
|
||||
"donate_link" => "Donera ❤️",
|
||||
|
||||
"latest_commit" => "Senaste commit: %s",
|
||||
|
||||
"category_general" => "Allmänt",
|
||||
"category_images" => "Bilder",
|
||||
"category_videos" => "Videor",
|
||||
"category_torrents" => "Torrents",
|
||||
"category_tor" => "Tor",
|
||||
"category_maps" => "Kartor",
|
||||
|
||||
"feature_disabled" => "Funktionen är inaktiverad av serverägaren :C",
|
||||
|
||||
"settings_title" => "Inställningar",
|
||||
"settings_theme" => "Tema",
|
||||
"settings_special_warning" => "Rutorna sparas tills du klickar på 'Återställ' eller rensar cookies.",
|
||||
"settings_special_disabled" => "Inaktivera specialförfrågningar (t.ex. valutaomvandlare)",
|
||||
|
||||
"settings_frontends" => "Privata frontends",
|
||||
"settings_frontends_description" => "För om du vill titta på YouTube utan att bli spionerad på, klicka på \"Invidious\", hitta den instans som passar dig bäst och klistra in (korrekt format: https://example.com)",
|
||||
"settings_frontends_disable" => "Stäng av frontends",
|
||||
|
||||
"settings_search_settings" => "Sökinställningar",
|
||||
"settings_language" => "Språk",
|
||||
"settings_preferred_engine" => "Föredragen sökmotor",
|
||||
|
||||
|
||||
"settings_number_of_results" => "Antal resultat per sida",
|
||||
|
||||
"settings_safe_search" => "Safe search", //typically not translated
|
||||
"settings_save" => "Spara",
|
||||
"settings_reset" => "Återställ",
|
||||
|
||||
|
||||
"failure_fallback" => "Inga resultat hittades. Gick inte att använda andra instanser som reservlösning.",
|
||||
"failure_empty" => "Inga resultat hittades. Var god försök med andra nyckelord!",
|
||||
"result_no_description" => "Ingen beskrivning finns för denna webbplats.",
|
||||
|
||||
"instances_librex" => "Följande instanser kör den äldre %s",
|
||||
|
||||
"donate_original_developer" => "Donera till orginalutvecklaren av %s, ett
|
||||
projekt som FbIN försöker förbättra.",
|
||||
"donate_fork" => "Donera till personen som forkade %s till FbIN",
|
||||
|
||||
"api_unavailable" => "Denna FbIN API är för närvarande otillgänglig."
|
||||
);
|
||||
|
||||
?>
|
||||
59
locale/uk.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
// github.com/mrRomanko
|
||||
|
||||
return array(
|
||||
"page_title" => "Пошук FbIN",
|
||||
"search_button" => "Шукати за допомогою FbIN",
|
||||
"torrent_search_button" => "Шукати торренти за допомогою FbIN",
|
||||
|
||||
"source_code_link" => "Код",
|
||||
"instances_link" => "Інстанси",
|
||||
"settings_link" => "Налаштування",
|
||||
"api_link" => "API",
|
||||
"donate_link" => "Пожертвувати ❤️",
|
||||
|
||||
"latest_commit" => "Останній комміт: %s",
|
||||
|
||||
"category_general" => "Загальне",
|
||||
"category_images" => "Зображення",
|
||||
"category_videos" => "Відео",
|
||||
"category_torrents" => "Торренти",
|
||||
"category_tor" => "Tor",
|
||||
"category_maps" => "Карти",
|
||||
|
||||
"feature_disabled" => "Хост вимкнув цю функцію :C",
|
||||
|
||||
"settings_title" => "Налаштування",
|
||||
"settings_theme" => "Тема",
|
||||
"settings_special_warning" => "Цей прапорець залишатиметься, доки не буде натиснута кнопка «Скинути» або не буде очищено кукі.",
|
||||
"settings_special_disabled" => "Вимкнути спеціальні запити (наприклад: конвертація валют)",
|
||||
|
||||
"settings_frontends" => "Приватні фронтенди",
|
||||
"settings_frontends_description" => "Наприклад, якщо ви хочете переглядати YouTube без стеження, натисніть на \"Invidious\", знайдіть інстанс, який вам підходить, і вставте його (правильний формат: https://example.com)",
|
||||
"settings_frontends_disable" => "Вимкнути фронтенди",
|
||||
|
||||
"settings_search_settings" => "Налаштування пошуку",
|
||||
"settings_language" => "Мова",
|
||||
"settings_preferred_engine" => "Бажаний рушій",
|
||||
|
||||
"settings_number_of_results" => "Кількість результатів на сторінці",
|
||||
|
||||
"settings_safe_search" => "Безпечний пошук",
|
||||
"settings_save" => "Зберегти",
|
||||
"settings_reset" => "Скинути",
|
||||
|
||||
|
||||
"failure_fallback" => "Результатів не знайдено. Неможливо використати резервні інстанси.",
|
||||
"failure_empty" => "Результатів не знайдено. Спробуйте інші ключові слова!",
|
||||
"result_no_description" => "Опис цього сайту не надано.",
|
||||
|
||||
"instances_librex" => "Наступні інстанси працюють на старішій версії %s",
|
||||
|
||||
"donate_original_developer" => "Пожертвувати оригінальному розробнику %s, проєкт, який FbIN намагається поліпшити.",
|
||||
"donate_fork" => "Пожертвувати людині, яка форкнула %s у FbIN",
|
||||
|
||||
"api_unavailable" => "API FbIN наразі недоступне"
|
||||
);
|
||||
|
||||
?>
|
||||
45
misc/cooldowns.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
if (!function_exists("apcu_fetch"))
|
||||
error_log("apcu is not installed! Please consider installing php-pecl-apcu for significant performance improvements");
|
||||
|
||||
|
||||
function load_cooldowns() {
|
||||
if (function_exists("apcu_fetch"))
|
||||
return apcu_exists("cooldowns") ? apcu_fetch("cooldowns") : array();
|
||||
return array();
|
||||
}
|
||||
|
||||
function save_cooldowns($cooldowns) {
|
||||
if (function_exists("apcu_store"))
|
||||
apcu_store("cooldowns", $cooldowns);
|
||||
}
|
||||
|
||||
function set_cooldown($instance, $timeout, $cooldowns) {
|
||||
$cooldowns[$instance] = time() + $timeout;
|
||||
save_cooldowns($cooldowns);
|
||||
return $cooldowns;
|
||||
}
|
||||
|
||||
function has_cooldown($instance, $cooldowns) {
|
||||
return ($cooldowns[$instance] ?? 0) > time();
|
||||
}
|
||||
|
||||
function has_cached_results($url) {
|
||||
if (function_exists("apcu_exists"))
|
||||
return apcu_exists("cached:$url");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function store_cached_results($url, $results, $ttl = 0) {
|
||||
if (function_exists("apcu_store") && !empty($results) && $ttl >= 0)
|
||||
return apcu_store("cached:$url", $results, $ttl);
|
||||
}
|
||||
|
||||
function fetch_cached_results($url) {
|
||||
if (function_exists("apcu_fetch"))
|
||||
return apcu_fetch("cached:$url");
|
||||
|
||||
return array();
|
||||
}
|
||||
?>
|
||||
19
misc/footer.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<div class="footer-container">
|
||||
<a href="./">FbIN</a>
|
||||
<a href="https://git.flossboxin.org.in/FbIN/LibreY/" target="_blank"><?php printtext("source_code_link");?></a>
|
||||
<a href="./settings.php"><?php printtext("settings_link");?></a>
|
||||
<?php if(!$opts->disable_api) {
|
||||
echo '<a href="./api.php" target="_blank">', printtext("api_link"), '</a>';
|
||||
} ?>
|
||||
</div>
|
||||
<div class="git-container">
|
||||
<?php
|
||||
if (file_exists(".git/refs/heads/main")) {
|
||||
$hash = file_get_contents(".git/refs/heads/main");
|
||||
}
|
||||
|
||||
echo "<a href='https://git.flossboxin.org.in/FbIN/LibreY/commit/$hash' target='_blank'>" . printftext("latest_commit", $hash) . "</a>";
|
||||
?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
16
misc/header.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php require_once "locale/localization.php";
|
||||
$GLOBALS["opts"] = require_once "config.php";
|
||||
?>
|
||||
<!DOCTYPE html >
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="description" content="A privacy respecting meta search engine."/>
|
||||
<meta name="referrer" content="no-referrer"/>
|
||||
<link rel="stylesheet" type="text/css" href="static/css/styles.css"/>
|
||||
<link title="<?php printtext("page_title"); ?>" type="application/opensearchdescription+xml" href="opensearch.xml?method=POST" rel="search"/>
|
||||
<link rel="stylesheet" type="text/css" href="<?php
|
||||
$theme = $_REQUEST["theme"] ?? trim(htmlspecialchars($_COOKIE["theme"] ?? $GLOBALS["opts"]->default_theme ?? "catppuccin_macchiato"));
|
||||
echo "static/css/" . $theme . ".css";
|
||||
?>"/>
|
||||
191
misc/search_engine.php
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
<?php
|
||||
require_once "misc/cooldowns.php";
|
||||
abstract class EngineRequest {
|
||||
protected $url, $query, $page, $opts, $mh, $ch;
|
||||
|
||||
protected $DO_CACHING = true;
|
||||
public function __construct($opts, $mh) {
|
||||
$this->query = $opts->query;
|
||||
$this->page = $opts->page;
|
||||
$this->mh = $mh;
|
||||
$this->opts = $opts;
|
||||
|
||||
$this->url = $this->get_request_url();
|
||||
if (!$this->url)
|
||||
return;
|
||||
|
||||
if (has_cached_results($this->url))
|
||||
return;
|
||||
|
||||
$this->ch = curl_init($this->url);
|
||||
|
||||
if ($opts->curl_settings)
|
||||
curl_setopt_array($this->ch, $opts->curl_settings);
|
||||
|
||||
if ($mh)
|
||||
curl_multi_add_handle($mh, $this->ch);
|
||||
}
|
||||
|
||||
public function get_request_url() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public function successful() {
|
||||
return (isset($this->ch) && curl_getinfo($this->ch)['http_code'] == '200')
|
||||
|| has_cached_results($this->url);
|
||||
}
|
||||
|
||||
abstract function parse_results($response);
|
||||
|
||||
public function get_results() {
|
||||
if (!isset($this->url))
|
||||
return $this->parse_results(null);
|
||||
|
||||
if ($this->DO_CACHING && has_cached_results($this->url))
|
||||
return fetch_cached_results($this->url);
|
||||
|
||||
if (!isset($this->ch))
|
||||
return $this->parse_results(null);
|
||||
|
||||
$response = $this->mh ? curl_multi_getcontent($this->ch) : curl_exec($this->ch);
|
||||
$results = $this->parse_results($response) ?? array();
|
||||
|
||||
if ($this->DO_CACHING && !empty($results))
|
||||
store_cached_results($this->url, $results, $this->opts->cache_time * 60);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public static function print_results($results, $opts) {}
|
||||
}
|
||||
|
||||
function load_opts() {
|
||||
if (isset($GLOBALS["opts"]))
|
||||
$opts = $GLOBALS["opts"];
|
||||
else
|
||||
$opts = require_once "config.php";
|
||||
|
||||
# account for the old, misspelled options
|
||||
if (isset($opts->disable_bittorent_search))
|
||||
$opts->disable_bittorrent_search = $opts->disable_bittorent_search;
|
||||
|
||||
if (isset($opts->bittorent_trackers))
|
||||
$opts->bittorrent_trackers = $opts->bittorent_trackers;
|
||||
|
||||
$opts->request_cooldown ??= 25;
|
||||
$opts->cache_time ??= 25;
|
||||
|
||||
$opts->query = trim($_REQUEST["q"] ?? "");
|
||||
$opts->type = (int) ($_REQUEST["t"] ?? 0);
|
||||
$opts->page = (int) ($_REQUEST["p"] ?? 0);
|
||||
|
||||
$opts->theme = $_REQUEST["theme"] ?? trim(htmlspecialchars($_COOKIE["theme"] ?? $opts->default_theme ?? "dark"));
|
||||
|
||||
$opts->safe_search = (int) ($_REQUEST["safe"] ?? 0) == 1 || isset($_COOKIE["safe_search"]);
|
||||
|
||||
$opts->disable_special = (int) ($_REQUEST["ns"] ?? 0) == 1 || isset($_COOKIE["disable_special"]);
|
||||
|
||||
$opts->disable_frontends = (int) ($_REQUEST["nf"] ?? 0) == 1 || isset($_COOKIE["disable_frontends"]);
|
||||
|
||||
$opts->language = $_REQUEST["lang"] ?? trim(htmlspecialchars($_COOKIE["language"] ?? $opts->language ?? "en"));
|
||||
|
||||
$opts->do_fallback = (int) ($_REQUEST["nfb"] ?? 0) == 0;
|
||||
if (!$opts->instance_fallback) {
|
||||
$opts->do_fallback = false;
|
||||
}
|
||||
|
||||
$opts->number_of_results ??= trim(htmlspecialchars($_COOKIE["number_of_results"]));
|
||||
|
||||
foreach (array_keys($opts->frontends ?? array()) as $frontend) {
|
||||
$opts->frontends[$frontend]["instance_url"] = $_COOKIE[$frontend] ?? $opts->frontends[$frontend]["instance_url"];
|
||||
}
|
||||
|
||||
$opts->curl_settings[CURLOPT_FOLLOWLOCATION] ??= true;
|
||||
|
||||
$opts->engine = $_REQUEST["engine"] ?? $_COOKIE["engine"] ?? $opts->preferred_engines["text"] ?? "auto";
|
||||
|
||||
return $opts;
|
||||
}
|
||||
|
||||
function opts_to_params($opts) {
|
||||
$query = urlencode($opts->query);
|
||||
|
||||
$params = "";
|
||||
$params .= "p=$opts->page";
|
||||
$params .= "&q=$query";
|
||||
$params .= "&t=$opts->type";
|
||||
$params .= "&safe=" . ($opts->safe_search ? 1 : 0);
|
||||
$params .= "&nf=" . ($opts->disable_frontends ? 1 : 0);
|
||||
$params .= "&ns=" . ($opts->disable_special ? 1 : 0);
|
||||
$params .= "&engine=" . ($opts->engine ?? "auto");
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
function init_search($opts, $mh) {
|
||||
switch ($opts->type)
|
||||
{
|
||||
case 1:
|
||||
require_once "engines/qwant/image.php";
|
||||
return new QwantImageSearch($opts, $mh);
|
||||
|
||||
case 2:
|
||||
require_once "engines/invidious/video.php";
|
||||
return new VideoSearch($opts, $mh);
|
||||
|
||||
case 3:
|
||||
if ($opts->disable_bittorrent_search) {
|
||||
echo "<p class=\"text-result-container\">" . TEXTS["feature_disabled"] . "</p>";
|
||||
break;
|
||||
}
|
||||
|
||||
require_once "engines/bittorrent/merge.php";
|
||||
return new TorrentSearch($opts, $mh);
|
||||
|
||||
case 4:
|
||||
if ($opts->disable_hidden_service_search) {
|
||||
echo "<p class=\"text-result-container\">" . TEXTS["feature_disabled"] . "</p>";
|
||||
break;
|
||||
}
|
||||
require_once "engines/ahmia/hidden_service.php";
|
||||
return new TorSearch($opts, $mh);
|
||||
|
||||
case 5:
|
||||
require_once "engines/maps/openstreetmap.php";
|
||||
return new OSMRequest($opts, $mh);
|
||||
|
||||
default:
|
||||
require_once "engines/text/text.php";
|
||||
return new TextSearch($opts, $mh);
|
||||
}
|
||||
}
|
||||
|
||||
function fetch_search_results($opts, $do_print) {
|
||||
$opts->cooldowns = load_cooldowns();
|
||||
|
||||
$start_time = microtime(true);
|
||||
$mh = curl_multi_init();
|
||||
$search_category = init_search($opts, $mh);
|
||||
|
||||
$running = null;
|
||||
|
||||
do {
|
||||
curl_multi_exec($mh, $running);
|
||||
} while ($running);
|
||||
|
||||
$results = $search_category->get_results();
|
||||
|
||||
if (empty($results)) {
|
||||
require_once "engines/librex/fallback.php";
|
||||
$results = get_librex_results($opts);
|
||||
}
|
||||
|
||||
if (!$do_print || empty($results))
|
||||
return $results;
|
||||
|
||||
print_elapsed_time($start_time, $results, $opts);
|
||||
$search_category->print_results($results, $opts);
|
||||
|
||||
return $results;
|
||||
}
|
||||
?>
|
||||
205
misc/tools.php
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
<?php
|
||||
function get_base_url($url) {
|
||||
$parsed = parse_url($url);
|
||||
|
||||
if (isset($parsed["scheme"]) && isset($parsed["host"]) && !empty($parsed["scheme"]) && !empty($parsed["host"])) {
|
||||
return $parsed["scheme"] . "://" . $parsed["host"] . "/";
|
||||
} else {
|
||||
logStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
function seconds_to_human_readable($inputSeconds) {
|
||||
$secondsInAMinute = 60;
|
||||
$secondsInAnHour = 60 * $secondsInAMinute;
|
||||
$secondsInADay = 24 * $secondsInAnHour;
|
||||
|
||||
$days = floor($inputSeconds / $secondsInADay);
|
||||
$hourSeconds = $inputSeconds % $secondsInADay;
|
||||
$hours = floor($hourSeconds / $secondsInAnHour);
|
||||
$minuteSeconds = $hourSeconds % $secondsInAnHour;
|
||||
$minutes = floor($minuteSeconds / $secondsInAMinute);
|
||||
$remainingSeconds = $minuteSeconds % $secondsInAMinute;
|
||||
$seconds = ceil($remainingSeconds);
|
||||
$timeParts = [];
|
||||
$sections = [
|
||||
'day' => (int)$days,
|
||||
'hour' => (int)$hours,
|
||||
'minute' => (int)$minutes,
|
||||
'second' => (int)$seconds,
|
||||
];
|
||||
|
||||
foreach ($sections as $name => $value){
|
||||
if ($value > 0){
|
||||
$timeParts[] = $value. ' '.$name.($value == 1 ? '' : 's');
|
||||
}
|
||||
}
|
||||
|
||||
return implode(', ', $timeParts);
|
||||
}
|
||||
|
||||
function get_root_domain($url) {
|
||||
return parse_url($url, PHP_URL_HOST);
|
||||
}
|
||||
|
||||
function try_replace_with_frontend($url, $frontend, $original, $opts) {
|
||||
$frontends = $opts->frontends;
|
||||
|
||||
if (array_key_exists($frontend, $opts->frontends)) {
|
||||
$frontend = $frontends[$frontend]["instance_url"];
|
||||
|
||||
if (empty(trim($frontend)))
|
||||
return $url;
|
||||
|
||||
if (strpos($url, "wikipedia.org") !== false) {
|
||||
$wiki_split = explode(".", $url);
|
||||
if (count($wiki_split) > 1) {
|
||||
$lang = explode("://", $wiki_split[0])[1];
|
||||
$url = $frontend . explode($original, $url)[1] . (strpos($url, "?") !== false ? "&" : "?") . "lang=" . $lang;
|
||||
}
|
||||
} else if (strpos($url, "fandom.com") !== false) {
|
||||
$fandom_split = explode(".", $url);
|
||||
if (count($fandom_split) > 1) {
|
||||
$wiki_name = explode("://", $fandom_split[0])[1];
|
||||
$url = $frontend . "/" . $wiki_name . explode($original, $url)[1];
|
||||
}
|
||||
} else if (strpos($url, "gist.github.com") !== false) {
|
||||
$gist_path = explode("gist.github.com", $url)[1];
|
||||
$url = $frontend . "/gist" . $gist_path;
|
||||
} else if (strpos($url, "stackexchange.com") !== false) {
|
||||
$se_domain = explode(".", explode("://", $url)[1])[0];
|
||||
$se_path = explode("stackexchange.com", $url)[1];
|
||||
$url = $frontend . "/exchange" . "/" . $se_domain . $se_path;
|
||||
} else {
|
||||
$url = $frontend . explode($original, $url)[1];
|
||||
}
|
||||
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
function check_for_privacy_frontend($url, $opts) {
|
||||
if ($opts->disable_frontends)
|
||||
return $url;
|
||||
|
||||
foreach($opts->frontends as $frontend => $data) {
|
||||
$original = $data["original_url"];
|
||||
|
||||
if (strpos($url, $original)) {
|
||||
$url = try_replace_with_frontend($url, $frontend, $original, $opts);
|
||||
break;
|
||||
} else if (strpos($url, "stackexchange.com")) {
|
||||
$url = try_replace_with_frontend($url, "anonymousoverflow", "stackexchange.com", $opts);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
function get_xpath($response) {
|
||||
if (!$response)
|
||||
return null;
|
||||
|
||||
$htmlDom = new DOMDocument;
|
||||
@$htmlDom->loadHTML($response);
|
||||
$xpath = new DOMXPath($htmlDom);
|
||||
|
||||
return $xpath;
|
||||
}
|
||||
|
||||
function request($url, $conf) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt_array($ch, $conf);
|
||||
$response = curl_exec($ch);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
function human_filesize($bytes, $dec = 2) {
|
||||
$size = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
$factor = floor((strlen($bytes) - 1) / 3);
|
||||
|
||||
return sprintf("%.{$dec}f ", $bytes / pow(1024, $factor)) . @$size[$factor];
|
||||
}
|
||||
|
||||
function remove_special($string) {
|
||||
$string = preg_replace("/[\r\n]+/", "\n", $string);
|
||||
return trim(preg_replace("/\s+/", ' ', $string));
|
||||
}
|
||||
|
||||
function print_elapsed_time($start_time, $results, $opts) {
|
||||
$source = "";
|
||||
if (array_key_exists("results_source", $results)) {
|
||||
$source = " from " . $results["results_source"];
|
||||
unset($results["results_source"]);
|
||||
}
|
||||
|
||||
$end_time = number_format(microtime(true) - $start_time, 2, '.', '');
|
||||
echo "<p id=\"time\">Fetched the results in $end_time seconds$source</p>";
|
||||
}
|
||||
|
||||
function print_next_page_button($text, $page, $query, $type) {
|
||||
echo "<form class=\"page\" action=\"search.php\" target=\"_top\" method=\"get\" autocomplete=\"off\">";
|
||||
echo "<input type=\"hidden\" name=\"p\" value=\"" . $page . "\" />";
|
||||
echo "<input type=\"hidden\" name=\"q\" value=\"$query\" />";
|
||||
echo "<input type=\"hidden\" name=\"t\" value=\"$type\" />";
|
||||
echo "<button type=\"submit\">$text</button>";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
function copy_cookies($curl) {
|
||||
if (array_key_exists("HTTP_COOKIE", $_SERVER))
|
||||
curl_setopt( $curl, CURLOPT_COOKIE, $_SERVER['HTTP_COOKIE'] );
|
||||
}
|
||||
|
||||
|
||||
function get_country_emote($code) {
|
||||
$emoji = [];
|
||||
foreach(str_split($code) as $c) {
|
||||
if(($o = ord($c)) > 64 && $o % 32 < 27) {
|
||||
$emoji[] = hex2bin("f09f87" . dechex($o % 32 + 165));
|
||||
continue;
|
||||
}
|
||||
|
||||
$emoji[] = $c;
|
||||
}
|
||||
|
||||
return join($emoji);
|
||||
}
|
||||
|
||||
function logStackTrace() {
|
||||
// Get the stack trace
|
||||
$stackTrace = debug_backtrace();
|
||||
|
||||
// Format the stack trace for logging
|
||||
$logMessage = "Stack Trace: ";
|
||||
foreach ($stackTrace as $index => $trace) {
|
||||
// Skip the first entry as it's the current function call
|
||||
if ($index === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Build the log message for each stack frame
|
||||
$logMessage .= "#{$index} ";
|
||||
if (isset($trace['file'])) {
|
||||
$logMessage .= "File: {$trace['file']} ";
|
||||
}
|
||||
if (isset($trace['line'])) {
|
||||
$logMessage .= "Line: {$trace['line']} ";
|
||||
}
|
||||
if (isset($trace['function'])) {
|
||||
$logMessage .= "Function: {$trace['function']} ";
|
||||
}
|
||||
$logMessage .= "\n";
|
||||
}
|
||||
|
||||
// Log the stack trace to the error log
|
||||
error_log($logMessage);
|
||||
}
|
||||
|
||||
?>
|
||||
11
opensearch.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<ShortName>FbIN</ShortName>
|
||||
<Description>Framework and javascript free privacy respecting meta search engine</Description>
|
||||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<LongName>FbIN Search</LongName>
|
||||
<Url rel="results" type="text/html" method="get" template="https://link.flossboxin.org.in/search.php?q={searchTerms}" />
|
||||
<Url type="application/opensearchdescription+xml"
|
||||
rel="self"
|
||||
template="https://link.flossboxin.org.in/opensearch.xml?method=GET" />
|
||||
</OpenSearchDescription>
|
||||
79
search.php
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
require_once "misc/header.php";
|
||||
|
||||
require_once "misc/tools.php";
|
||||
require_once "misc/search_engine.php";
|
||||
|
||||
$opts = load_opts();
|
||||
|
||||
function print_page_buttons($type, $query, $page) {
|
||||
if ($type > 1)
|
||||
return;
|
||||
echo "<div class=\"next-page-button-wrapper\">";
|
||||
|
||||
if ($page != 0)
|
||||
{
|
||||
print_next_page_button("<<", 0, $query, $type);
|
||||
print_next_page_button("<", $page - 10, $query, $type);
|
||||
}
|
||||
|
||||
for ($i=$page / 10; $page / 10 + 10 > $i; $i++)
|
||||
print_next_page_button($i + 1, $i * 10, $query, $type);
|
||||
|
||||
print_next_page_button(">", $page + 10, $query, $type);
|
||||
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
|
||||
<title>
|
||||
<?php
|
||||
echo $opts->query;
|
||||
?> - <?php printtext("page_title");?></title>
|
||||
</head>
|
||||
<body>
|
||||
<form class="sub-search-container" method="get" autocomplete="off">
|
||||
<h1 class="logomobile"><a class="no-decoration" href="./">Fb<span class="Y">IN</span></a></h1>
|
||||
<input type="text" name="q"
|
||||
<?php
|
||||
if (1 > strlen($opts->query) || strlen($opts->query) > 256)
|
||||
{
|
||||
header("Location: ./");
|
||||
die();
|
||||
}
|
||||
|
||||
echo "value=\"" . htmlspecialchars($opts->query) . "\"";
|
||||
?>
|
||||
>
|
||||
<br>
|
||||
<?php
|
||||
echo "<button class=\"hide\" name=\"t\" value=\"$opts->type\"/></button>";
|
||||
?>
|
||||
<button type="submit" class="hide"></button>
|
||||
<input type="hidden" name="p" value="0">
|
||||
<div class="sub-search-button-wrapper">
|
||||
<?php
|
||||
$categories = array("general", "images", "videos", "torrents", "tor", "maps");
|
||||
|
||||
foreach ($categories as $category)
|
||||
{
|
||||
$category_index = array_search($category, $categories);
|
||||
|
||||
if (($opts->disable_bittorrent_search && $category_index == 3) ||
|
||||
($opts->disable_hidden_service_search && $category_index ==4))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
echo "<a " . (($category_index == $opts->type) ? "class=\"active\" " : "") . "href=\"./search.php?q=" . urlencode($opts->query) . "&p=0&t=" . $category_index . "\"><img src=\"static/images/" . $category . "_result.png\" alt=\"" . $category . " result\" />" . TEXTS["category_$category"] . "</a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
fetch_search_results($opts, true);
|
||||
print_page_buttons($opts->type, $opts->query, $opts->page);
|
||||
?>
|
||||
|
||||
<?php require_once "misc/footer.php"; ?>
|
||||
172
settings.php
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
<?php
|
||||
require_once "misc/search_engine.php";
|
||||
|
||||
// Reset all cookies when resetting, or before saving new cookies
|
||||
if (isset($_REQUEST["reset"])) {
|
||||
// if (isset($_REQUEST["reset"]) || isset($_REQUEST["save"])) {
|
||||
// Removing isset($_REQUEST["save"])) fixes the problem that settings don't "stick" if you go back into settings page to make additional changes.
|
||||
if (isset($_SERVER["HTTP_COOKIE"])) {
|
||||
$cookies = explode(";", $_SERVER["HTTP_COOKIE"]);
|
||||
foreach($cookies as $cookie) {
|
||||
$parts = explode("=", $cookie);
|
||||
$name = trim($parts[0]);
|
||||
|
||||
$domain = parse_url($_SERVER['SERVER_NAME']);
|
||||
|
||||
setcookie($name, "", time() - 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["save"])) {
|
||||
foreach($_POST as $key=>$value) {
|
||||
if (!empty($value)) {
|
||||
setcookie($key, $value, [
|
||||
"expires" => time() + (86400 * 90), // Sets cookie to expire in 90 days
|
||||
"path" => "/",
|
||||
"domain" => "$domain",
|
||||
"secure" => true, // Ensure cookies are only sent over HTTPS
|
||||
"httponly" => true, // Prevent client-side JavaScript access to cookies
|
||||
"samesite" => "Strict" // Strict SameSite policy for better protection against CSRF attacks
|
||||
]);
|
||||
} else {
|
||||
setcookie($key, "", time() - 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["save"]) || isset($_REQUEST["reset"])) {
|
||||
header("Location: ./");
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
require_once "misc/header.php";
|
||||
$opts = load_opts();
|
||||
?>
|
||||
|
||||
<title>FbIN - <?php printtext("settings_title");?></title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="misc-container">
|
||||
<h1><?php printtext("settings_title");?></h1>
|
||||
<form method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<div>
|
||||
<label for="theme"><?php printtext("settings_theme");?>:</label>
|
||||
<select name="theme">
|
||||
<?php
|
||||
$default = $opts->default_theme ?? "dark";
|
||||
$themes = "
|
||||
<option value=\"dark\">Dark</option>
|
||||
<option value=\"darker\">Darker</option>
|
||||
<option value=\"amoled\">AMOLED</option>
|
||||
<option value=\"light\">Light</option>
|
||||
<option value=\"auto\">Auto</option>
|
||||
<option value=\"dracula\">Dracula</option>
|
||||
<option value=\"nord\">Nord</option>
|
||||
<option value=\"night_owl\">Night Owl</option>
|
||||
<option value=\"discord\">Discord</option>
|
||||
<option value=\"google\">Google Dark</option>
|
||||
<option value=\"startpage\">Startpage Dark</option>
|
||||
<option value=\"gruvbox\">Gruvbox</option>
|
||||
<option value=\"github_night\">GitHub Night</option>
|
||||
<option value=\"catppuccin_latte\">Catppuccin Latte</option>
|
||||
<option value=\"catppuccin_frappe\">Catppuccin Frappe</option>
|
||||
<option value=\"catppuccin_macchiato\">Catppuccin Macchiato</option>
|
||||
<option value=\"catppuccin_mocha\">Catppuccin Mocha</option>
|
||||
<option value=\"ubuntu\">Ubuntu</option>
|
||||
<option value=\"tokyo_night\">Tokyo Night</option>";
|
||||
|
||||
if (!isset($opts->theme)) {
|
||||
$theme = $default;
|
||||
}
|
||||
|
||||
$theme = $opts->theme;
|
||||
$themes = str_replace($theme . "\"", $theme . "\" selected", $themes);
|
||||
echo $themes;
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php printtext("settings_special_warning");?></label><br><br>
|
||||
<label><?php printtext("settings_special_disabled");?></label>
|
||||
<input type="checkbox" name="disable_special" <?php echo $opts->disable_special ? "checked" : ""; ?> ><br>
|
||||
<label><?php printtext("settings_frontends_disable");?></label>
|
||||
<input type="checkbox" name="disable_frontends" <?php echo $opts->disable_frontends ? "checked" : ""; ?> ><br>
|
||||
<label><?php printtext("settings_safe_search");?></label>
|
||||
<input type="checkbox" name="safe_search" <?php echo $opts->safe_search ? "checked" : ""; ?> ><br>
|
||||
</div>
|
||||
|
||||
<h2><?php printtext("settings_frontends");?></h2>
|
||||
<p><?php printtext("settings_frontends_description");?></p>
|
||||
<div class="settings-textbox-container">
|
||||
<?php
|
||||
foreach($opts->frontends as $frontend => $data)
|
||||
{
|
||||
echo "<div>";
|
||||
echo "<a for=\"$frontend\" href=\"" . $data["project_url"] . "\" target=\"_blank\">" . ucfirst($frontend) . "</a>";
|
||||
echo "<input type=\"text\" name=\"$frontend\" placeholder=\"Replace " . $data["original_name"] . "\" value=";
|
||||
echo htmlspecialchars($opts->frontends["$frontend"]["instance_url"] ?? "");
|
||||
echo ">";
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<h2><?php printtext("settings_search_settings");?></h2>
|
||||
<div class="settings-textbox-container">
|
||||
<div>
|
||||
<span><?php printtext("settings_preferred_engine");?></span>
|
||||
<select name="engine">
|
||||
<?php
|
||||
require_once "engines/text/text.php";
|
||||
|
||||
$engines = get_engines();
|
||||
|
||||
$options = "";
|
||||
|
||||
$options .= "<option value=\"\" " . (!isset($opts->engine) ? "selected" : "") . ">auto</option>";
|
||||
|
||||
foreach ($engines as $engine) {
|
||||
$selected = $opts->engine == $engine ? "selected" : "";
|
||||
$options .= "<option value=\"$engine\" $selected>$engine</option>";
|
||||
}
|
||||
echo $options;
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php printtext("settings_number_of_results");?></label>
|
||||
<input type="number" name="number_of_results" value="<?php echo htmlspecialchars($opts->number_of_results ?? "10") ?>" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-textbox-container">
|
||||
<div>
|
||||
<span><?php printtext("settings_language");?></span>
|
||||
<select name="language">
|
||||
<?php
|
||||
|
||||
$languages = json_decode(file_get_contents("static/misc/languages.json"), true);
|
||||
$options = "";
|
||||
|
||||
$options .= "<option value=\"\" " . (!isset($opts->language) ? "selected" : "") . ">Any</option>";
|
||||
|
||||
foreach ($languages as $lang_code => $language) {
|
||||
$name = $language["name"];
|
||||
$selected = $opts->language == $lang_code ? "selected" : "";
|
||||
$options .= "<option value=\"$lang_code\" $selected>$name</option>";
|
||||
}
|
||||
echo $options;
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit" name="save" value="1"><?php printtext("settings_save");?></button>
|
||||
<button type="submit" name="reset" value="1"><?php printtext("settings_reset");?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php require_once "misc/footer.php"; ?>
|
||||
26
static/css/amoled.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #000000;
|
||||
--main-fg: #F1F3F4;
|
||||
|
||||
--result-link-fg: #8AB4F8;
|
||||
--result-fg: #BABCBE;
|
||||
|
||||
--button-bg: #141414;
|
||||
|
||||
--special-result-border: #202124;
|
||||
--special-text-background: #080808;
|
||||
--special-text-color: #F1F3F4;
|
||||
|
||||
--search-container-text-color: #F1F3F4;
|
||||
--search-container-background-color: #303134;
|
||||
--search-container-background-border: #3C4043;
|
||||
|
||||
--search-form-background-color: #080808;
|
||||
|
||||
--border: #202124;
|
||||
|
||||
--footer-fg: #BABCBE;
|
||||
--footer-bg: #080808;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
2
static/css/auto.css
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@import "dark.css" (prefers-color-scheme: dark);
|
||||
@import "light.css" (prefers-color-scheme: light);
|
||||
26
static/css/catppuccin_frappe.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #303446;
|
||||
--main-fg: #c6d0f5;
|
||||
|
||||
--result-link-fg: #8caaee;
|
||||
--result-fg: #babbf1;
|
||||
|
||||
--button-bg: #414559;
|
||||
|
||||
--special-result-border: opacity 50;
|
||||
--special-text-background: #51576d;
|
||||
--special-text-color: #c6d0f5;
|
||||
|
||||
--search-container-text-color: #c6d0f5;
|
||||
--search-container-background-color: #414559;
|
||||
--search-container-background-border: #babbf1;
|
||||
|
||||
--search-form-background-color: #292c3c;
|
||||
|
||||
--border: #babbf1;
|
||||
|
||||
--footer-fg: #a5adce;
|
||||
--footer-bg: #414559;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
24
static/css/catppuccin_latte.css
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
:root {
|
||||
--main-bg: #eff1f5;
|
||||
--main-fg: #4c4f69;
|
||||
|
||||
--result-link-fg: #1e66f5;
|
||||
--result-fg: #7287fd;
|
||||
|
||||
--button-bg: #ccd0da;
|
||||
|
||||
--special-result-border: opacity 50;
|
||||
--special-text-background: #bcc0cc;
|
||||
--special-text-color: #4c4f69;
|
||||
|
||||
--search-container-text-color: #4c4f69;
|
||||
--search-container-background-color: #ccd0da;
|
||||
--search-container-background-border: #7287fd;
|
||||
|
||||
--search-form-background-color: #e6e9ef;
|
||||
|
||||
--border: #7287fd;
|
||||
|
||||
--footer-fg: #6c6f85;
|
||||
--footer-bg: #ccd0da;
|
||||
}
|
||||
26
static/css/catppuccin_macchiato.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #24273a;
|
||||
--main-fg: #cad3f5;
|
||||
|
||||
--result-link-fg: #8aadf4;
|
||||
--result-fg: #b7bdf8;
|
||||
|
||||
--button-bg: #363a4f;
|
||||
|
||||
--special-result-border: opacity 50;
|
||||
--special-text-background: #494d64;
|
||||
--special-text-color: #cad3f5;
|
||||
|
||||
--search-container-text-color: #cad3f5;
|
||||
--search-container-background-color: #363a4f;
|
||||
--search-container-background-border: #b7bdf8;
|
||||
|
||||
--search-form-background-color: #1e2030;
|
||||
|
||||
--border: #b7bdf8;
|
||||
|
||||
--footer-fg: #a5adcb;
|
||||
--footer-bg: #363a4f;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/catppuccin_mocha.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #1e1e2e;
|
||||
--main-fg: #cdd6f4;
|
||||
|
||||
--result-link-fg: #89b4fa;
|
||||
--result-fg: #b4b3fe;
|
||||
|
||||
--button-bg: #313244;
|
||||
|
||||
--special-result-border: opacity 50;
|
||||
--special-text-background: #45475a;
|
||||
--special-text-color: #cdd6f4;
|
||||
|
||||
--search-container-text-color: #cdd6f4;
|
||||
--search-container-background-color: #313244;
|
||||
--search-container-background-border: #b4b3fe;
|
||||
|
||||
--search-form-background-color: #181825;
|
||||
|
||||
--border: #b4b3fe;
|
||||
|
||||
--footer-fg: #a6adc8;
|
||||
--footer-bg: #313244;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/dark.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #1c1c1c;
|
||||
--main-fg: #F1F3F4;
|
||||
|
||||
--result-link-fg: #8AB4F8;
|
||||
--result-fg: #999da2;
|
||||
|
||||
--button-bg: #333333;
|
||||
|
||||
--special-result-border: opacity 0;
|
||||
--special-text-background: #282828;
|
||||
--special-text-color: #F1F3F4;
|
||||
|
||||
--search-container-text-color: #F1F3F4;
|
||||
--search-container-background-color: #333333;
|
||||
--search-container-background-border: #3C4043;
|
||||
|
||||
--search-form-background-color: #161616;
|
||||
|
||||
--border: #303134;
|
||||
|
||||
--footer-fg: #999da2;
|
||||
--footer-bg: #161616;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/darker.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #0a0b0d;
|
||||
--main-fg: #F1F3F4;
|
||||
|
||||
--result-link-fg: #8AB4F8;
|
||||
--result-fg: #BABCBE;
|
||||
|
||||
--button-bg: #303134;
|
||||
|
||||
--special-result-border: #202124;
|
||||
--special-text-background: #0a0b0d;
|
||||
--special-text-color: #F1F3F4;
|
||||
|
||||
--search-container-text-color: #F1F3F4;
|
||||
--search-container-background-color: #303134;
|
||||
--search-container-background-border: #3C4043;
|
||||
|
||||
--search-form-background-color: #0a0b0d;
|
||||
|
||||
--border: #202124;
|
||||
|
||||
--footer-fg: #BABCBE;
|
||||
--footer-bg: #080808;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/discord.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #2f3136;
|
||||
--main-fg: #dcddde;
|
||||
|
||||
--result-link-fg: #747ff4;
|
||||
--result-fg: #dcddde;
|
||||
|
||||
--button-bg: #36393f;
|
||||
|
||||
--special-result-border: opacity 0;
|
||||
--special-text-background: #36393f;
|
||||
--special-text-color: #dcddde;
|
||||
|
||||
--search-container-text-color: #dcddde;
|
||||
--search-container-background-color: #282b30;
|
||||
--search-container-background-border: opacity 0;
|
||||
|
||||
--search-form-background-color: #36393f;
|
||||
|
||||
--border: opacity 0;
|
||||
|
||||
--footer-fg: #dcddde;
|
||||
--footer-bg: #36393f;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/dracula.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #282A36;
|
||||
--main-fg: #F8F8F2;
|
||||
|
||||
--result-link-fg: #8BE9FD;
|
||||
--result-fg: #6272A4;
|
||||
|
||||
--button-bg: #44475A;
|
||||
|
||||
--special-result-border: opacity 50;
|
||||
--special-text-background: #44475A;
|
||||
--special-text-color: #F8F8F2;
|
||||
|
||||
--search-container-text-color: #F8F8F2;
|
||||
--search-container-background-color: #44475A;
|
||||
--search-container-background-border: #6272A4;
|
||||
|
||||
--search-form-background-color: #21222C;
|
||||
|
||||
--border: #6272A4;
|
||||
|
||||
--footer-fg: #C2C2C2;
|
||||
--footer-bg: #44475A;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/github_night.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #0d1117;
|
||||
--main-fg: #f0f6fc;
|
||||
|
||||
--result-link-fg: #58a6ff;
|
||||
--result-fg: #8b949e;
|
||||
|
||||
--button-bg: #1f242b;
|
||||
|
||||
--special-result-border: opacity 0;
|
||||
--special-text-background: #161b22;
|
||||
--special-text-color: #f0f6fc;
|
||||
|
||||
--search-container-text-color: #f0f6fc;
|
||||
--search-container-background-color: #1f242b;
|
||||
--search-container-background-border: #303842;
|
||||
|
||||
--search-form-background-color: #161b22;
|
||||
|
||||
--border: #303842;
|
||||
|
||||
--footer-fg: #8b949e;
|
||||
--footer-bg: #161b22;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/google.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #202124;
|
||||
--main-fg: #F1F3F4;
|
||||
|
||||
--result-link-fg: #8AB4F8;
|
||||
--result-fg: #BABCBE;
|
||||
|
||||
--button-bg: #303134;
|
||||
|
||||
--special-result-border: #3c4043;
|
||||
--special-text-background: #202124;
|
||||
--special-text-color: #F1F3F4;
|
||||
|
||||
--search-container-text-color: #F1F3F4;
|
||||
--search-container-background-color: #303134;
|
||||
--search-container-background-border: #3C4043;
|
||||
|
||||
--search-form-background-color: #202124;
|
||||
|
||||
--border: #3c4043;
|
||||
|
||||
--footer-fg: #BABCBE;
|
||||
--footer-bg: #171717;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/gruvbox.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #262622;
|
||||
--main-fg: #f2efd3;
|
||||
|
||||
--result-link-fg: #8AB4F8;
|
||||
--result-fg: #a2a08e;
|
||||
|
||||
--button-bg: #1b1b18;
|
||||
|
||||
--special-result-border: rgba(0,0,0,.2);
|
||||
--special-text-background: #1b1b18;
|
||||
--special-text-color: #f2efd3;
|
||||
|
||||
--search-container-text-color: #f2efd3;
|
||||
--search-container-background-color: #262622;
|
||||
--search-container-background-border: #3C4043;
|
||||
|
||||
--search-form-background-color: #151613;
|
||||
|
||||
--border: rgba(0,0,0,.2);
|
||||
|
||||
--footer-fg: #a2a08e;
|
||||
--footer-bg: #151613;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
24
static/css/light.css
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
:root {
|
||||
--main-bg: #ffffff;
|
||||
--main-fg: #000000;
|
||||
|
||||
--result-link-fg: #1a0dab;
|
||||
--result-fg: #202124;
|
||||
|
||||
--button-bg: #f6f6f6;
|
||||
|
||||
--special-result-border: #dadce0;
|
||||
--special-text-background: #ffffff;
|
||||
--special-text-color: #000000;
|
||||
|
||||
--search-container-text-color: #000000;
|
||||
--search-container-background-color: #f6f6f6;
|
||||
--search-container-background-border: #dadce0;
|
||||
|
||||
--search-form-background-color: #ffffff;
|
||||
|
||||
--border: #dadce0;
|
||||
|
||||
--footer-fg: #353535;
|
||||
--footer-bg: #f6f6f6;
|
||||
}
|
||||
26
static/css/night_owl.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #011627;
|
||||
--main-fg: #d6deeb;
|
||||
|
||||
--result-link-fg: #5f7e97;
|
||||
--result-fg: #d6deeb;
|
||||
|
||||
--button-bg: #122d42;
|
||||
|
||||
--special-result-border: opacity 0;
|
||||
--special-text-background: #122d42;
|
||||
--special-text-color: #d6deeb;
|
||||
|
||||
--search-container-text-color: #d6deeb;
|
||||
--search-container-background-color: #535470;
|
||||
--search-container-background-border: opacity 0;
|
||||
|
||||
--search-form-background-color: #122d42;
|
||||
|
||||
--border: opacity 0;
|
||||
|
||||
--footer-fg: #d6deeb;
|
||||
--footer-bg: #535470;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/nord.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #3B4252;
|
||||
--main-fg: #E5E9F0;
|
||||
|
||||
--result-link-fg: #88C0D0;
|
||||
--result-fg: #D8DEE9;
|
||||
|
||||
--button-bg: #4C566A;
|
||||
|
||||
--special-result-border: opacity 0;
|
||||
--special-text-background: #4C566A;
|
||||
--special-text-color: #E5E9F0;
|
||||
|
||||
--search-container-text-color: #E5E9F0;
|
||||
--search-container-background-color: #2E3440;
|
||||
--search-container-background-border: opacity 0;
|
||||
|
||||
--search-form-background-color: #4C566A;
|
||||
|
||||
--border: opacity 0;
|
||||
|
||||
--footer-fg: #D8DEE9;
|
||||
--footer-bg: #2E3440;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/startpage.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #171b25;
|
||||
--main-fg: #e8eaed;
|
||||
|
||||
--result-link-fg: #a7b1fc;
|
||||
--result-fg: #ebecf7;
|
||||
|
||||
--button-bg: #0c0d0f;
|
||||
|
||||
--special-result-border: #3a445c;
|
||||
--special-text-background: #1e222d;
|
||||
--special-text-color: #e8eaed;
|
||||
|
||||
--search-container-text-color: #ebecf7;
|
||||
--search-container-background-color: #2e3443;
|
||||
--search-container-background-border: #2e3443;
|
||||
|
||||
--search-form-background-color: #0c0d0f;
|
||||
|
||||
--border: #0c0d0f;
|
||||
|
||||
--footer-fg: #999da2;
|
||||
--footer-bg: #0c0d0f;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
587
static/css/styles.css
Normal file
|
|
@ -0,0 +1,587 @@
|
|||
html {
|
||||
color: var(--main-fg);
|
||||
background-color: var(--main-bg);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
button {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 18px;
|
||||
color: var(--result-fg);
|
||||
}
|
||||
|
||||
a,
|
||||
.text-result-wrapper a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.text-result-wrapper a:visited h2,
|
||||
.special-result-container a,
|
||||
.did-you-mean a,
|
||||
.sub-search-button-wrapper a,
|
||||
.sub-search-button-wrapper a:visited {
|
||||
color: #bd93f9;
|
||||
}
|
||||
|
||||
.sub-search-button-wrapper .active {
|
||||
border-bottom: 2px #bd93f9 solid;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
a:hover,
|
||||
.text-result-wrapper h2:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.search-container {
|
||||
text-align: center;
|
||||
margin-top: 10%;
|
||||
}
|
||||
|
||||
.search-container h1 {
|
||||
font-size: 70px;
|
||||
}
|
||||
|
||||
.search-container input,
|
||||
.sub-search-container input {
|
||||
width: 500px;
|
||||
color: var(--search-container-text-color);
|
||||
background-color: var(--search-container-background-color);
|
||||
padding: 10px;
|
||||
font-size: inherit;
|
||||
font-family: sans-serif;
|
||||
border: 1px solid var(--search-container-background-border);
|
||||
border-radius: 25px;
|
||||
}
|
||||
|
||||
.search-button-wrapper button,
|
||||
.misc-container button,
|
||||
.misc-container select {
|
||||
color: inherit;
|
||||
background-color: var(--button-bg);
|
||||
font-size: 14px;
|
||||
border: 1px solid var(--main-bg);
|
||||
border-radius: 4px;
|
||||
padding: 13px 10px 13px 10px;
|
||||
}
|
||||
|
||||
.search-button-wrapper button {
|
||||
|
||||
margin: 30px 60px 0px 60px;
|
||||
}
|
||||
|
||||
.sub-search-container {
|
||||
background-color: var(--search-form-background-color);
|
||||
width: 100%;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.sub-search-container hr {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sub-search-container input {
|
||||
width: 580px;
|
||||
position: relative;
|
||||
left: 140px;
|
||||
margin: 18px;
|
||||
}
|
||||
|
||||
.logomobile {
|
||||
position: absolute;
|
||||
margin-top: 0px;
|
||||
top: 25px;
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
.no-decoration {
|
||||
text-decoration: none;
|
||||
color: var(--main-fg);
|
||||
}
|
||||
|
||||
.no-decoration:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.sub-search-button-wrapper {
|
||||
margin-left: 165px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.search-button-wrapper button:hover,
|
||||
.misc-container button:hover {
|
||||
border: 1px solid #5f6368;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sub-search-button-wrapper i {
|
||||
vertical-align: middle;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.sub-search-button-wrapper a {
|
||||
border: none;
|
||||
background-color: inherit;
|
||||
font-size: 15px;
|
||||
margin-right: 20px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.sub-search-button-wrapper img {
|
||||
vertical-align: middle;
|
||||
margin-right: 5px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.misc-container {
|
||||
text-align: center;
|
||||
word-wrap: break-word;
|
||||
width: 460px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-bottom: 100px;
|
||||
}
|
||||
|
||||
.misc-container div {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.misc-container button {
|
||||
margin-right: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.misc-container a {
|
||||
color: inherit;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.settings-textbox-container div {
|
||||
text-align: left;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.settings-textbox-container input {
|
||||
color: inherit;
|
||||
background-color: inherit;
|
||||
padding: 5px;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
border: 1px solid #5f6368;
|
||||
border-radius: 5px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.text-result-container,
|
||||
#time,
|
||||
.next-page-button-wrapper,
|
||||
.did-you-mean {
|
||||
margin-left: 170px;
|
||||
}
|
||||
|
||||
.text-result-container {
|
||||
margin-bottom: 100px;
|
||||
}
|
||||
|
||||
.special-result-container {
|
||||
padding: 10px;
|
||||
border: 1px solid var(--special-result-border);
|
||||
width: 500px;
|
||||
border-radius: 8px;
|
||||
background: var(--special-text-background);
|
||||
color: var(--special-text-color);
|
||||
margin-left: 840px;
|
||||
margin-top: 0px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.text-result-wrapper {
|
||||
max-width: 550px;
|
||||
word-wrap: break-word;
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
|
||||
.text-result-wrapper a {
|
||||
font-size: 14px;
|
||||
color: var(--result-fg);
|
||||
}
|
||||
|
||||
.video-img {
|
||||
height: 115px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.text-result-wrapper h2 {
|
||||
font-size: 20px;
|
||||
color: var(--result-link-fg);
|
||||
padding-top: 5px;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.special-result-container a {
|
||||
display: flex;
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.special-result-container img {
|
||||
display: flex;
|
||||
max-width: 60%;
|
||||
max-height: 200px;
|
||||
padding-bottom: 10px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.next-page-button-wrapper {
|
||||
margin-top: -40px;
|
||||
margin-bottom: 100px;
|
||||
}
|
||||
|
||||
.next-page-button-wrapper button {
|
||||
border: none;
|
||||
background-color: inherit;
|
||||
color: var(--result-link-fg);
|
||||
font-size: 18px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.next-page-button-wrapper .page {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.image-result-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
grid-gap: 1.5rem;
|
||||
justify-items: center;
|
||||
margin-left: 9%;
|
||||
margin-right: 9%;
|
||||
padding: 0;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
a[title] {
|
||||
flex-grow: 1;
|
||||
height: 12rem;
|
||||
}
|
||||
|
||||
.image-result-container img {
|
||||
margin: 0px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
|
||||
.git-container {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.git-container,
|
||||
.footer-container {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.footer-container {
|
||||
width: 100vw;
|
||||
left: 0;
|
||||
background-color: var(--footer-bg);
|
||||
padding: 10px;
|
||||
border-top: 1px solid var(--border);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.git-container a {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.git-container a,
|
||||
.footer-container a {
|
||||
color: var(--footer-fg);
|
||||
}
|
||||
|
||||
.footer-container a {
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.Y {
|
||||
color: #bd93f9;
|
||||
}
|
||||
|
||||
.seeders {
|
||||
color: #50fa7b;
|
||||
}
|
||||
|
||||
.leechers {
|
||||
color: #ff79c6;
|
||||
}
|
||||
|
||||
|
||||
/* donate css start */
|
||||
|
||||
.donate-container {
|
||||
width: 700px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-bottom: 100px;
|
||||
}
|
||||
|
||||
.flexbox-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.inner-wrap {
|
||||
width: 500px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.qr-box {
|
||||
background-color: var(--search-container-background-color);
|
||||
border: 1px solid var(--search-container-background-border);
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
word-wrap: break-word;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.flex-row {
|
||||
width: 700px;
|
||||
height: auto;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
hr.small-line {
|
||||
/* background-color: #f1f3f4; */
|
||||
border: 2px solid var(--main-fg);
|
||||
height: 0px;
|
||||
width: 100px;
|
||||
margin: 30px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
/* donate css end */
|
||||
|
||||
|
||||
@media only screen and (max-width: 1320px) {
|
||||
.special-result-container {
|
||||
position: relative;
|
||||
float: none;
|
||||
margin-left: 165px;
|
||||
}
|
||||
}
|
||||
|
||||
/* mobile view */
|
||||
@media only screen and (max-width: 750px) {
|
||||
p {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.search-container input {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.search-button-wrapper button {
|
||||
display: table-row;
|
||||
margin: 30px 0px 0px 0px;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.image-result-container {
|
||||
display: unset;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.image-result-container img {
|
||||
margin: 0 5% 5% 5%;
|
||||
padding: 0;
|
||||
width: 90%;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.git-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.footer-container a {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.sub-search-container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sub-search-container .logo {
|
||||
display: none;
|
||||
|
||||
}
|
||||
|
||||
.logomobile {
|
||||
position: relative;
|
||||
float: none;
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 10px;
|
||||
font-size: 28px;
|
||||
display: block;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.sub-search-container input {
|
||||
width: 80%;
|
||||
position: relative;
|
||||
left: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.sub-search-button-wrapper {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.sub-search-button-wrapper img {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sub-search-button-wrapper a {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.special-result-container {
|
||||
position: relative;
|
||||
float: none;
|
||||
max-width: 90%;
|
||||
margin-left: 10px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.special-result-container img {
|
||||
max-width: 80%;
|
||||
}
|
||||
|
||||
.misc-container {
|
||||
margin-bottom: 200px;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.search-container h1 {
|
||||
font-size: 55px;
|
||||
}
|
||||
|
||||
.search-container {
|
||||
margin-top: 10%;
|
||||
}
|
||||
|
||||
.text-result-container,
|
||||
#time,
|
||||
.next-page-button-wrapper {
|
||||
margin-left: 20px;
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
.next-page-button-wrapper {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.text-result-container,
|
||||
#time,
|
||||
.next-page-button-wrapper,
|
||||
.did-you-mean {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/* dontate css start*/
|
||||
|
||||
.donate-container {
|
||||
margin-bottom: 100px;
|
||||
width: 95%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.qr-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
word-wrap: break-word;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.qr-box {
|
||||
border-radius: 10px;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.inner-wrap {
|
||||
width: 80%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.qr-box img {
|
||||
width: 40%;
|
||||
height: auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.flex-row {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.flex-row a img {
|
||||
width: 220px;
|
||||
height: auto;
|
||||
}
|
||||
/* donate css end */
|
||||
|
||||
|
||||
}
|
||||
26
static/css/tokyo_night.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #24283b;
|
||||
--main-fg: #cfc9c2;
|
||||
|
||||
--result-link-fg: #bb9af7;
|
||||
--result-fg: #a2a08e;
|
||||
|
||||
--button-bg: #343b58;
|
||||
|
||||
--special-result-border: border 0;
|
||||
--special-text-background: #1a1b26;
|
||||
--special-text-color: #c0caf5;
|
||||
|
||||
--search-container-text-color: #f2efd3;
|
||||
--search-container-background-color: #565f89;
|
||||
--search-container-background-border: #bb9af7;
|
||||
|
||||
--search-form-background-color: #1a1b26;
|
||||
|
||||
--border: #565f89;
|
||||
|
||||
--footer-fg: #f2efd3;
|
||||
--footer-bg: #1a1b26;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
26
static/css/ubuntu.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:root {
|
||||
--main-bg: #2C001E;
|
||||
--main-fg: #FFFFFF;
|
||||
|
||||
--result-link-fg: #84de32;
|
||||
--result-fg: #a2a08e;
|
||||
|
||||
--button-bg: #5E2750;
|
||||
|
||||
--special-result-border: border 0;
|
||||
--special-text-background: #333333;
|
||||
--special-text-color: #FFFFFF;
|
||||
|
||||
--search-container-text-color: #f2efd3;
|
||||
--search-container-background-color: #77216F;
|
||||
--search-container-background-border: #E95420;
|
||||
|
||||
--search-form-background-color: #333333;
|
||||
|
||||
--border: #77216F;
|
||||
|
||||
--footer-fg: #f2efd3;
|
||||
--footer-bg: #5E2750;
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
BIN
static/images/btc.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
static/images/buy-me-a-coffee.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
static/images/general_result.png
Normal file
|
After Width: | Height: | Size: 598 B |
BIN
static/images/images_result.png
Normal file
|
After Width: | Height: | Size: 704 B |
BIN
static/images/kofi.png
Normal file
|
After Width: | Height: | Size: 8 KiB |
BIN
static/images/librex.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
static/images/maps_result.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
static/images/tor_result.png
Normal file
|
After Width: | Height: | Size: 370 B |
BIN
static/images/torrents_result.png
Normal file
|
After Width: | Height: | Size: 657 B |
BIN
static/images/videos_result.png
Normal file
|
After Width: | Height: | Size: 360 B |
BIN
static/images/xmr-ahwx.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
static/images/xmr.png
Normal file
|
After Width: | Height: | Size: 514 B |