Compare commits
No commits in common. "master" and "progress" have entirely different histories.
66 changed files with 2792 additions and 3337 deletions
|
@ -1,13 +0,0 @@
|
|||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
15
.env.example
15
.env.example
|
@ -1,15 +0,0 @@
|
|||
HOST=0.0.0.0
|
||||
PORT=3333
|
||||
NODE_ENV=development
|
||||
APP_URL=http://${HOST}:${PORT}
|
||||
CACHE_VIEWS=false
|
||||
APP_KEY=
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_USER=root
|
||||
DB_PASSWORD=
|
||||
DB_DATABASE=adonis
|
||||
SESSION_DRIVER=cookie
|
||||
HASH_DRIVER=bcrypt
|
||||
auth=test
|
38
.gitignore
vendored
38
.gitignore
vendored
|
@ -1,36 +1,2 @@
|
|||
# Node modules
|
||||
node_modules
|
||||
package-lock.json
|
||||
|
||||
# Adonis directory for storing tmp files
|
||||
tmp
|
||||
|
||||
# Environment variables, never commit this file
|
||||
.env
|
||||
|
||||
# List of proxy
|
||||
proxy/proxy.json
|
||||
|
||||
# The development sqlite file
|
||||
database/development.sqlite
|
||||
|
||||
# VSCode & Webstorm history directories
|
||||
.history
|
||||
.idea
|
||||
|
||||
# MacOS useless file
|
||||
.DS_Store
|
||||
|
||||
# video files
|
||||
public/uploads/*.mp4
|
||||
public/uploads/*.webm
|
||||
public/uploads/*.mp3
|
||||
public/uploads/*.flac
|
||||
public/uploads/hidden/*.mp4
|
||||
public/uploads/hidden/*.webm
|
||||
public/uploads/hidden/*.mp3
|
||||
public/uploads/hidden/*.flac
|
||||
|
||||
|
||||
# Thumbnail
|
||||
public/Thumbnail/*.*
|
||||
/node_modules/
|
||||
/proxy/proxy.json
|
||||
|
|
8
.idea/.gitignore
vendored
Normal file
8
.idea/.gitignore
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
6
.idea/discord.xml
Normal file
6
.idea/discord.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="PROJECT_FILES" />
|
||||
</component>
|
||||
</project>
|
6
.idea/jsLibraryMappings.xml
Normal file
6
.idea/jsLibraryMappings.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptLibraryMappings">
|
||||
<includedPredefinedLibrary name="Node.js Core" />
|
||||
</component>
|
||||
</project>
|
6
.idea/misc.xml
Normal file
6
.idea/misc.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/jeff-downloader2.iml" filepath="$PROJECT_DIR$/jeff-downloader2.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
11
.idea/runConfigurations/bin_www.xml
Normal file
11
.idea/runConfigurations/bin_www.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="bin/www" type="NodeJSConfigurationType" path-to-js-file="bin/www" working-dir="$PROJECT_DIR$">
|
||||
<envs>
|
||||
<env name="NODE_ENV" value="production DEBUG=jeff-downloader2:*" />
|
||||
</envs>
|
||||
<EXTENSION ID="com.jetbrains.nodejs.run.NodeJSStartBrowserRunConfigurationExtension">
|
||||
<browser url="http://localhost:3000/" />
|
||||
</EXTENSION>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
16
Dockerfile
16
Dockerfile
|
@ -1,20 +1,26 @@
|
|||
# My first docker hope it isn't too bad :)
|
||||
FROM node:12
|
||||
FROM node:14
|
||||
|
||||
WORKDIR /var/www/jeffdownloader/
|
||||
|
||||
RUN git clone https://git.namejeff.xyz/Supositware/jeff-downloader.git .
|
||||
|
||||
RUN git checkout progress
|
||||
|
||||
RUN git log -1 --format=%h
|
||||
|
||||
RUN npm install
|
||||
|
||||
RUN npm i -g pm2
|
||||
|
||||
RUN cp .env.example .env
|
||||
|
||||
RUN echo "[]" > proxy/proxy.json
|
||||
|
||||
RUN apt-get update && apt-get install -y ffmpeg
|
||||
ENV NODE_ENV=production
|
||||
|
||||
ENV PORT=3333
|
||||
|
||||
RUN apt-get update && apt-get install -y ffmpeg
|
||||
|
||||
EXPOSE 3333
|
||||
|
||||
CMD ["pm2-runtime", "server.js"]
|
||||
CMD ["pm2-runtime", "bin/www"]
|
||||
|
|
661
LICENSE
661
LICENSE
|
@ -1,661 +0,0 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://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.
|
||||
|
||||
Jeff downloader
|
||||
Copyright (C) 2019 Loïc Bersier
|
||||
|
||||
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 <http://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
|
||||
<http://www.gnu.org/licenses/>.
|
19
README.md
19
README.md
|
@ -1,19 +0,0 @@
|
|||
# Jeff downloader
|
||||
|
||||
Jeff downloader is a website to download from [hundreds](https://ytdl-org.github.io/youtube-dl/supportedsites.html) of website using [youtube-dl](https://ytdl-org.github.io/youtube-dl/index.html)
|
||||
|
||||
You can find a hosted version on https://namejeff.xyz/
|
||||
|
||||
# Credit
|
||||
|
||||
SponsorBlock data is used under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/). More details: https://sponsor.ajay.app/
|
||||
|
||||
[Youtube-dl](https://github.com/ytdl-org/youtube-dl/)
|
||||
|
||||
Major Tom#6196 for AR translation
|
||||
|
||||
0nion_man_LV#6572 for LV translation
|
||||
|
||||
Mastah Gengu#1596 for DE translation
|
||||
|
||||
МeiYali#2457 for CS translation
|
21
ace
21
ace
|
@ -1,21 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ace Commands
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The ace file is just a regular Javascript file but with no extension. You
|
||||
| can call `node ace` followed by the command name and it just works.
|
||||
|
|
||||
| Also you can use `adonis` followed by the command name, since the adonis
|
||||
| global proxy all the ace commands.
|
||||
|
|
||||
*/
|
||||
|
||||
const { Ignitor } = require('@adonisjs/ignitor')
|
||||
|
||||
new Ignitor(require('@adonisjs/fold'))
|
||||
.appRoot(__dirname)
|
||||
.fireAce()
|
||||
.catch(console.error)
|
39
app.js
Normal file
39
app.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
var createError = require('http-errors');
|
||||
var express = require('express');
|
||||
var path = require('path');
|
||||
var cookieParser = require('cookie-parser');
|
||||
var logger = require('morgan');
|
||||
|
||||
var indexRouter = require('./routes/index');
|
||||
|
||||
var app = express();
|
||||
|
||||
// view engine setup
|
||||
app.set('views', path.join(__dirname, 'views'));
|
||||
app.set('view engine', 'ejs');
|
||||
|
||||
app.use(logger('dev'));
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: false }));
|
||||
app.use(cookieParser());
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
app.use('/', indexRouter);
|
||||
|
||||
// catch 404 and forward to error handler
|
||||
app.use(function(req, res, next) {
|
||||
next(createError(404));
|
||||
});
|
||||
|
||||
// error handler
|
||||
app.use(function(err, req, res, next) {
|
||||
// set locals
|
||||
res.locals.message = err.message;
|
||||
res.locals.error = err;
|
||||
|
||||
// render the error page
|
||||
res.status(err.status || 500);
|
||||
res.render('error');
|
||||
});
|
||||
|
||||
module.exports = app;
|
|
@ -1,369 +0,0 @@
|
|||
'use strict'
|
||||
const youtubedl = require('youtube-dl');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const ffmpeg = require('fluent-ffmpeg');
|
||||
const { version } = require('../../../package.json');
|
||||
const Antl = use('Antl');
|
||||
const proxy = require('../../../proxy/proxy.json');
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
let viewCounter = 0;
|
||||
let files = [];
|
||||
let day;
|
||||
let month;
|
||||
let announcementArray = [];
|
||||
let announcement;
|
||||
let defaultViewOption = { version: version, viewCounter: viewCounter, file: files, day: day, month: month, announcement: announcement, proxy: proxy }
|
||||
|
||||
|
||||
function formatBytes(bytes, decimals = 2) { // https://stackoverflow.com/a/18650828
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
class DownloadController {
|
||||
|
||||
async index ({ view, request, locale }) {
|
||||
viewCounter++;
|
||||
defaultViewOption.viewCounter = viewCounter;
|
||||
|
||||
for (let i = 0; Antl.forLocale(locale)._messages.fr.announcement.length > i; i++) {
|
||||
announcementArray.push(Antl.forLocale(locale).formatMessage(`announcement.${i + 1}`));
|
||||
}
|
||||
|
||||
// Get random announcement
|
||||
defaultViewOption.announcement = announcementArray[Math.floor(Math.random() * announcementArray.length)];
|
||||
|
||||
// Get date for some event
|
||||
let today = new Date();
|
||||
defaultViewOption.day = today.getDay();
|
||||
defaultViewOption.month = today.getMonth();
|
||||
// If legacy link return
|
||||
if (request.url() == '/legacy') return view.render('legacy', defaultViewOption);
|
||||
|
||||
files = [];
|
||||
let file = [];
|
||||
for (let f of fs.readdirSync('./public/uploads')) {
|
||||
if (f.endsWith('.mp4') || f.endsWith('.webm') || f.endsWith('.mp3') || f.endsWith('.flac'))
|
||||
file.push(f)
|
||||
}
|
||||
// get the 5 most recent files
|
||||
file = file.sort((a, b) => {
|
||||
if ((a || b).endsWith('.mp4') || (a || b).endsWith('.webm') || (a || b).endsWith('.mp3') || (a || b).endsWith('.flac')) {
|
||||
let time1 = fs.statSync(`./public/uploads/${b}`).ctime;
|
||||
let time2 = fs.statSync(`./public/uploads/${a}`).ctime;
|
||||
if (time1 < time2) return -1;
|
||||
if (time1 > time2) return 1;
|
||||
}
|
||||
return 0;
|
||||
}).slice(0, 5)
|
||||
|
||||
// Save space by deleting file that doesn't appear in the recent feed
|
||||
for (let f of fs.readdirSync('./public/uploads')) {
|
||||
if (!file.includes(f) && (f != 'hidden' && f != '.keep')) {
|
||||
if (fs.existsSync(`./public/uploads/${f}`))
|
||||
fs.unlinkSync(`./public/uploads/${f}`);
|
||||
|
||||
if (fs.existsSync(`./public/thumbnail/${f}`))
|
||||
fs.unlinkSync(`./public/thumbnail/${f}`);
|
||||
|
||||
if (fs.existsSync(`./public/thumbnail/${f}.png`))
|
||||
fs.unlinkSync(`./public/thumbnail/${f}.png`);
|
||||
}
|
||||
}
|
||||
|
||||
for (let f of file) {
|
||||
let fileInfo = formatBytes(fs.statSync(`./public/uploads/${f}`).size).split(' ');
|
||||
let defaultFiles = { name: f.replace(path.extname(f), ''), size: fileInfo[0], unit: fileInfo[1], date: fs.statSync(`./public/uploads/${f}`).ctime, location: `uploads/${f}`, ext: path.extname(f), thumbnail: `/thumbnail/${f}`, img: `/thumbnail/${f.replace(path.extname(f), '.png')}` };
|
||||
|
||||
if (f.endsWith('.mp3') || f.endsWith('.flac')) {
|
||||
defaultFiles.thumbnail = `./thumbnail/${f.replace(path.extname(f), '.png')}`
|
||||
}
|
||||
files.push(defaultFiles);
|
||||
}
|
||||
defaultViewOption.file = files;
|
||||
return view.render('index', defaultViewOption);
|
||||
}
|
||||
|
||||
async download({ view, request, response }) {
|
||||
let page = 'index';
|
||||
if (response.request.url == '/legacy') page = 'legacy';
|
||||
// To be honest i forgot what it does, but i think i need it
|
||||
response.implicitEnd = false
|
||||
|
||||
let option, DLFile
|
||||
// Get form input
|
||||
let data = {
|
||||
url: request.input('URL'),
|
||||
quality: request.input('quality'),
|
||||
format: request.input('format'),
|
||||
alt: request.input('alt'),
|
||||
feed: request.input('feed'),
|
||||
proxy: request.input('proxy'),
|
||||
sponsorBlock : request.input('sponsorBlock')
|
||||
}
|
||||
|
||||
if (!data.url) {
|
||||
let viewOption = {...defaultViewOption};
|
||||
viewOption.error = true;
|
||||
viewOption.errormsg = 'bruh moment, you didin\'t input a link.';
|
||||
return view.render(page, viewOption);
|
||||
}
|
||||
|
||||
if (data.url.toLowerCase().includes("porn")) {
|
||||
data.feed = "on";
|
||||
}
|
||||
|
||||
let videoID;
|
||||
if (data.sponsorBlock) {
|
||||
let regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/;
|
||||
let match = data.url.match(regExp);
|
||||
videoID = (match&&match[7].length==11)? match[7] : false;
|
||||
if (!videoID) {
|
||||
let viewOption = {...defaultViewOption};
|
||||
viewOption.error = true;
|
||||
viewOption.errormsg = 'To use sponsorBlock you need a valid youtube link!';
|
||||
return view.render(page, viewOption);
|
||||
}
|
||||
}
|
||||
|
||||
// Youtube-dl quality settings
|
||||
if (data.quality == 'small')
|
||||
option = 'worst'
|
||||
else
|
||||
option = 'best'
|
||||
|
||||
// If alt download ( Quality settings and file format option doesn't work here )
|
||||
if (data.alt) {
|
||||
let altFolder;
|
||||
if (data.feed == 'on') {
|
||||
altFolder = './public/uploads/hidden/alt.mp4';
|
||||
} else {
|
||||
altFolder = './public/uploads/alt.mp4'
|
||||
}
|
||||
|
||||
if (fs.existsSync(altFolder)) {
|
||||
fs.unlink(altFolder, (err) => {
|
||||
if (err);
|
||||
});
|
||||
}
|
||||
|
||||
let options = ['--format=mp4', '-o', altFolder];
|
||||
if (data.proxy !== "none") {
|
||||
options.push('--proxy');
|
||||
options.push(data.proxy);
|
||||
}
|
||||
|
||||
return youtubedl.exec(data.url, options, {}, function(err, output) {
|
||||
if (err) {
|
||||
let viewOption = {...defaultViewOption};
|
||||
viewOption.error = true;
|
||||
viewOption.errormsg = err;
|
||||
return response.send(view.render(page, viewOption))
|
||||
}
|
||||
|
||||
return response.attachment(altFolder);
|
||||
});
|
||||
} else {
|
||||
// Download as mp4 if possible
|
||||
let options = ['--format=mp4', '-f', option];
|
||||
if (data.proxy !== "none") {
|
||||
options.push('--proxy');
|
||||
options.push(data.proxy);
|
||||
}
|
||||
|
||||
let video = youtubedl(data.url, options);
|
||||
|
||||
video.on('error', function(err) {
|
||||
console.error(err);
|
||||
let viewOption = {...defaultViewOption};
|
||||
viewOption.error = true;
|
||||
viewOption.errormsg = err;
|
||||
|
||||
return response.send(view.render(page, viewOption))
|
||||
});
|
||||
|
||||
let ext;
|
||||
video.on('info', function(info) {
|
||||
// Set file name
|
||||
ext = info.ext;
|
||||
let title = info.title.slice(0,50);
|
||||
DLFile = `${title.replace(/\s/g, '')}.${ext}`;
|
||||
DLFile = DLFile.replace(/[()]|[/]|[\\]|[!]|[?]/g, '');
|
||||
DLFile = DLFile.replace(',', '');
|
||||
|
||||
// If no title use the ID
|
||||
if (title == '_') title = `_${info.id}`;
|
||||
// If user want to hide from the feed
|
||||
if (data.feed == 'on')
|
||||
DLFile = `hidden/${title}.${ext}`;
|
||||
|
||||
if (data.sponsorBlock) video.pipe(fs.createWriteStream(`./public/uploads/hidden/${DLFile}`));
|
||||
else video.pipe(fs.createWriteStream(`./public/uploads/${DLFile}`));
|
||||
});
|
||||
|
||||
video.on('end', function() {
|
||||
if (data.format == 'mp4' || data.format == 'webm') {
|
||||
if (data.sponsorBlock) { // WARNING: THIS PART SUCK
|
||||
let filter = '';
|
||||
let abc = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
|
||||
fetch(`https://sponsor.ajay.app/api/skipSegments?videoID=${videoID}`)
|
||||
.then(res => {
|
||||
if (res.status === 404) {
|
||||
let viewOption = {...defaultViewOption};
|
||||
viewOption.error = true;
|
||||
viewOption.errormsg = 'Couldn\'t find any SponsorBlock data for this video.';
|
||||
|
||||
return response.send(view.render(page, viewOption));
|
||||
}
|
||||
return res.json()
|
||||
})
|
||||
.then(json => {
|
||||
if (json === undefined) return;
|
||||
let i = 0;
|
||||
let previousEnd;
|
||||
let usedLetter = [];
|
||||
json.forEach(sponsor => {
|
||||
usedLetter.push(abc[i]);
|
||||
if (i === 0) {
|
||||
filter += `[0:v]trim=start=0:end=${sponsor.segment[0]},setpts=PTS-STARTPTS[${abc[i]}v];`;
|
||||
filter += `[0:a]atrim=start=0:end=${sponsor.segment[0]},asetpts=PTS-STARTPTS[${abc[i]}a];`;
|
||||
} else {
|
||||
filter += `[0:v]trim=start=${previousEnd}:end=${sponsor.segment[0]},setpts=PTS-STARTPTS[${abc[i]}v];`;
|
||||
filter += `[0:a]atrim=start=${previousEnd}:end=${sponsor.segment[0]},asetpts=PTS-STARTPTS[${abc[i]}a];`;
|
||||
}
|
||||
previousEnd = sponsor.segment[1];
|
||||
i++;
|
||||
});
|
||||
usedLetter.push(abc[i]);
|
||||
filter += `[0:v]trim=start=${previousEnd},setpts=PTS-STARTPTS[${abc[i]}v];`;
|
||||
filter += `[0:a]atrim=start=${previousEnd},asetpts=PTS-STARTPTS[${abc[i]}a];`;
|
||||
let video = '';
|
||||
let audio = '';
|
||||
usedLetter.forEach(letter => {
|
||||
video += `[${letter}v]`
|
||||
audio += `[${letter}a]`
|
||||
});
|
||||
filter += `${video}concat=n=${i + 1}[outv];`;
|
||||
filter += `${audio}concat=n=${i + 1}:v=0:a=1[outa]`;
|
||||
|
||||
ffmpeg(`./public/uploads/hidden/${DLFile}`)
|
||||
.inputFormat('mp4')
|
||||
.complexFilter(filter)
|
||||
.outputOptions('-map [outv]')
|
||||
.outputOptions('-map [outa]')
|
||||
.save(`./public/uploads/${DLFile}`)
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
console.log('Cannot process video: ' + err.message);
|
||||
let viewOption = {...defaultViewOption};
|
||||
viewOption.error = true;
|
||||
viewOption.errormsg = err.message;
|
||||
|
||||
return response.send(view.render(page, viewOption))
|
||||
})
|
||||
.on('end', () => {
|
||||
console.log('end');
|
||||
response.attachment(`./public/uploads/${DLFile}`)
|
||||
generateThumbnail(DLFile);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// If user requested mp4 directly attach the file
|
||||
response.attachment(`./public/uploads/${DLFile}`)
|
||||
generateThumbnail(DLFile);
|
||||
}
|
||||
} else {
|
||||
// If user requested an audio format, convert it
|
||||
ffmpeg(`./public/uploads/${DLFile}`)
|
||||
.noVideo()
|
||||
.audioChannels('2')
|
||||
.audioFrequency('44100')
|
||||
.audioBitrate('320k')
|
||||
.format(data.format)
|
||||
.save(`./public/uploads/${DLFile.replace(`.${ext}`, `.${data.format}`)}`)
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
console.log('Cannot process video: ' + err.message);
|
||||
let viewOption = {...defaultViewOption};
|
||||
viewOption.error = true;
|
||||
viewOption.errormsg = err.message;
|
||||
|
||||
return response.send(view.render(page, viewOption))
|
||||
})
|
||||
.on('end', () => {
|
||||
fs.unlinkSync(`./public/uploads/${DLFile}`);
|
||||
generateWaveform(DLFile.replace(`.${ext}`, `.${data.format}`));
|
||||
return response.attachment(`./public/uploads/${DLFile.replace(`.${ext}`, `.${data.format}`)}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = DownloadController
|
||||
|
||||
async function generateWaveform(f) {
|
||||
ffmpeg(`./public/uploads/${f}`)
|
||||
.complexFilter('[0:a]aformat=channel_layouts=mono,compand=gain=-6,showwavespic=s=600x120:colors=#9cf42f[fg];color=s=600x120:color=#44582c,drawgrid=width=iw/10:height=ih/5:color=#9cf42f@0.1[bg];[bg][fg]overlay=format=rgb,drawbox=x=(iw-w)/2:y=(ih-h)/2:w=iw:h=1:color=#9cf42f')
|
||||
.frames(1)
|
||||
.noVideo()
|
||||
.noAudio()
|
||||
.duration(0.1)
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
return console.log('Cannot process video: ' + err.message);
|
||||
})
|
||||
.on('end', () => {
|
||||
generateThumbnail(`../thumbnail/${f.replace(path.extname(f), '.mp4')}`);
|
||||
})
|
||||
.save(`./public/thumbnail/${f.replace(path.extname(f), '.mp4')}`);
|
||||
}
|
||||
|
||||
async function generateThumbnail(f) {
|
||||
ffmpeg(`./public/uploads/${f}`)
|
||||
.screenshots({
|
||||
timestamps: ['20%'],
|
||||
size: '720x480',
|
||||
folder: './public/thumbnail/',
|
||||
filename: f.replace(path.extname(f), '.png')
|
||||
})
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
return console.log('Cannot process video: ' + err.message);
|
||||
});
|
||||
|
||||
if (!fs.existsSync(`./public/thumbnail/tmp/${f}`) && !f.startsWith('../thumbnail'))
|
||||
fs.mkdirSync(`./public/thumbnail/tmp/${f}`)
|
||||
|
||||
ffmpeg(`./public/uploads/${f}`)
|
||||
.complexFilter('select=gt(scene\\,0.8)')
|
||||
.frames(10)
|
||||
.complexFilter('fps=fps=1/10')
|
||||
.save(`./public/thumbnail/tmp/${f}/%03d.png`)
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
return console.log('Cannot process video: ' + err.message);
|
||||
})
|
||||
.on('end', () => {
|
||||
ffmpeg(`./public/thumbnail/tmp/${f}/%03d.png`)
|
||||
.complexFilter('zoompan=d=(.5+.5)/.5:s=640x480:fps=1/.5,framerate=25:interp_start=0:interp_end=255:scene=100')
|
||||
.format('mp4')
|
||||
.save(`./public/thumbnail/${f}`)
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
return console.log('Cannot process video: ' + err.message);
|
||||
})
|
||||
.on('end', () => {
|
||||
// Save space by deleting tmp directory
|
||||
for (let files of fs.readdirSync(`./public/thumbnail/tmp/${f}`)) {
|
||||
if (files == '.keep') return;
|
||||
fs.unlinkSync(`./public/thumbnail/tmp/${f}/${files}`);
|
||||
}
|
||||
fs.rmdirSync(`./public/thumbnail/tmp/${f}`);
|
||||
});
|
||||
});
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
class ConvertEmptyStringsToNull {
|
||||
async handle ({ request }, next) {
|
||||
if (Object.keys(request.body).length) {
|
||||
request.body = Object.assign(
|
||||
...Object.keys(request.body).map(key => ({
|
||||
[key]: request.body[key] !== '' ? request.body[key] : null
|
||||
}))
|
||||
)
|
||||
}
|
||||
|
||||
await next()
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ConvertEmptyStringsToNull
|
|
@ -1,16 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
class NoTimestamp {
|
||||
register (Model) {
|
||||
Object.defineProperties(Model, {
|
||||
createdAtColumn: {
|
||||
get: () => null,
|
||||
},
|
||||
updatedAtColumn: {
|
||||
get: () => null,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = NoTimestamp
|
|
@ -1,39 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/** @type {import('@adonisjs/framework/src/Hash')} */
|
||||
const Hash = use('Hash')
|
||||
|
||||
/** @type {typeof import('@adonisjs/lucid/src/Lucid/Model')} */
|
||||
const Model = use('Model')
|
||||
|
||||
class User extends Model {
|
||||
static boot () {
|
||||
super.boot()
|
||||
|
||||
/**
|
||||
* A hook to hash the user password before saving
|
||||
* it to the database.
|
||||
*/
|
||||
this.addHook('beforeSave', async (userInstance) => {
|
||||
if (userInstance.dirty.password) {
|
||||
userInstance.password = await Hash.make(userInstance.password)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* A relationship on tokens is required for auth to
|
||||
* work. Since features like `refreshTokens` or
|
||||
* `rememberToken` will be saved inside the
|
||||
* tokens table.
|
||||
*
|
||||
* @method tokens
|
||||
*
|
||||
* @return {Object}
|
||||
*/
|
||||
tokens () {
|
||||
return this.hasMany('App/Models/Token')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = User
|
90
bin/www
Executable file
90
bin/www
Executable file
|
@ -0,0 +1,90 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var app = require('../app');
|
||||
var debug = require('debug')('jeff-downloader2:server');
|
||||
var http = require('http');
|
||||
|
||||
/**
|
||||
* Get port from environment and store in Express.
|
||||
*/
|
||||
|
||||
var port = normalizePort(process.env.PORT || '3000');
|
||||
app.set('port', port);
|
||||
|
||||
/**
|
||||
* Create HTTP server.
|
||||
*/
|
||||
|
||||
var server = http.createServer(app);
|
||||
|
||||
/**
|
||||
* Listen on provided port, on all network interfaces.
|
||||
*/
|
||||
|
||||
server.listen(port);
|
||||
server.on('error', onError);
|
||||
server.on('listening', onListening);
|
||||
|
||||
/**
|
||||
* Normalize a port into a number, string, or false.
|
||||
*/
|
||||
|
||||
function normalizePort(val) {
|
||||
var port = parseInt(val, 10);
|
||||
|
||||
if (isNaN(port)) {
|
||||
// named pipe
|
||||
return val;
|
||||
}
|
||||
|
||||
if (port >= 0) {
|
||||
// port number
|
||||
return port;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Event listener for HTTP server "error" event.
|
||||
*/
|
||||
|
||||
function onError(error) {
|
||||
if (error.syscall !== 'listen') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
var bind = typeof port === 'string'
|
||||
? 'Pipe ' + port
|
||||
: 'Port ' + port;
|
||||
|
||||
// handle specific listen errors with friendly messages
|
||||
switch (error.code) {
|
||||
case 'EACCES':
|
||||
console.error(bind + ' requires elevated privileges');
|
||||
process.exit(1);
|
||||
break;
|
||||
case 'EADDRINUSE':
|
||||
console.error(bind + ' is already in use');
|
||||
process.exit(1);
|
||||
break;
|
||||
default:
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event listener for HTTP server "listening" event.
|
||||
*/
|
||||
|
||||
function onListening() {
|
||||
var addr = server.address();
|
||||
var bind = typeof addr === 'string'
|
||||
? 'pipe ' + addr
|
||||
: 'port ' + addr.port;
|
||||
debug('Listening on ' + bind);
|
||||
}
|
243
config/app.js
243
config/app.js
|
@ -1,243 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/** @type {import('@adonisjs/framework/src/Env')} */
|
||||
const Env = use('Env')
|
||||
|
||||
module.exports = {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value is the name of your application and can be used when you
|
||||
| need to place the application's name in a email, view or
|
||||
| other location.
|
||||
|
|
||||
*/
|
||||
|
||||
name: Env.get('APP_NAME', 'AdonisJs'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| App Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| App key is a randomly generated 16 or 32 characters long string required
|
||||
| to encrypted cookies, sessions and other sensitive data.
|
||||
|
|
||||
*/
|
||||
appKey: Env.getOrFail('APP_KEY'),
|
||||
|
||||
http: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Allow Method Spoofing
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Method spoofing allows you to make requests by spoofing the http verb.
|
||||
| Which means you can make a GET request but instruct the server to
|
||||
| treat as a POST or PUT request. If you want this feature, set the
|
||||
| below value to true.
|
||||
|
|
||||
*/
|
||||
allowMethodSpoofing: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Trust Proxy
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Trust proxy defines whether X-Forwarded-* headers should be trusted or not.
|
||||
| When your application is behind a proxy server like nginx, these values
|
||||
| are set automatically and should be trusted. Apart from setting it
|
||||
| to true or false Adonis supports a handful of ways to allow proxy
|
||||
| values. Read documentation for that.
|
||||
|
|
||||
*/
|
||||
trustProxy: false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Subdomains
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Offset to be used for returning subdomains for a given request. For
|
||||
| majority of applications it will be 2, until you have nested
|
||||
| sudomains.
|
||||
| cheatsheet.adonisjs.com - offset - 2
|
||||
| virk.cheatsheet.adonisjs.com - offset - 3
|
||||
|
|
||||
*/
|
||||
subdomainOffset: 2,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JSONP Callback
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Default jsonp callback to be used when callback query string is missing
|
||||
| in request url.
|
||||
|
|
||||
*/
|
||||
jsonpCallback: 'callback',
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Etag
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Set etag on all HTTP responses. In order to disable for selected routes,
|
||||
| you can call the `response.send` with an options object as follows.
|
||||
|
|
||||
| response.send('Hello', { ignoreEtag: true })
|
||||
|
|
||||
*/
|
||||
etag: false
|
||||
},
|
||||
|
||||
views: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Views
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Define whether or not to cache the compiled view. Set it to true in
|
||||
| production to optimize view loading time.
|
||||
|
|
||||
*/
|
||||
cache: Env.get('CACHE_VIEWS', true)
|
||||
},
|
||||
|
||||
static: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Dot Files
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Define how to treat dot files when trying to serve static resources.
|
||||
| By default it is set to ignore, which will pretend that dotfiles
|
||||
| do not exist.
|
||||
|
|
||||
| Can be one of the following
|
||||
| ignore, deny, allow
|
||||
|
|
||||
*/
|
||||
dotfiles: 'ignore',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| ETag
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enable or disable etag generation
|
||||
|
|
||||
*/
|
||||
etag: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extensions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Set file extension fallbacks. When set, if a file is not found, the given
|
||||
| extensions will be added to the file name and search for. The first
|
||||
| that exists will be served. Example: ['html', 'htm'].
|
||||
|
|
||||
*/
|
||||
extensions: false
|
||||
},
|
||||
|
||||
locales: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Loader
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The loader to be used for fetching and updating locales. Below is the
|
||||
| list of available options.
|
||||
|
|
||||
| file, database
|
||||
|
|
||||
*/
|
||||
loader: 'file',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Default locale to be used by Antl provider. You can always switch drivers
|
||||
| in runtime or use the official Antl middleware to detect the driver
|
||||
| based on HTTP headers/query string.
|
||||
|
|
||||
*/
|
||||
locale: 'en-GB'
|
||||
},
|
||||
|
||||
logger: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Transport
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Transport to be used for logging messages. You can have multiple
|
||||
| transports using same driver.
|
||||
|
|
||||
| Available drivers are: `file` and `console`.
|
||||
|
|
||||
*/
|
||||
transport: 'console',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Console Transport
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Using `console` driver for logging. This driver writes to `stdout`
|
||||
| and `stderr`
|
||||
|
|
||||
*/
|
||||
console: {
|
||||
driver: 'console',
|
||||
name: 'adonis-app',
|
||||
level: 'info'
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| File Transport
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| File transport uses file driver and writes log messages for a given
|
||||
| file inside `tmp` directory for your app.
|
||||
|
|
||||
| For a different directory, set an absolute path for the filename.
|
||||
|
|
||||
*/
|
||||
file: {
|
||||
driver: 'file',
|
||||
name: 'adonis-app',
|
||||
filename: 'adonis.log',
|
||||
level: 'info'
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Generic Cookie Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following cookie options are generic settings used by AdonisJs to create
|
||||
| cookies. However, some parts of the application like `sessions` can have
|
||||
| seperate settings for cookies inside `config/session.js`.
|
||||
|
|
||||
*/
|
||||
cookie: {
|
||||
httpOnly: true,
|
||||
sameSite: false,
|
||||
path: '/',
|
||||
maxAge: 7200
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/** @type {import('@adonisjs/framework/src/Env')} */
|
||||
const Env = use('Env')
|
||||
|
||||
module.exports = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authenticator
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Authentication is a combination of serializer and scheme with extra
|
||||
| config to define on how to authenticate a user.
|
||||
|
|
||||
| Available Schemes - basic, session, jwt, api
|
||||
| Available Serializers - lucid, database
|
||||
|
|
||||
*/
|
||||
authenticator: 'session',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Session authenticator makes use of sessions to authenticate a user.
|
||||
| Session authentication is always persistent.
|
||||
|
|
||||
*/
|
||||
session: {
|
||||
serializer: 'lucid',
|
||||
model: 'App/Models/User',
|
||||
scheme: 'session',
|
||||
uid: 'email',
|
||||
password: 'password'
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Basic Auth
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The basic auth authenticator uses basic auth header to authenticate a
|
||||
| user.
|
||||
|
|
||||
| NOTE:
|
||||
| This scheme is not persistent and users are supposed to pass
|
||||
| login credentials on each request.
|
||||
|
|
||||
*/
|
||||
basic: {
|
||||
serializer: 'lucid',
|
||||
model: 'App/Models/User',
|
||||
scheme: 'basic',
|
||||
uid: 'email',
|
||||
password: 'password'
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Jwt
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The jwt authenticator works by passing a jwt token on each HTTP request
|
||||
| via HTTP `Authorization` header.
|
||||
|
|
||||
*/
|
||||
jwt: {
|
||||
serializer: 'lucid',
|
||||
model: 'App/Models/User',
|
||||
scheme: 'jwt',
|
||||
uid: 'email',
|
||||
password: 'password',
|
||||
options: {
|
||||
secret: Env.get('APP_KEY')
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Api
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Api scheme makes use of API personal tokens to authenticate a user.
|
||||
|
|
||||
*/
|
||||
api: {
|
||||
serializer: 'lucid',
|
||||
model: 'App/Models/User',
|
||||
scheme: 'api',
|
||||
uid: 'email',
|
||||
password: 'password'
|
||||
}
|
||||
}
|
|
@ -1,157 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JSON Parser
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below settings are applied when request body contains JSON payload. If
|
||||
| you want body parser to ignore JSON payload, then simply set `types`
|
||||
| to an empty array.
|
||||
*/
|
||||
json: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| limit
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Defines the limit of JSON that can be sent by the client. If payload
|
||||
| is over 1mb it will not be processed.
|
||||
|
|
||||
*/
|
||||
limit: '1mb',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| strict
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When `scrict` is set to true, body parser will only parse Arrays and
|
||||
| Object. Otherwise everything parseable by `JSON.parse` is parsed.
|
||||
|
|
||||
*/
|
||||
strict: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| types
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Which content types are processed as JSON payloads. You are free to
|
||||
| add your own types here, but the request body should be parseable
|
||||
| by `JSON.parse` method.
|
||||
|
|
||||
*/
|
||||
types: [
|
||||
'application/json',
|
||||
'application/json-patch+json',
|
||||
'application/vnd.api+json',
|
||||
'application/csp-report'
|
||||
]
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Raw Parser
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
|
|
||||
|
|
||||
*/
|
||||
raw: {
|
||||
types: [
|
||||
'text/*'
|
||||
]
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Form Parser
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
|
|
||||
|
|
||||
*/
|
||||
form: {
|
||||
types: [
|
||||
'application/x-www-form-urlencoded'
|
||||
]
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Files Parser
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
|
|
||||
|
|
||||
*/
|
||||
files: {
|
||||
types: [
|
||||
'multipart/form-data'
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Max Size
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below value is the max size of all the files uploaded to the server. It
|
||||
| is validated even before files have been processed and hard exception
|
||||
| is thrown.
|
||||
|
|
||||
| Consider setting a reasonable value here, otherwise people may upload GB's
|
||||
| of files which will keep your server busy.
|
||||
|
|
||||
| Also this value is considered when `autoProcess` is set to true.
|
||||
|
|
||||
*/
|
||||
maxSize: '20mb',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Auto Process
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Whether or not to auto-process files. Since HTTP servers handle files via
|
||||
| couple of specific endpoints. It is better to set this value off and
|
||||
| manually process the files when required.
|
||||
|
|
||||
| This value can contain a boolean or an array of route patterns
|
||||
| to be autoprocessed.
|
||||
*/
|
||||
autoProcess: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Process Manually
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The list of routes that should not process files and instead rely on
|
||||
| manual process. This list should only contain routes when autoProcess
|
||||
| is to true. Otherwise everything is processed manually.
|
||||
|
|
||||
*/
|
||||
processManually: []
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Temporary file name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Define a function, which should return a string to be used as the
|
||||
| tmp file name.
|
||||
|
|
||||
| If not defined, Bodyparser will use `uuid` as the tmp file name.
|
||||
|
|
||||
| To be defined as. If you are defining the function, then do make sure
|
||||
| to return a value from it.
|
||||
|
|
||||
| tmpFileName () {
|
||||
| return 'some-unique-value'
|
||||
| }
|
||||
|
|
||||
*/
|
||||
}
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Origin
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Set a list of origins to be allowed. The value can be one of the following
|
||||
|
|
||||
| Boolean: true - Allow current request origin
|
||||
| Boolean: false - Disallow all
|
||||
| String - Comma seperated list of allowed origins
|
||||
| Array - An array of allowed origins
|
||||
| String: * - A wildcard to allow current request origin
|
||||
| Function - Receives the current origin and should return one of the above values.
|
||||
|
|
||||
*/
|
||||
origin: false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Methods
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| HTTP methods to be allowed. The value can be one of the following
|
||||
|
|
||||
| String - Comma seperated list of allowed methods
|
||||
| Array - An array of allowed methods
|
||||
|
|
||||
*/
|
||||
methods: ['GET', 'PUT', 'PATCH', 'POST', 'DELETE'],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Headers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| List of headers to be allowed via Access-Control-Request-Headers header.
|
||||
| The value can be on of the following.
|
||||
|
|
||||
| Boolean: true - Allow current request headers
|
||||
| Boolean: false - Disallow all
|
||||
| String - Comma seperated list of allowed headers
|
||||
| Array - An array of allowed headers
|
||||
| String: * - A wildcard to allow current request headers
|
||||
| Function - Receives the current header and should return one of the above values.
|
||||
|
|
||||
*/
|
||||
headers: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Expose Headers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| A list of headers to be exposed via `Access-Control-Expose-Headers`
|
||||
| header. The value can be on of the following.
|
||||
|
|
||||
| Boolean: false - Disallow all
|
||||
| String: Comma seperated list of allowed headers
|
||||
| Array - An array of allowed headers
|
||||
|
|
||||
*/
|
||||
exposeHeaders: false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Credentials
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Define Access-Control-Allow-Credentials header. It should always be a
|
||||
| boolean.
|
||||
|
|
||||
*/
|
||||
credentials: false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| MaxAge
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Define Access-Control-Allow-Max-Age
|
||||
|
|
||||
*/
|
||||
maxAge: 90
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/** @type {import('@adonisjs/framework/src/Env')} */
|
||||
const Env = use('Env')
|
||||
|
||||
/** @type {import('@adonisjs/ignitor/src/Helpers')} */
|
||||
const Helpers = use('Helpers')
|
||||
|
||||
module.exports = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Connection defines the default connection settings to be used while
|
||||
| interacting with SQL databases.
|
||||
|
|
||||
*/
|
||||
connection: Env.get('DB_CONNECTION', 'sqlite'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sqlite
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Sqlite is a flat file database and can be good choice under development
|
||||
| environment.
|
||||
|
|
||||
| npm i --save sqlite3
|
||||
|
|
||||
*/
|
||||
sqlite: {
|
||||
client: 'sqlite3',
|
||||
connection: {
|
||||
filename: Helpers.databasePath(`${Env.get('DB_DATABASE', 'development')}.sqlite`)
|
||||
},
|
||||
useNullAsDefault: true
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| MySQL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here we define connection settings for MySQL database.
|
||||
|
|
||||
| npm i --save mysql
|
||||
|
|
||||
*/
|
||||
mysql: {
|
||||
client: 'mysql',
|
||||
connection: {
|
||||
host: Env.get('DB_HOST', 'localhost'),
|
||||
port: Env.get('DB_PORT', ''),
|
||||
user: Env.get('DB_USER', 'root'),
|
||||
password: Env.get('DB_PASSWORD', ''),
|
||||
database: Env.get('DB_DATABASE', 'adonis')
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PostgreSQL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here we define connection settings for PostgreSQL database.
|
||||
|
|
||||
| npm i --save pg
|
||||
|
|
||||
*/
|
||||
pg: {
|
||||
client: 'pg',
|
||||
connection: {
|
||||
host: Env.get('DB_HOST', 'localhost'),
|
||||
port: Env.get('DB_PORT', ''),
|
||||
user: Env.get('DB_USER', 'root'),
|
||||
password: Env.get('DB_PASSWORD', ''),
|
||||
database: Env.get('DB_DATABASE', 'adonis')
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/** @type {import('@adonisjs/framework/src/Env')} */
|
||||
const Env = use('Env')
|
||||
|
||||
module.exports = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Driver to be used for hashing values. The same driver is used by the
|
||||
| auth module too.
|
||||
|
|
||||
*/
|
||||
driver: Env.get('HASH_DRIVER', 'bcrypt'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bcrypt
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Config related to bcrypt hashing. https://www.npmjs.com/package/bcrypt
|
||||
| package is used internally.
|
||||
|
|
||||
*/
|
||||
bcrypt: {
|
||||
rounds: 10
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Argon
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Config related to argon. https://www.npmjs.com/package/argon2 package is
|
||||
| used internally.
|
||||
|
|
||||
| Since argon is optional, you will have to install the dependency yourself
|
||||
|
|
||||
|============================================================================
|
||||
| npm i argon2
|
||||
|============================================================================
|
||||
|
|
||||
*/
|
||||
argon: {
|
||||
type: 1
|
||||
}
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/** @type {import('@adonisjs/framework/src/Env')} */
|
||||
const Env = use('Env')
|
||||
|
||||
module.exports = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The session driver to be used for storing session values. It can be
|
||||
| cookie, file or redis.
|
||||
|
|
||||
| For `redis` driver, make sure to install and register `@adonisjs/redis`
|
||||
|
|
||||
*/
|
||||
driver: Env.get('SESSION_DRIVER', 'cookie'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cookie Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The name of the cookie to be used for saving session id. Session ids
|
||||
| are signed and encrypted.
|
||||
|
|
||||
*/
|
||||
cookieName: 'adonis-session',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Clear session when browser closes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If this value is true, the session cookie will be temporary and will be
|
||||
| removed when browser closes.
|
||||
|
|
||||
*/
|
||||
clearWithBrowser: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session age
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value is only used when `clearWithBrowser` is set to false. The
|
||||
| age must be a valid https://npmjs.org/package/ms string or should
|
||||
| be in milliseconds.
|
||||
|
|
||||
| Valid values are:
|
||||
| '2h', '10d', '5y', '2.5 hrs'
|
||||
|
|
||||
*/
|
||||
age: '2h',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cookie options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Cookie options defines the options to be used for setting up session
|
||||
| cookie
|
||||
|
|
||||
*/
|
||||
cookie: {
|
||||
httpOnly: true,
|
||||
sameSite: false,
|
||||
path: '/'
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sessions location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If driver is set to file, we need to define the relative location from
|
||||
| the temporary path or absolute url to any location.
|
||||
|
|
||||
*/
|
||||
file: {
|
||||
location: 'sessions'
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis config
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The configuration for the redis driver. By default we reference it from
|
||||
| the redis file. But you are free to define an object here too.
|
||||
|
|
||||
*/
|
||||
redis: 'self::redis.local'
|
||||
}
|
145
config/shield.js
145
config/shield.js
|
@ -1,145 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Content Security Policy
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Content security policy filters out the origins not allowed to execute
|
||||
| and load resources like scripts, styles and fonts. There are wide
|
||||
| variety of options to choose from.
|
||||
*/
|
||||
csp: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Directives
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All directives are defined in camelCase and here is the list of
|
||||
| available directives and their possible values.
|
||||
|
|
||||
| https://content-security-policy.com
|
||||
|
|
||||
| @example
|
||||
| directives: {
|
||||
| defaultSrc: ['self', '@nonce', 'cdnjs.cloudflare.com']
|
||||
| }
|
||||
|
|
||||
*/
|
||||
directives: {
|
||||
},
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Report only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting `reportOnly=true` will not block the scripts from running and
|
||||
| instead report them to a URL.
|
||||
|
|
||||
*/
|
||||
reportOnly: false,
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Set all headers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Headers staring with `X` have been depreciated, since all major browsers
|
||||
| supports the standard CSP header. So its better to disable deperciated
|
||||
| headers, unless you want them to be set.
|
||||
|
|
||||
*/
|
||||
setAllHeaders: false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Disable on android
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Certain versions of android are buggy with CSP policy. So you can set
|
||||
| this value to true, to disable it for Android versions with buggy
|
||||
| behavior.
|
||||
|
|
||||
| Here is an issue reported on a different package, but helpful to read
|
||||
| if you want to know the behavior. https://github.com/helmetjs/helmet/pull/82
|
||||
|
|
||||
*/
|
||||
disableAndroid: true
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| X-XSS-Protection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| X-XSS Protection saves applications from XSS attacks. It is adopted
|
||||
| by IE and later followed by some other browsers.
|
||||
|
|
||||
| Learn more at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
|
||||
|
|
||||
*/
|
||||
xss: {
|
||||
enabled: true,
|
||||
enableOnOldIE: false
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Iframe Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| xframe defines whether or not your website can be embedded inside an
|
||||
| iframe. Choose from one of the following options.
|
||||
| @available options
|
||||
| DENY, SAMEORIGIN, ALLOW-FROM http://example.com
|
||||
|
|
||||
| Learn more at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
|
||||
*/
|
||||
xframe: 'DENY',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| No Sniff
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Browsers have a habit of sniffing content-type of a response. Which means
|
||||
| files with .txt extension containing Javascript code will be executed as
|
||||
| Javascript. You can disable this behavior by setting nosniff to false.
|
||||
|
|
||||
| Learn more at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
|
||||
|
|
||||
*/
|
||||
nosniff: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| No Open
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| IE users can execute webpages in the context of your website, which is
|
||||
| a serious security risk. Below option will manage this for you.
|
||||
|
|
||||
*/
|
||||
noopen: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSRF Protection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| CSRF Protection adds another layer of security by making sure, actionable
|
||||
| routes does have a valid token to execute an action.
|
||||
|
|
||||
*/
|
||||
csrf: {
|
||||
enable: true,
|
||||
methods: ['POST', 'PUT', 'DELETE'],
|
||||
filterUris: [],
|
||||
cookieOptions: {
|
||||
httpOnly: false,
|
||||
sameSite: true,
|
||||
path: '/',
|
||||
maxAge: 7200
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Factory
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Factories are used to define blueprints for database tables or Lucid
|
||||
| models. Later you can use these blueprints to seed your database
|
||||
| with dummy data.
|
||||
|
|
||||
*/
|
||||
|
||||
/** @type {import('@adonisjs/lucid/src/Factory')} */
|
||||
// const Factory = use('Factory')
|
||||
|
||||
// Factory.blueprint('App/Models/User', (faker) => {
|
||||
// return {
|
||||
// username: faker.username()
|
||||
// }
|
||||
// })
|
8
jeff-downloader2.iml
Normal file
8
jeff-downloader2.iml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
1876
package-lock.json
generated
Normal file
1876
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
47
package.json
47
package.json
|
@ -1,42 +1,19 @@
|
|||
{
|
||||
"name": "jeff-downloader",
|
||||
"version": "0.16.4",
|
||||
"adonis-version": "4.1.0",
|
||||
"description": "A video downloader based on youtube-dl",
|
||||
"main": "server.js",
|
||||
"name": "jeff-downloader2",
|
||||
"version": "0.3.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node server.js",
|
||||
"test": "node ace test"
|
||||
"start": "node ./bin/www"
|
||||
},
|
||||
"keywords": [
|
||||
"adonisjs",
|
||||
"adonis-app",
|
||||
"youtubedl",
|
||||
"youtube-dl"
|
||||
],
|
||||
"author": "Loïc Bersier",
|
||||
"license": "",
|
||||
"private": false,
|
||||
"dependencies": {
|
||||
"@adonisjs/ace": "^5.0.8",
|
||||
"@adonisjs/antl": "^2.0.7",
|
||||
"@adonisjs/auth": "^3.0.7",
|
||||
"@adonisjs/bodyparser": "^2.0.9",
|
||||
"@adonisjs/cors": "^1.0.7",
|
||||
"@adonisjs/fold": "^4.0.9",
|
||||
"@adonisjs/framework": "^5.0.9",
|
||||
"@adonisjs/ignitor": "^2.0.8",
|
||||
"@adonisjs/lucid": "^6.2.0",
|
||||
"@adonisjs/session": "^1.0.27",
|
||||
"@adonisjs/shield": "^1.0.8",
|
||||
"@adonisjs/validator": "^5.0.6",
|
||||
"cookie-parser": "~1.4.4",
|
||||
"debug": "~2.6.9",
|
||||
"ejs": "~2.6.1",
|
||||
"express": "~4.16.1",
|
||||
"fluent-ffmpeg": "^2.1.2",
|
||||
"mysql": "^2.17.1",
|
||||
"node-fetch": "^2.6.0",
|
||||
"youtube-dl": "^1.13.1"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"autoload": {
|
||||
"App": "./app"
|
||||
"formidable": "^1.2.2",
|
||||
"http-errors": "~1.6.3",
|
||||
"morgan": "~1.9.1",
|
||||
"youtube-dl": "^3.5.0"
|
||||
}
|
||||
}
|
||||
|
|
6
proxy/example-proxy.json
Normal file
6
proxy/example-proxy.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
{
|
||||
"ip": "some ip",
|
||||
"country": "Some country"
|
||||
}
|
||||
]
|
|
@ -1,11 +0,0 @@
|
|||
[
|
||||
{
|
||||
"ip": "IP:PORT",
|
||||
"country": "Country",
|
||||
"hideip": true (Optional)
|
||||
},
|
||||
{
|
||||
"ip": "IP:PORT",
|
||||
"country": "Country"
|
||||
},
|
||||
]
|
|
@ -1,99 +0,0 @@
|
|||
/*!
|
||||
// Snow.js - v0.0.3
|
||||
// kurisubrooks.com
|
||||
*/
|
||||
|
||||
// Amount of Snowflakes
|
||||
var snowMax = 35;
|
||||
|
||||
// Snowflake Colours
|
||||
var snowColor = ["#DDD", "#EEE"];
|
||||
|
||||
// Snow Entity
|
||||
var snowEntity = "•";
|
||||
|
||||
// Falling Velocity
|
||||
var snowSpeed = 1;
|
||||
|
||||
// Minimum Flake Size
|
||||
var snowMinSize = 12;
|
||||
|
||||
// Maximum Flake Size
|
||||
var snowMaxSize = 42;
|
||||
|
||||
// Refresh Rate (in milliseconds)
|
||||
var snowRefresh = 50;
|
||||
|
||||
// Additional Styles
|
||||
var snowStyles = "cursor: default; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none;";
|
||||
|
||||
/*
|
||||
// End of Configuration
|
||||
// ----------------------------------------
|
||||
// Do not modify the code below this line
|
||||
*/
|
||||
|
||||
var snow = [],
|
||||
pos = [],
|
||||
coords = [],
|
||||
lefr = [],
|
||||
marginBottom,
|
||||
marginRight;
|
||||
|
||||
function randomise(range) {
|
||||
rand = Math.floor(range * Math.random());
|
||||
return rand;
|
||||
}
|
||||
|
||||
function initSnow() {
|
||||
var snowSize = snowMaxSize - snowMinSize;
|
||||
marginBottom = document.body.scrollHeight - 5;
|
||||
marginRight = document.body.clientWidth - 15;
|
||||
|
||||
for (i = 0; i <= snowMax; i++) {
|
||||
coords[i] = 0;
|
||||
lefr[i] = Math.random() * 15;
|
||||
pos[i] = 0.03 + Math.random() / 10;
|
||||
snow[i] = document.getElementById("flake" + i);
|
||||
snow[i].style.fontFamily = "inherit";
|
||||
snow[i].size = randomise(snowSize) + snowMinSize;
|
||||
snow[i].style.fontSize = snow[i].size + "px";
|
||||
snow[i].style.color = snowColor[randomise(snowColor.length)];
|
||||
snow[i].style.zIndex = 1000;
|
||||
snow[i].sink = snowSpeed * snow[i].size / 5;
|
||||
snow[i].posX = randomise(marginRight - snow[i].size);
|
||||
snow[i].posY = randomise(2 * marginBottom - marginBottom - 2 * snow[i].size);
|
||||
snow[i].style.left = snow[i].posX + "px";
|
||||
snow[i].style.top = snow[i].posY + "px";
|
||||
}
|
||||
|
||||
moveSnow();
|
||||
}
|
||||
|
||||
function resize() {
|
||||
marginBottom = document.body.scrollHeight - 5;
|
||||
marginRight = document.body.clientWidth - 15;
|
||||
}
|
||||
|
||||
function moveSnow() {
|
||||
for (i = 0; i <= snowMax; i++) {
|
||||
coords[i] += pos[i];
|
||||
snow[i].posY += snow[i].sink;
|
||||
snow[i].style.left = snow[i].posX + lefr[i] * Math.sin(coords[i]) + "px";
|
||||
snow[i].style.top = snow[i].posY + "px";
|
||||
|
||||
if (snow[i].posY >= marginBottom - 2 * snow[i].size || parseInt(snow[i].style.left) > (marginRight - 3 * lefr[i])) {
|
||||
snow[i].posX = randomise(marginRight - snow[i].size);
|
||||
snow[i].posY = 0;
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout("moveSnow()", snowRefresh);
|
||||
}
|
||||
|
||||
for (i = 0; i <= snowMax; i++) {
|
||||
document.write("<span id='flake" + i + "' style='" + snowStyles + "position:absolute;top:-" + snowMaxSize + "'>" + snowEntity + "</span>");
|
||||
}
|
||||
|
||||
window.addEventListener('resize', resize);
|
||||
window.addEventListener('load', initSnow);
|
|
@ -1,145 +0,0 @@
|
|||
body {
|
||||
background-color: #262d2c;
|
||||
color: white;
|
||||
text-align: center;
|
||||
align-content: center;
|
||||
font-family: "Roboto", "Arial";
|
||||
margin-top: 10vw;
|
||||
margin-bottom: 10vw;
|
||||
}
|
||||
|
||||
body input[type=radio]:focus {
|
||||
animation: shadowColorchange 13s infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
.downloader {
|
||||
width: 100%;
|
||||
margin-top: 3vw;
|
||||
margin-bottom: 3vw;
|
||||
}
|
||||
|
||||
.downloadbtn, .downloadurl {
|
||||
border: none;
|
||||
margin: auto;
|
||||
padding: 0.5em 0.5vw;
|
||||
align-content: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.downloadurl {
|
||||
width: 10em;
|
||||
background-color: white;
|
||||
color: black;
|
||||
border-radius: 15px 0px 0px 15px;
|
||||
}
|
||||
|
||||
.downloadurl[type=text]:focus, textarea:focus {
|
||||
animation: shadowColorchange 13s infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
.downloadbtn {
|
||||
color: black;
|
||||
border-radius: 0px 15px 15px 0px;
|
||||
animation: colorchange 13s infinite;
|
||||
animation-direction: alternate-reverse;
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: red;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: lightblue;
|
||||
}
|
||||
|
||||
@keyframes shadowColorchange {
|
||||
0% {
|
||||
box-shadow: 0 0 15px #ff2400;
|
||||
border: 0px solid #ff2400;
|
||||
}
|
||||
10% {
|
||||
box-shadow: 0 0 15px #e81d1d;
|
||||
border: 0px solid #e81d1d;
|
||||
}
|
||||
20% {
|
||||
box-shadow: 0 0 15px #e8b71d;
|
||||
border: 0px solid #e8b71d;
|
||||
}
|
||||
30% {
|
||||
box-shadow: 0 0 15px #e3e81d;
|
||||
border: 0px solid #e3e81d;
|
||||
}
|
||||
40% {
|
||||
box-shadow: 0 0 15px #1de840;
|
||||
border: 0px solid #1de840;
|
||||
}
|
||||
50% {
|
||||
box-shadow: 0 0 15px #1ddde8;
|
||||
border: 0px solid #1ddde8;
|
||||
}
|
||||
60% {
|
||||
box-shadow: 0 0 15px #2b1de8;
|
||||
border: 0px solid #2b1de8;
|
||||
}
|
||||
70% {
|
||||
box-shadow: 0 0 15px #dd00f3;
|
||||
border: 0px solid #dd00f3;
|
||||
}
|
||||
80% {
|
||||
box-shadow: 0 0 15px #dd00f3;
|
||||
border: 0px solid #dd00f3;
|
||||
}
|
||||
90% {
|
||||
box-shadow: 0 0 15px #ff2400;
|
||||
border: 0px solid #ff2400;
|
||||
}
|
||||
100% {
|
||||
box-shadow: 0 0 15px #ff2400;
|
||||
border: 0px solid #ff2400;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@keyframes colorchange {
|
||||
0% {
|
||||
background-color: #ff2400;
|
||||
color: white;
|
||||
}
|
||||
10% {
|
||||
background-color: #e81d1d;
|
||||
}
|
||||
20% {
|
||||
background-color: #e8b71d;
|
||||
color: black;
|
||||
}
|
||||
30% {
|
||||
background-color: #e3e81d;
|
||||
}
|
||||
40% {
|
||||
background-color: #1de840;
|
||||
color: white;
|
||||
}
|
||||
50% {
|
||||
background-color: #1ddde8;
|
||||
color: black;
|
||||
}
|
||||
60% {
|
||||
background-color: #2b1de8;
|
||||
}
|
||||
70% {
|
||||
background-color: #dd00f3;
|
||||
}
|
||||
80% {
|
||||
background-color: #dd00f3;
|
||||
}
|
||||
90% {
|
||||
background-color: #ff2400;
|
||||
}
|
||||
100% {
|
||||
background-color: #ff2400;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"1": "u lookin hot today vro 😳😳",
|
||||
"2": "I am not responsible for what you download.",
|
||||
"3": "If you want to support me you can donate through my paypal at the bottom of the page",
|
||||
"4": "Did you know this website is open source?",
|
||||
"5": "Did you know this website can download from other website than youtube?",
|
||||
"6": "You can mouse hover a video to see a preview of it!",
|
||||
"7": "You can test experimental version of the website on https://preview.namejeff.xyz"
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"title": "Le epic downloader",
|
||||
"announcement": "إعلان",
|
||||
"LQ": "جودة رديئة",
|
||||
"HQ": "جودة عالية",
|
||||
"altDL": "تنزيل مختلف",
|
||||
"feed": "إخفاء الفيديو المراد تنزيله من قائمة المقاطع التي تم تنزيلها مؤخرا",
|
||||
"download": "تنزيل",
|
||||
"dlStart": "تم بدأ التنزيل",
|
||||
"errorCopy": "تم حدوث خطأ خلال محاولة نسخ الرابط إلى الحافظة",
|
||||
"successCopy": "تم نسخ الرابط بنجاح",
|
||||
"recentFeed": "مقاطع تم تنزيلها مؤخرا",
|
||||
"recentDownload": "تنزيل",
|
||||
"recentCopy": "نسخ الرابط إلى الحافظة",
|
||||
"recentFormat": "بنية الملف",
|
||||
"recentSize": "حجم الملف",
|
||||
"recentDate": "تاريخ التحميل",
|
||||
"footer": "أخلي نفسي من جميع المسؤوليات التي تتعلق بأي مقطع تم تنزيله من خلال هذا الموقع",
|
||||
"footer2p1": "صنع بمساعدة من",
|
||||
"footer2p2": "أعمالي الأخرى",
|
||||
"footer2p3": "عدد زيارات هذا الموقع حتى الأن",
|
||||
"footer2p4": "إذا واجهتك اي مشاكل خلال محاولتك لتنزيل المقاطع يمكنك التواصل مع:",
|
||||
"footer2p5": "على Discord",
|
||||
"footer3p1": "يمكنك اظهار دعمك من خلال",
|
||||
"footer3p2": "او بإرسال",
|
||||
"footer3p3": "إلى هذا الموقع او من خلال استخدام رابط الإحالة الخاص بي",
|
||||
"footer4": "النسخة القديمة من هذا الموقع",
|
||||
"eggXmas": "كريسماس سعيد"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"1": "brácho ty seš nějak krásnej 😳😳",
|
||||
"2": "Nejsem za tvé stážení zodpovědný",
|
||||
"3": "Pokud mě chcete podporovat můžete mi dát peníze na Paypalu na dně stránky",
|
||||
"4": "Víte, že tento web je open source?",
|
||||
"5": "Víte, že touto stránkou můžete stáhnout videa z dalším stránkám než Youtubu?",
|
||||
"6": "Můžete najet myší na video abyste viděli náhled!",
|
||||
"7": "You can test experimental version of the website on https://preview.namejeff.xyz"
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"title": "le epický stahovač",
|
||||
"announcement": "Upozornění",
|
||||
"LQ": "Nízká kvalita",
|
||||
"HQ": "Vysoká kvalita",
|
||||
"altDL": "Alternativní stažení",
|
||||
"feed": "Zakrýt na feedu",
|
||||
"download": "Stáhnout video",
|
||||
"dlStart": "Stažení začalo!",
|
||||
"errorCopy": "Chyba kopírování do schránky.",
|
||||
"successCopy": "Úspěšně kopírováno do schránky!",
|
||||
"recentFeed": "Nedávno stažená videa",
|
||||
"recentDownload": "Stahnout",
|
||||
"recentCopy": "Kopírovat do schránky",
|
||||
"recentFormat": "Typ souboru",
|
||||
"recentSize": "Velikost souboru",
|
||||
"recentDate": "Datum stažení",
|
||||
"footer": "Nemám odpovědnost za stažení tímto webem.",
|
||||
"footer2p1": "Čest",
|
||||
"footer2p2": "Moje další projekty",
|
||||
"footer2p3": "Počet návštěv",
|
||||
"footer2p4": "Kontaktujte",
|
||||
"footer2p5": "na Discordu pokud máte problémy",
|
||||
"footer3p1": "Můžete mě taky podporovat na",
|
||||
"footer3p2": "nebo dát spropitné",
|
||||
"footer3p3": "na tomto webu!",
|
||||
"footer4": "Starší verze",
|
||||
"eggXmas": "Pour féliciter!"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"1": "u lookin hot today vro 😳😳",
|
||||
"2": "I am not responsible for what you download.",
|
||||
"3": "If you want to support me you can donate through my paypal at the bottom of the page",
|
||||
"4": "Did you know this website is open source?",
|
||||
"5": "Did you know this website can download from other website than youtube?",
|
||||
"6": "You can mouse hover a video to see a preview of it!",
|
||||
"7": "You can test experimental version of the website on https://preview.namejeff.xyz"
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"title": "Le epic downloader",
|
||||
"announcement": "Ansage",
|
||||
"LQ": "Niedrige Qualität",
|
||||
"HQ": "Hohe Qualität",
|
||||
"altDL": "Alternativer Download",
|
||||
"feed": "Von Feed verstecken",
|
||||
"download": "Laden sie das scheiß Video herunter",
|
||||
"dlStart": "Das Download hat angefangen!",
|
||||
"errorCopy": "Ein Fehler ist aufgetreten bei dem Kopieren.",
|
||||
"successCopy": "Erfolgreichlich Kopiert!",
|
||||
"recentFeed": "Video die vor kurzen gedownloaded wurden",
|
||||
"recentDownload": "Download",
|
||||
"recentCopy": "Kopieren zu clipboard",
|
||||
"recentFormat": "Datei Format",
|
||||
"recentSize": "Dateigröße",
|
||||
"recentDate": "Downloaddatum",
|
||||
"footer": "Ich Ablehene alle Verantwortlichkeiten die website is für downloaden.",
|
||||
"footer2p1": "Gutschrift an",
|
||||
"footer2p2": "Meine andere Projekten",
|
||||
"footer2p3": "Anzahl der Besuche",
|
||||
"footer2p4": "Kontaktieren",
|
||||
"footer2p5": "auf Discord wenn sie Probleme haben",
|
||||
"footer3p1": "Sie können mich hier unterstüzten",
|
||||
"footer3p2": "Oder mit Trinkgeld",
|
||||
"footer3p3": "auf dieser Website",
|
||||
"footer4": "Legacy Version",
|
||||
"eggXmas": "Frohe Weihnachten"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"1": "u lookin hot today vro 😳😳",
|
||||
"2": "I am not responsible for what you download.",
|
||||
"3": "If you want to support me you can donate to my Paypal at the bottom of this page",
|
||||
"4": "Did you know this website is open source?",
|
||||
"5": "Did you know this website can download from websites other than Youtube?",
|
||||
"6": "You can hover your mouse cursor over a video to see a preview of it!",
|
||||
"7": "You can test experimental version of the website on https://preview.namejeff.xyz"
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"title": "Le epic downloader",
|
||||
"announcement": "Announcement",
|
||||
"LQ": "Low quality",
|
||||
"HQ": "High quality",
|
||||
"altDL": "Alternate download",
|
||||
"feed": "Hide from feed",
|
||||
"download": "Download that mf video",
|
||||
"dlStart": "Download started!",
|
||||
"errorCopy": "An error has occured while copying the link to your clipboard.",
|
||||
"successCopy": "Successfully copied link to your clipboard!",
|
||||
"recentFeed": "Recently downloaded videos",
|
||||
"recentDownload": "Download",
|
||||
"recentCopy": "Copy to clipboard",
|
||||
"recentFormat": "File format",
|
||||
"recentSize": "File size",
|
||||
"recentDate": "Download date",
|
||||
"footer": "I don't take any accountability for downloads made using this website.",
|
||||
"footer2p1": "Credit to",
|
||||
"footer2p2": "My other projects",
|
||||
"footer2p3": "Numbers of visits",
|
||||
"footer2p4": "Contact",
|
||||
"footer2p5": "on Discord if you have any issues",
|
||||
"footer3p1": "You can also support me either on",
|
||||
"footer3p2": "or by tipping",
|
||||
"footer3p3": "on this website!",
|
||||
"footer4": "Legacy version",
|
||||
"eggXmas": "Merry Christmas!"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"1": "u lookin hot today vro 😳😳",
|
||||
"2": "I am not responsible for what you download.",
|
||||
"3": "If you want to support me you can donate to my Paypal at the bottom of this page",
|
||||
"4": "Did you know this website is open source?",
|
||||
"5": "Did you know this website can download from websites other than Youtube?",
|
||||
"6": "You can hover your mouse cursor over a video to see a preview of it!",
|
||||
"7": "You can test experimental version of the website on https://preview.namejeff.xyz"
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"title": "Le epic downloader",
|
||||
"announcement": "Announcement",
|
||||
"LQ": "Low quality",
|
||||
"HQ": "High quality",
|
||||
"altDL": "Alternate download",
|
||||
"feed": "Hide from feed",
|
||||
"download": "Download that mf video",
|
||||
"dlStart": "Download started!",
|
||||
"errorCopy": "An error has occured while copying the link to your clipboard.",
|
||||
"successCopy": "Successfully copied link to your clipboard!",
|
||||
"recentFeed": "Recently downloaded videos",
|
||||
"recentDownload": "Download",
|
||||
"recentCopy": "Copy to clipboard",
|
||||
"recentFormat": "File format",
|
||||
"recentSize": "File size",
|
||||
"recentDate": "Download date",
|
||||
"footer": "I don't take any accountability for downloads made using this website.",
|
||||
"footer2p1": "Credit to",
|
||||
"footer2p2": "My other projects",
|
||||
"footer2p3": "Numbers of visits",
|
||||
"footer2p4": "Contact",
|
||||
"footer2p5": "on Discord if you have any issues",
|
||||
"footer3p1": "You can also support me either on",
|
||||
"footer3p2": "or by tipping",
|
||||
"footer3p3": "on this website!",
|
||||
"footer4": "Legacy version",
|
||||
"eggXmas": "Merry Christmas!"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"1": "salut bg 😳😳",
|
||||
"2": "Je ne suis pas résponsable pour ce que vous télécharger.",
|
||||
"3": "Si vous voulez me supporter vous pouvez me faire une donation avec paypal en bas de la page.",
|
||||
"4": "Le saviez-vous? Le site est open source!",
|
||||
"5": "Le saviez-vous? Vous pouvez télécharger des vidéos sur d'autre site que youtube.",
|
||||
"6": "Vous pouvez passer la souris sur une vidéo pour en voir un aperçu!",
|
||||
"7": "Vous pouvez tester la version experimental du site sur https://preview.namejeff.xyz"
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"title": "Le epic downloader",
|
||||
"announcement": "Annonces",
|
||||
"LQ": "Basse qualité",
|
||||
"HQ": "Haute qualité",
|
||||
"altDL": "Téléchargement alternatif",
|
||||
"feed": "Masquer du flux",
|
||||
"download": "Télécharge cette ptn de vidéo",
|
||||
"dlStart": "Téléchargement lancée!",
|
||||
"errorCopy": "Une erreur est survenue en essayant de copier le lien dans votre presse-papier",
|
||||
"successCopy": "Lien copié avec succès vers votre presse-papiers!",
|
||||
"recentFeed": "Vidéos récemment télécharger",
|
||||
"recentDownload": "Télécharge",
|
||||
"recentCopy": "Copier au press-papier",
|
||||
"recentFormat": "Format du fichier",
|
||||
"recentSize": "Taille du fichier",
|
||||
"recentDate": "Date de téléchargement",
|
||||
"footer": "Je décline toute résponsabilité pour les téléchargement fait avec ce site",
|
||||
"footer2p1": "Merci à",
|
||||
"footer2p2": "Mes autres projets",
|
||||
"footer2p3": "Nombre de visite",
|
||||
"footer2p4": "Contactée",
|
||||
"footer2p5": "sur Discord si vous avez des problèmes",
|
||||
"footer3p1": "Vous pouvez me supporter sur",
|
||||
"footer3p2": "ou en faisant une donation avec",
|
||||
"footer3p3": "sur ce site!",
|
||||
"footer4": "Legacy version",
|
||||
"eggXmas": "Joyeu noël!"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"1": "tu šodien labi izskaties ;)))",
|
||||
"2": "Es neatbildu par saturu, ko tu lejupielādē.",
|
||||
"3": "Ja tu vēlies atbalstīt manu projektu, ir iespēja ziedot caur paypal mājaslapas apakšā.",
|
||||
"4": "Vai tu zināji, ka šī mājaslapa ir balstīta uz atvērto kodu?",
|
||||
"5": "Vai tu zināji, ka šī mājaslapa spēj lejupielādēt arī no citiem video servisiem, ne tikai youtube?",
|
||||
"6": "Novieto kursoru uz video lai redzētu īsu priekšskatījumu!",
|
||||
"7": "You can test experimental version of the website on https://preview.namejeff.xyz"
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"title": "le episkais lejupielādētājs",
|
||||
"announcement": "Paziņojums",
|
||||
"LQ": "Zema kvalitāte",
|
||||
"HQ": "Augsta kvalitāte",
|
||||
"altDL": "Alternatīva lejupielāde",
|
||||
"feed": "Paslēpt ziņojumus",
|
||||
"download": "Lejupielādēt to sasodīto video",
|
||||
"dlStart": "Lejupielāde sākusies!",
|
||||
"errorCopy": "Radās kļūda kamēr mēģinājām nokopēt linku tavā vietā.",
|
||||
"successCopy": "Links tika nokopēts tavā vietā.",
|
||||
"recentFeed": "Nesen lejupielādētie video",
|
||||
"recentDownload": "Lejupielādēt",
|
||||
"recentCopy": "Kopēt saiti",
|
||||
"recentFormat": "Faila formāts",
|
||||
"recentSize": "Faila izmērs",
|
||||
"recentDate": "Lejupielādes datums",
|
||||
"footer": "Es neuzņemos atbildību par jebkādu saturu, kas tiek lejupielādēts izmantojot šo mājaslapu.",
|
||||
"footer2p1": "Pateicība",
|
||||
"footer2p2": "Citi mani projekti",
|
||||
"footer2p3": "Apmeklējumu skaits",
|
||||
"footer2p4": "Kontaktējies ar",
|
||||
"footer2p5": "caur Discord ja atradi kādu nepilnību",
|
||||
"footer3p1": "Tu vari atbalstīt mani vai nu caur",
|
||||
"footer3p2": ", vai ziedojot",
|
||||
"footer3p3": "šinī mājaslapā!",
|
||||
"footer4": "Agrīnā versija",
|
||||
"eggXmas": "Priecīgus Ziemassvētkus!"
|
||||
}
|
|
@ -1,316 +0,0 @@
|
|||
<!--
|
||||
What are you doing here 😳😳😳😳
|
||||
I guess have fun looking at the html, no easter egg to find here.
|
||||
Come take a look here https://git.namejeff.xyz/Supositware/jeff-downloader for all my bad coding
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<html class="has-background-grey-dark" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="{{ antl.formatMessage('messages.title') }} v{{ version }}" />
|
||||
<meta property="og:description" content="A simple video downloader without any ad or tracking." />
|
||||
<meta property="og:url" content="https://namejeff.xyz/" />
|
||||
<meta property="og:image" content="https://namejeff.xyz/asset/jeff.png" />
|
||||
<meta name="theme-color" content="#3b2ccf" />
|
||||
<link rel="icon" href="/asset/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="asset/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="css/index.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/background.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css">
|
||||
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
|
||||
<title>{{ antl.formatMessage('messages.title') }} v{{ version }}</title>
|
||||
</head>
|
||||
<body class="gradientBG has-text-light">
|
||||
<ul class="circles">
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
</ul>
|
||||
<header>
|
||||
<section class="section" id="announcement">
|
||||
<div class="container">
|
||||
@if(announcement || (day == '24' || day == '25') && month == '11')
|
||||
<div class="message is-info">
|
||||
<div class="message-header">
|
||||
{{ antl.formatMessage('messages.announcement') }}
|
||||
<button class="delete" onclick="fadeout('announcement')"></button>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
@if((day == '24' || day == '25') && month == '11')
|
||||
<p class="title">{{ antl.formatMessage('messages.eggXmas') }}</p>
|
||||
@endif
|
||||
<p class="subtitle">{{ announcement }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</section>
|
||||
</header>
|
||||
|
||||
<section class="section has-text-centered">
|
||||
<div class="container ">
|
||||
<div class="downloader form">
|
||||
<h1 class="title has-text-light">{{ antl.formatMessage('messages.title') }} v{{ version }}</h1>
|
||||
<form name="download-form" method="POST" action="/">
|
||||
{{ csrfField() }}
|
||||
@if(month == '11')
|
||||
<script src="JS/snow.js"></script>
|
||||
@endif
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-body">
|
||||
<div class="field is-horizontal">
|
||||
<div class="control">
|
||||
<label class="radio" for="small">
|
||||
<input class="radio" type="radio" name="quality" id="small" value="small">
|
||||
{{ antl.formatMessage('messages.LQ') }}
|
||||
</label>
|
||||
|
||||
<label class="radio" for="high">
|
||||
<input class="radio" type="radio" name="quality" id="high" value="high" checked>
|
||||
{{ antl.formatMessage('messages.HQ') }}
|
||||
</label>
|
||||
|
||||
<label class="checkbox" for="alt">
|
||||
<input class="checkbox" type="checkbox" name="alt" id="alt" title="Use this if download dosen't work">
|
||||
{{ antl.formatMessage('messages.altDL') }}
|
||||
</label>
|
||||
|
||||
<label class="checkbox" for="feed">
|
||||
<input class="checkbox" type="checkbox" name="feed" id="feed" title="Use this if you don't want the video you are downloading to be public">
|
||||
{{ antl.formatMessage('messages.feed') }}
|
||||
</label>
|
||||
|
||||
<label class="checkbox" for="sponsorBlock">
|
||||
<input class="checkbox" type="checkbox" name="sponsorBlock" id="sponsorBlock" title="(Using sponsor.ajay.app)">
|
||||
(W.I.P) Remove sponsors of video using <a href="https://sponsor.ajay.app/">SponsorBlock</a>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-body">
|
||||
<div class="field is-expanded">
|
||||
<div class="field has-addons">
|
||||
<p class="control is-expanded">
|
||||
<input type="text" id="URL" name="URL" class="downloadurl input is-rounded" placeholder="Link">
|
||||
</p>
|
||||
<p class="control">
|
||||
<button type="button" class="downloadbtn button is-primary is-rounded" id="button" onclick="submitDownload()">{{ antl.formatMessage('messages.download') }}</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field has-addon">
|
||||
<div class="control">
|
||||
</div>
|
||||
<div class="control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field is-horizontal level">
|
||||
|
||||
<div class="control level-left">
|
||||
<label class="radio" for="mp4">
|
||||
<input class="radio" type="radio" name="format" value="mp4" id="mp4" checked>
|
||||
Video?
|
||||
</label>
|
||||
|
||||
<label class="radio" for="mp3">
|
||||
<input class="radio" type="radio" name="format" value="mp3" id="mp3">
|
||||
MP3?
|
||||
</label>
|
||||
|
||||
<label class="radio" for="flac" title="This is pure placebo">
|
||||
<input class="radio" type="radio" name="format" value="flac" id="flac" title="This is pure placebo">
|
||||
FLAC?
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="field-body level-right">
|
||||
<div class="field is-horizontal">
|
||||
<div class="control">
|
||||
<span>Proxy options:</span>
|
||||
<label class="radio" for="none">
|
||||
<input class="radio" type="radio" name="proxy" value="none" id="none" checked>
|
||||
None
|
||||
</label>
|
||||
@each(proxy in proxy)
|
||||
<label class="radio" for="{{ proxy.ip }}">
|
||||
<input class="radio" type="radio" name="proxy" value="{{ proxy.ip }}" id="{{ proxy.ip }}">
|
||||
{{ proxy.ip.substring(0, proxy.ip.length - 5) }} - {{ proxy.country }}
|
||||
</label>
|
||||
@endeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="container">
|
||||
<div id="msg"></div>
|
||||
@if(error)
|
||||
<div class="notification is-danger fadein" id="error">
|
||||
<button class="delete" onclick="fadeout('error')"></button>
|
||||
{{ errormsg }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@if(file != "")
|
||||
<p class="title has-text-light has-text-centered">{{ antl.formatMessage('messages.recentFeed') }}</p>
|
||||
<section class="section">
|
||||
<div class="columns is-vcentered is-multiline fadein">
|
||||
@each(file in file)
|
||||
<div class="column hvr-grow">
|
||||
<div class="column box notification is-dark level">
|
||||
<p class="subtitle">{{ file.name }}</p>
|
||||
<div>
|
||||
<figure class="is-4by3">
|
||||
<video muted loop onmouseover="this.play();" onmouseout="this.pause();this.currentTime = 0;" oncanplay="this.muted=true;" poster="{{ file.img }}" preload="metadata">
|
||||
<source src="/thumbnail/{{ file.name }}.mp4#t=0.5" >
|
||||
<img src="{{ file.img }}" title="Your browser does not support the <video> tag">
|
||||
</video>
|
||||
</figure>
|
||||
</div>
|
||||
<br>
|
||||
<div class="content">
|
||||
<div class="field has-addons is-centered">
|
||||
<p class="control">
|
||||
<a class="button is-link is-rounded" href="{{ file.location }}" download>{{ antl.formatMessage('messages.recentDownload') }}<i class="fas fa-fw fa-file-download" aria-hidden="true"></i></a>
|
||||
</p>
|
||||
<p class="control">
|
||||
<button class="button is-link is-rounded" onclick="toClipboard('https:\/\/namejeff.xyz\/{{ file.location }}')">{{ antl.formatMessage('messages.recentCopy') }}<i class="fas fa-fw fa-clipboard" aria-hidden="true"></i></button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<div class="tags has-addons">
|
||||
<span class="tag">{{ antl.formatMessage('messages.recentFormat') }}</span>
|
||||
<span class="tag is-primary">{{ file.ext }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control">
|
||||
<div class="tags has-addons">
|
||||
<span class="tag">{{ antl.formatMessage('messages.recentSize') }}</span>
|
||||
<span class="tag is-primary">{{ antl.formatNumber(file.size) }} {{ file.unit }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control">
|
||||
<div class="tags has-addons">
|
||||
<span class="tag">{{ antl.formatMessage('messages.recentDate') }}</span>
|
||||
<span class="tag is-primary">{{ antl.formatDate(file.date) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endeach
|
||||
</div>
|
||||
</section>
|
||||
@endif
|
||||
<footer class="footer has-background-grey-dark has-text-light has-text-centered">
|
||||
<p>Uses SponsorBlock API from <a href="https://sponsor.ajay.app/">https://sponsor.ajay.app/</a></p>
|
||||
<p>{{ antl.formatMessage('messages.footer') }}</p>
|
||||
@if(antl._locale == 'ar')
|
||||
<bdi><p>{{ antl.formatMessage('messages.footer2p1') }} <a href="https://github.com/rg3/youtube-dl/">youtube-dl</a> - {{ antl.formatMessage('messages.footer2p2') }} <a href="https://discordapp.com/oauth2/authorize?client_id=377563711927484418&scope=bot&permissions=0">Haha yes</a> & <a href="https://twitter.com/ExplosmR">ExplosmRCG twitter bot</a> - {{ antl.formatMessage('messages.footer2p3') }}: {{ viewCounter }} - {{ antl.formatMessage('messages.footer2p4') }} <a href="https://discord.gg/cNRh5JQ">Supositware#1616</a> {{ antl.formatMessage('messages.footer2p5') }} </bdi></p>
|
||||
<bdi><p>{{ antl.formatMessage('messages.footer3p1') }} <a href="https://www.paypal.me/supositware">Paypal</a> {{ antl.formatMessage('messages.footer3p2') }} <a href="https://basicattentiontoken.org/">BAT</a> {{ antl.formatMessage('messages.footer3p3') }} <a href="https://brave.com/nam120">Brave Browser </a> </bdi>
|
||||
@else
|
||||
<p>{{ antl.formatMessage('messages.footer2p1') }} <a href="https://github.com/rg3/youtube-dl/">youtube-dl</a> - {{ antl.formatMessage('messages.footer2p2') }} <a href="https://discordapp.com/oauth2/authorize?client_id=377563711927484418&scope=bot&permissions=0">Haha yes</a> & <a href="https://twitter.com/ExplosmR">ExplosmRCG twitter bot</a> - {{ antl.formatMessage('messages.footer2p3') }}: {{ viewCounter }} - {{ antl.formatMessage('messages.footer2p4') }} <a href="https://discord.gg/cNRh5JQ">Supositware#1616</a> {{ antl.formatMessage('messages.footer2p5') }}</p>
|
||||
<p>{{ antl.formatMessage('messages.footer3p1') }} <a href="https://www.paypal.me/supositware">Paypal</a> {{ antl.formatMessage('messages.footer3p2') }} <a href="https://basicattentiontoken.org/">BAT</a> {{ antl.formatMessage('messages.footer3p3') }} </a>
|
||||
@endif
|
||||
<p><a href="legacy">{{ antl.formatMessage('messages.footer4') }}</a> - <a href="https://git.namejeff.xyz/Supositware/jeff-downloader">Source code</a></p>
|
||||
</footer>
|
||||
@if(month == '11')
|
||||
<script src="JS/snow.js"></script>
|
||||
@endif
|
||||
</body>
|
||||
<script>
|
||||
function submitDownload() {
|
||||
let frm = document.getElementsByName('download-form')[0];
|
||||
frm.submit();
|
||||
document.getElementById('msg').innerHTML = '<div class="notification is-success fadein" id="notif"></button>{{ antl.formatMessage('messages.dlStart') }}</div>';
|
||||
setTimeout(() => {
|
||||
fadeout('notif')
|
||||
}, 2000);
|
||||
frm.reset();
|
||||
return false;
|
||||
}
|
||||
|
||||
function fadeout(id) {
|
||||
document.getElementById(id).classList.add('fadeout');
|
||||
setTimeout(() => {
|
||||
let element = document.getElementById(id);
|
||||
element.parentNode.removeChild(element);
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
function toClipboard(text) {
|
||||
navigator.clipboard.writeText(text)
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
document.getElementById('msg').innerHTML = '<div class="notification is-error fadein" id="notif">{{ antl.formatMessage('messages.errorCopy') }}</div>';
|
||||
setTimeout(() => {
|
||||
fadeout('notif')
|
||||
}, 2000);
|
||||
});
|
||||
document.getElementById('msg').innerHTML = '<div class="notification is-success fadein" id="notif">{{ antl.formatMessage('messages.successCopy') }}</div>';
|
||||
setTimeout(() => {
|
||||
fadeout('notif')
|
||||
}, 2000);
|
||||
}
|
||||
// If alt download block other settings since they don't work anyway
|
||||
document.getElementById('alt').onclick = function() {
|
||||
if(document.getElementById('alt').checked) {
|
||||
document.getElementById('small').disabled = true;
|
||||
document.getElementById('small').checked = false;
|
||||
|
||||
document.getElementById('mp3').disabled = true;
|
||||
document.getElementById('mp3').checked = false;
|
||||
document.getElementById('flac').disabled = true;
|
||||
document.getElementById('flac').checked = false;
|
||||
document.getElementById('sponsorBlock').disable = true;
|
||||
document.getElementById('sponsorBlock').disable = false;
|
||||
document.getElementById('mp4').checked = true;
|
||||
document.getElementById('high').checked = true;
|
||||
|
||||
} else {
|
||||
document.getElementById('small').disabled = false;
|
||||
document.getElementById('mp3').disabled = false;
|
||||
document.getElementById('flac').disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
// If user press enter do same thing as if pressing the button
|
||||
let input = document.getElementById("URL");
|
||||
input.addEventListener("keyup", function(event) {
|
||||
if (event.keyCode === 13) {
|
||||
event.preventDefault();
|
||||
document.getElementById("button").click();
|
||||
}
|
||||
});
|
||||
|
||||
console.log('%cWhat are you doing here 😳😳😳😳', 'font-size: 40px;');
|
||||
|
||||
@if(day == '1' && month == '3')
|
||||
eval(atob('bGV0IGN1ckJsdXI9LjM7ZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LnN0eWxlLmZpbHRlcj1gYmx1cigke2N1ckJsdXJ9cHgpYCxzZXRJbnRlcnZhbCgoKT0+e2N1ckJsdXIrPS4xLGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5zdHlsZS5maWx0ZXI9YGJsdXIoJHtjdXJCbHVyfXB4KWB9LDFlNCk7'));
|
||||
@endif
|
||||
</script>
|
||||
</html>
|
|
@ -1,113 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="{{ antl.formatMessage('messages.title') }} v{{ version }} (legacy)" />
|
||||
<meta property="og:description" content="A simple video downloader without any ad or tracking." />
|
||||
<meta property="og:url" content="https://namejeff.xyz/" />
|
||||
<meta property="og:image" content="https://namejeff.xyz/asset/jeff.png" />
|
||||
<meta name="theme-color" content="#262d2c" />
|
||||
<link rel="icon" href="/asset/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="/asset/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/css/legacy.css">
|
||||
<title>{{ antl.formatMessage('messages.title') }} v{{ version }} (legacy)</title>
|
||||
</head>
|
||||
<body>
|
||||
@if(announcement || (day == '24' || day == '25') && month == '11')
|
||||
<div class="announcements">
|
||||
@if((day == '24' || day == '25') && month == '11')
|
||||
<p>{{ antl.formatMessage('messages.eggXmas') }}</p>
|
||||
@endif
|
||||
<p>{{ announcement }}</p>
|
||||
<p>This part of the website is <strong>legacy</strong> which mean it can be broken at any time!</p>
|
||||
</div>
|
||||
@endif
|
||||
<div class="downloader">
|
||||
<h1 class="title">{{ antl.formatMessage('messages.title') }} v{{ version }} (legacy)</h1>
|
||||
<form name="download-form" method="POST" action="/legacy">
|
||||
{{ csrfField() }}
|
||||
<label for="small">{{ antl.formatMessage('messages.LQ') }}</label>
|
||||
<input type="radio" name="quality" id="small" value="small">
|
||||
|
||||
<label for="high">{{ antl.formatMessage('messages.HQ') }}</label>
|
||||
<input type="radio" name="quality" id="high" value="high" checked>
|
||||
|
||||
<label for="alt">{{ antl.formatMessage('messages.altDL') }}</label>
|
||||
<input type="checkbox" name="alt" id="alt" title="Use this if download dosen't work">
|
||||
|
||||
<label for="feed">{{ antl.formatMessage('messages.feed') }}</label>
|
||||
<input type="checkbox" name="feed" id="feed" title="Chcek this to hide the video from public feed">
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<input type="text" id="URL" name="URL" class="downloadurl"><button type="button" class="downloadbtn" id="button" onclick="submitDownload()">{{ antl.formatMessage('messages.download') }}</button>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<label for="mp4">MP4?</label>
|
||||
<input type="radio" name="format" value="mp4" id="mp4" checked>
|
||||
|
||||
<label for="mp3">MP3?</label>
|
||||
<input type="radio" name="format" value="mp3" id="mp3">
|
||||
|
||||
<label for="flac">FLAC?</label>
|
||||
<input type="radio" name="format" value="flac" id="flac">
|
||||
<p id="msg"></p>
|
||||
</form>
|
||||
|
||||
@if(error)
|
||||
<p>{{ errormsg }}</p>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<footer>
|
||||
<p>{{ antl.formatMessage('messages.footer') }}</p>
|
||||
@if(antl._locale == 'ar')
|
||||
<bdi><p>{{ antl.formatMessage('messages.footer2p1') }} <a href="https://github.com/rg3/youtube-dl/">youtube-dl</a> - {{ antl.formatMessage('messages.footer2p2') }} <a href="https://discordapp.com/oauth2/authorize?client_id=377563711927484418&scope=bot&permissions=0">Haha yes</a> - {{ antl.formatMessage('messages.footer2p3') }}: {{ viewCounter }} - {{ antl.formatMessage('messages.footer2p4') }} <a href="https://discord.gg/cNRh5JQ">Supositware#1616</a> {{ antl.formatMessage('messages.footer2p5') }}</p></bdi>
|
||||
@else
|
||||
<p>{{ antl.formatMessage('messages.footer2p1') }} <a href="https://github.com/rg3/youtube-dl/">youtube-dl</a> - {{ antl.formatMessage('messages.footer2p2') }} <a href="https://discordapp.com/oauth2/authorize?client_id=377563711927484418&scope=bot&permissions=0">Haha yes</a> - {{ antl.formatMessage('messages.footer2p3') }}: {{ viewCounter }} - {{ antl.formatMessage('messages.footer2p4') }} <a href="https://discord.gg/cNRh5JQ">Supositware#1616</a> {{ antl.formatMessage('messages.footer2p5') }}</p>
|
||||
@endif
|
||||
<p><a href="/">Return to main page</a></p>
|
||||
</footer>
|
||||
@if(month == '11')
|
||||
<script src="JS/snow.js"></script>
|
||||
@endif
|
||||
<script>
|
||||
// If alt download block other settings since they don't work anyway
|
||||
document.getElementById('alt').onclick = function() {
|
||||
if(document.getElementById('alt').checked) {
|
||||
document.getElementById('small').disabled = true;
|
||||
document.getElementById('small').checked = false;
|
||||
|
||||
document.getElementById('mp3').disabled = true;
|
||||
document.getElementById('mp3').checked = false;
|
||||
document.getElementById('flac').disabled = true;
|
||||
document.getElementById('flac').checked = false;
|
||||
document.getElementById('mp4').checked = true;
|
||||
document.getElementById('high').checked = true;
|
||||
document.getElementById('feed').checked = false;
|
||||
document.getElementById('feed').disabled = true;
|
||||
} else {
|
||||
document.getElementById('small').disabled = false;
|
||||
document.getElementById('feed').disabled = false;
|
||||
document.getElementById('mp3').disabled = false;
|
||||
document.getElementById('flac').disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function submitDownload() {
|
||||
console.log('clicked')
|
||||
let frm = document.getElementsByName('download-form')[0];
|
||||
frm.submit();
|
||||
document.getElementById('msg').innerHTML = '{{ antl.formatMessage('messages.dlStart') }}'
|
||||
frm.reset();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
</html>
|
366
routes/index.js
Normal file
366
routes/index.js
Normal file
|
@ -0,0 +1,366 @@
|
|||
var express = require('express');
|
||||
var router = express.Router();
|
||||
|
||||
const youtubedl = require('youtube-dl');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const ffmpeg = require('fluent-ffmpeg');
|
||||
const formidable = require('formidable');
|
||||
const { version } = require('../package.json');
|
||||
const proxy = require('../proxy/proxy.json');
|
||||
|
||||
let progress = {};
|
||||
let viewCounter = 0;
|
||||
let files = [];
|
||||
let day;
|
||||
let month;
|
||||
let announcementArray = [];
|
||||
let announcement;
|
||||
|
||||
function formatBytes(bytes, decimals = 2) { // https://stackoverflow.com/a/18650828
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
/* GET home page. */
|
||||
router.get('/', function(req, res, next) {
|
||||
viewCounter++;
|
||||
|
||||
files = [];
|
||||
let file = [];
|
||||
for (let f of fs.readdirSync('./public/uploads')) {
|
||||
if (f.endsWith('.mp4') || f.endsWith('.webm') || f.endsWith('.mp3') || f.endsWith('.flac'))
|
||||
file.push(f)
|
||||
}
|
||||
// get the 5 most recent files
|
||||
file = file.sort((a, b) => {
|
||||
if ((a || b).endsWith('.mp4') || (a || b).endsWith('.webm') || (a || b).endsWith('.mp3') || (a || b).endsWith('.flac')) {
|
||||
let time1 = fs.statSync(`./public/uploads/${b}`).ctime;
|
||||
let time2 = fs.statSync(`./public/uploads/${a}`).ctime;
|
||||
if (time1 < time2) return -1;
|
||||
if (time1 > time2) return 1;
|
||||
}
|
||||
return 0;
|
||||
}).slice(0, 5)
|
||||
|
||||
// Save space by deleting file that doesn't appear in the recent feed
|
||||
for (let f of fs.readdirSync('./public/uploads')) {
|
||||
if (!file.includes(f) && (f != 'hidden' && f != '.keep')) {
|
||||
if (fs.existsSync(`./public/uploads/${f}`))
|
||||
fs.unlinkSync(`./public/uploads/${f}`);
|
||||
|
||||
if (fs.existsSync(`./public/thumbnail/${f}`))
|
||||
fs.unlinkSync(`./public/thumbnail/${f}`);
|
||||
|
||||
if (fs.existsSync(`./public/thumbnail/${f}.png`))
|
||||
fs.unlinkSync(`./public/thumbnail/${f}.png`);
|
||||
}
|
||||
}
|
||||
|
||||
for (let f of file) {
|
||||
let fileInfo = formatBytes(fs.statSync(`./public/uploads/${f}`).size).split(' ');
|
||||
let defaultFiles = { name: f.replace(path.extname(f), ''), size: fileInfo[0], unit: fileInfo[1], date: fs.statSync(`./public/uploads/${f}`).ctime, location: `uploads/${f}`, ext: path.extname(f), thumbnail: `/thumbnail/${f}`, img: `/thumbnail/${f.replace(path.extname(f), '.png')}` };
|
||||
|
||||
if (f.endsWith('.mp3') || f.endsWith('.flac')) {
|
||||
defaultFiles.thumbnail = `./thumbnail/${f.replace(path.extname(f), '.png')}`
|
||||
}
|
||||
files.push(defaultFiles);
|
||||
}
|
||||
|
||||
res.render('index', { version: version, files: files, viewCounter: viewCounter, proxy: proxy });
|
||||
});
|
||||
|
||||
router.get('/status/:uuid', function (req, res ,next) {
|
||||
let uuid = req.params.uuid;
|
||||
if (progress[uuid]) {
|
||||
return res.send(progress[uuid]);
|
||||
} else {
|
||||
return res.send(undefined);
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/format', function (req, res ,next) {
|
||||
let url;
|
||||
try {
|
||||
url = new URL(req.query.url);
|
||||
} catch (e) {
|
||||
return res.send(undefined);
|
||||
}
|
||||
|
||||
let formats = [];
|
||||
|
||||
youtubedl.exec(url.href, ['--dump-json'], {}, function(err, output) {
|
||||
if (err) throw err
|
||||
let json = JSON.parse(output);
|
||||
console.log(req.query.advanced);
|
||||
json.formats.forEach(format => {
|
||||
if (req.query.advanced === 'false' && (format.vcodec === 'none' || format.acodec === 'none'))
|
||||
return;
|
||||
|
||||
let note = `${format.width}x${format.height}`;
|
||||
|
||||
if (req.query.advanced === 'true') {
|
||||
note = format.format
|
||||
}
|
||||
|
||||
formats.push({ext: format.ext, id: format.format_id, note: note});
|
||||
});
|
||||
|
||||
return res.send(formats);
|
||||
});
|
||||
});
|
||||
|
||||
router.post('/', async function(req, res, next) {
|
||||
let data;
|
||||
const form = formidable({ multiples: true});
|
||||
|
||||
data = await new Promise(function(resolve, reject) {
|
||||
form.parse(req, function(err, fields, files) {
|
||||
if (err) {
|
||||
reject(err)
|
||||
}
|
||||
resolve({...fields})
|
||||
})
|
||||
});
|
||||
|
||||
if (data.url === undefined) {
|
||||
//res.render('index', { error: true, errormsg: 'You didn\'t input a link'})
|
||||
return res.send('You didn\'t input a link')
|
||||
}
|
||||
|
||||
console.log(data.format);
|
||||
|
||||
let format = data.format;
|
||||
|
||||
if (data.format === undefined || data.format === 'mp3' || data.format === 'flac') {
|
||||
format = 'best';
|
||||
}
|
||||
|
||||
if (data.url.toLowerCase().includes('porn')) {
|
||||
data.feed = 'on';
|
||||
}
|
||||
|
||||
let videoID;
|
||||
if (data.sponsorBlock) {
|
||||
let regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/;
|
||||
let match = data.url.match(regExp);
|
||||
videoID = (match&&match[7].length==11)? match[7] : false;
|
||||
if (!videoID) {
|
||||
return res.json({error: 'To use sponsorBlock you need a valid youtube link!'});
|
||||
//res.render('index', { error: true, errormsg: 'To use sponsorBlock you need a valid youtube link!'})
|
||||
}
|
||||
}
|
||||
|
||||
let options = ['-f', format];
|
||||
if (data.proxy !== 'none') {
|
||||
options.push('--proxy');
|
||||
options.push(data.proxy);
|
||||
}
|
||||
|
||||
console.log(options);
|
||||
|
||||
let video = youtubedl(data.url, options);
|
||||
|
||||
video.on('error', function(err) {
|
||||
console.error(err);
|
||||
progress[data.uuid] = 0;
|
||||
res.json({ error: err.stderr});
|
||||
});
|
||||
|
||||
let ext;
|
||||
let size = 0;
|
||||
video.on('info', function(info) {
|
||||
size = info.size;
|
||||
if (size / 1000000.0 > 10000) return res.json({error: 'Sorry, but I don\'t have enough storage to store something this big.'});
|
||||
// Set file name
|
||||
ext = info.ext;
|
||||
let title = info.title.slice(0,50);
|
||||
DLFile = `${title.replace(/\s/g, '')}.${ext}`;
|
||||
DLFile = DLFile.replace(/[()]|[/]|[\\]|[!]|[?]/g, '');
|
||||
DLFile = DLFile.replace(',', '');
|
||||
|
||||
// If no title use the ID
|
||||
if (title === '_') title = `_${info.id}`;
|
||||
// If user want to hide from the feed
|
||||
if (data.feed === 'on')
|
||||
DLFile = `hidden/${title}.${ext}`;
|
||||
|
||||
if (data.sponsorBlock) video.pipe(fs.createWriteStream(`./public/uploads/hidden/${DLFile}`));
|
||||
else video.pipe(fs.createWriteStream(`./public/uploads/${DLFile}`));
|
||||
});
|
||||
|
||||
let pos = 0
|
||||
video.on('data', (chunk) => {
|
||||
pos += chunk.length
|
||||
// `size` should not be 0 here.
|
||||
if (size) {
|
||||
let percent = (pos / size * 100).toFixed(2)
|
||||
progress[data.uuid] = percent;
|
||||
}
|
||||
})
|
||||
|
||||
video.on('end', function() {
|
||||
progress[data.uuid] = 0;
|
||||
|
||||
if (data.format === 'mp3' || data.format === 'flac') {
|
||||
// If user requested an audio format, convert it
|
||||
ffmpeg(`./public/uploads/${DLFile}`)
|
||||
.noVideo()
|
||||
.audioChannels('2')
|
||||
.audioFrequency('44100')
|
||||
.audioBitrate('320k')
|
||||
.format(data.format)
|
||||
.save(`./public/uploads/${DLFile.replace(`.${ext}`, `.${data.format}`)}`)
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
console.log('Cannot process video: ' + err.message);
|
||||
return res.json({error: err.message});
|
||||
//return res.render('index', { error: true, errormsg: err.message})
|
||||
})
|
||||
.on('end', () => {
|
||||
fs.unlinkSync(`./public/uploads/${DLFile}`);
|
||||
if (data.feed !== 'on') generateWaveform(DLFile.replace(`.${ext}`, `.${data.format}`));
|
||||
return res.json({url: `uploads/${DLFile.replace(`.${ext}`, `.${data.format}`)}`});
|
||||
//return res.attachment(`./public/uploads/${DLFile.replace(`.${ext}`, `.${data.format}`)}`);
|
||||
});
|
||||
} else {
|
||||
if (data.sponsorBlock) { // WARNING: THIS PART SUCK
|
||||
let filter = '';
|
||||
let abc = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
|
||||
fetch(`https://sponsor.ajay.app/api/skipSegments?videoID=${videoID}`)
|
||||
.then(res => {
|
||||
if (res.status === 404) {
|
||||
return res.json({error: 'Couldn\'t find any SponsorBlock data for this video.'});
|
||||
//return this.res.render('index', { error: true, errormsg: 'Couldn\'t find any SponsorBlock data for this video.'})
|
||||
}
|
||||
return res.json();
|
||||
})
|
||||
.then(json => {
|
||||
if (json === undefined) return;
|
||||
let i = 0;
|
||||
let previousEnd;
|
||||
let usedLetter = [];
|
||||
json.forEach(sponsor => {
|
||||
usedLetter.push(abc[i]);
|
||||
if (i === 0) {
|
||||
filter += `[0:v]trim=start=0:end=${sponsor.segment[0]},setpts=PTS-STARTPTS[${abc[i]}v];`;
|
||||
filter += `[0:a]atrim=start=0:end=${sponsor.segment[0]},asetpts=PTS-STARTPTS[${abc[i]}a];`;
|
||||
} else {
|
||||
filter += `[0:v]trim=start=${previousEnd}:end=${sponsor.segment[0]},setpts=PTS-STARTPTS[${abc[i]}v];`;
|
||||
filter += `[0:a]atrim=start=${previousEnd}:end=${sponsor.segment[0]},asetpts=PTS-STARTPTS[${abc[i]}a];`;
|
||||
}
|
||||
previousEnd = sponsor.segment[1];
|
||||
i++;
|
||||
});
|
||||
usedLetter.push(abc[i]);
|
||||
filter += `[0:v]trim=start=${previousEnd},setpts=PTS-STARTPTS[${abc[i]}v];`;
|
||||
filter += `[0:a]atrim=start=${previousEnd},asetpts=PTS-STARTPTS[${abc[i]}a];`;
|
||||
let video = '';
|
||||
let audio = '';
|
||||
usedLetter.forEach(letter => {
|
||||
video += `[${letter}v]`
|
||||
audio += `[${letter}a]`
|
||||
});
|
||||
filter += `${video}concat=n=${i + 1}[outv];`;
|
||||
filter += `${audio}concat=n=${i + 1}:v=0:a=1[outa]`;
|
||||
|
||||
ffmpeg(`./public/uploads/hidden/${DLFile}`)
|
||||
.inputFormat('mp4')
|
||||
.complexFilter(filter)
|
||||
.outputOptions('-map [outv]')
|
||||
.outputOptions('-map [outa]')
|
||||
.save(`./public/uploads/${DLFile}`)
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
console.log('Cannot process video: ' + err.message);
|
||||
return res.json({error: err.message});
|
||||
//return res.render('index', { error: true, errormsg: err.message})
|
||||
})
|
||||
.on('end', () => {
|
||||
console.log('end');
|
||||
//res.attachment(`./public/uploads/${DLFile}`)
|
||||
res.json({url: `uploads/${DLFile}`})
|
||||
if (data.feed !== 'on') generateThumbnail(DLFile);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// If user requested mp4 directly attach the file
|
||||
res.json({url: `uploads/${DLFile}`})
|
||||
if (data.feed !== 'on') generateThumbnail(DLFile);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function uuidv4() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
||||
async function generateWaveform(f) {
|
||||
ffmpeg(`./public/uploads/${f}`)
|
||||
.complexFilter('[0:a]aformat=channel_layouts=mono,compand=gain=-6,showwavespic=s=600x120:colors=#9cf42f[fg];color=s=600x120:color=#44582c,drawgrid=width=iw/10:height=ih/5:color=#9cf42f@0.1[bg];[bg][fg]overlay=format=rgb,drawbox=x=(iw-w)/2:y=(ih-h)/2:w=iw:h=1:color=#9cf42f')
|
||||
.frames(1)
|
||||
.noVideo()
|
||||
.noAudio()
|
||||
.duration(0.1)
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
return console.log('Cannot process video: ' + err.message);
|
||||
})
|
||||
.on('end', () => {
|
||||
generateThumbnail(`../thumbnail/${f.replace(path.extname(f), '.mp4')}`);
|
||||
})
|
||||
.save(`./public/thumbnail/${f.replace(path.extname(f), '.mp4')}`);
|
||||
}
|
||||
|
||||
async function generateThumbnail(f) {
|
||||
ffmpeg(`./public/uploads/${f}`)
|
||||
.screenshots({
|
||||
timestamps: ['20%'],
|
||||
size: '720x480',
|
||||
folder: './public/thumbnail/',
|
||||
filename: f.replace(path.extname(f), '.png')
|
||||
})
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
return console.log('Cannot process video: ' + err.message);
|
||||
});
|
||||
|
||||
if (!fs.existsSync(`./public/thumbnail/tmp/${f}`) && !f.startsWith('../thumbnail'))
|
||||
fs.mkdirSync(`./public/thumbnail/tmp/${f}`)
|
||||
|
||||
ffmpeg(`./public/uploads/${f}`)
|
||||
.complexFilter('select=gt(scene\\,0.8)')
|
||||
.frames(10)
|
||||
.complexFilter('fps=fps=1/10')
|
||||
.save(`./public/thumbnail/tmp/${f}/%03d.png`)
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
return console.log('Cannot process video: ' + err.message);
|
||||
})
|
||||
.on('end', () => {
|
||||
ffmpeg(`./public/thumbnail/tmp/${f}/%03d.png`)
|
||||
.complexFilter('zoompan=d=(.5+.5)/.5:s=640x480:fps=1/.5,framerate=25:interp_start=0:interp_end=255:scene=100')
|
||||
.format('mp4')
|
||||
.save(`./public/thumbnail/${f}`)
|
||||
.on('error', function(err, stdout, stderr) {
|
||||
return console.log('Cannot process video: ' + err.message);
|
||||
})
|
||||
.on('end', () => {
|
||||
// Save space by deleting tmp directory
|
||||
for (let files of fs.readdirSync(`./public/thumbnail/tmp/${f}`)) {
|
||||
if (files == '.keep') return;
|
||||
fs.unlinkSync(`./public/thumbnail/tmp/${f}/${files}`);
|
||||
}
|
||||
fs.rmdirSync(`./public/thumbnail/tmp/${f}`);
|
||||
});
|
||||
});
|
||||
}
|
24
server.js
24
server.js
|
@ -1,24 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Http server
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This file bootstrap Adonisjs to start the HTTP server. You are free to
|
||||
| customize the process of booting the http server.
|
||||
|
|
||||
| """ Loading ace commands """
|
||||
| At times you may want to load ace commands when starting the HTTP server.
|
||||
| Same can be done by chaining `loadCommands()` method after
|
||||
|
|
||||
| """ Preloading files """
|
||||
| Also you can preload files by calling `preLoad('path/to/file')` method.
|
||||
| Make sure to pass relative path from the project root.
|
||||
*/
|
||||
|
||||
const { Ignitor } = require('@adonisjs/ignitor')
|
||||
new Ignitor(require('@adonisjs/fold'))
|
||||
.appRoot(__dirname)
|
||||
.fireHttpServer()
|
||||
.catch(console.error)
|
63
start/app.js
63
start/app.js
|
@ -1,63 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Providers are building blocks for your Adonis app. Anytime you install
|
||||
| a new Adonis specific package, chances are you will register the
|
||||
| provider here.
|
||||
|
|
||||
*/
|
||||
const providers = [
|
||||
'@adonisjs/framework/providers/AppProvider',
|
||||
'@adonisjs/framework/providers/ViewProvider',
|
||||
'@adonisjs/lucid/providers/LucidProvider',
|
||||
'@adonisjs/bodyparser/providers/BodyParserProvider',
|
||||
'@adonisjs/cors/providers/CorsProvider',
|
||||
'@adonisjs/shield/providers/ShieldProvider',
|
||||
'@adonisjs/session/providers/SessionProvider',
|
||||
'@adonisjs/auth/providers/AuthProvider',
|
||||
'@adonisjs/validator/providers/ValidatorProvider',
|
||||
'@adonisjs/antl/providers/AntlProvider',
|
||||
]
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ace Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Ace providers are required only when running ace commands. For example
|
||||
| Providers for migrations, tests etc.
|
||||
|
|
||||
*/
|
||||
const aceProviders = [
|
||||
'@adonisjs/lucid/providers/MigrationsProvider'
|
||||
]
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Aliases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Aliases are short unique names for IoC container bindings. You are free
|
||||
| to create your own aliases.
|
||||
|
|
||||
| For example:
|
||||
| { Route: 'Adonis/Src/Route' }
|
||||
|
|
||||
*/
|
||||
const aliases = {}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Commands
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you store ace commands for your package
|
||||
|
|
||||
*/
|
||||
const commands = []
|
||||
|
||||
module.exports = { providers, aceProviders, aliases, commands }
|
|
@ -1,62 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/** @type {import('@adonisjs/framework/src/Server')} */
|
||||
const Server = use('Server')
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Global middleware are executed on each http request only when the routes
|
||||
| match.
|
||||
|
|
||||
*/
|
||||
const globalMiddleware = [
|
||||
'Adonis/Middleware/BodyParser',
|
||||
'Adonis/Middleware/Session',
|
||||
'Adonis/Middleware/Shield',
|
||||
'Adonis/Middleware/AuthInit',
|
||||
]
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Named Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Named middleware is key/value object to conditionally add middleware on
|
||||
| specific routes or group of routes.
|
||||
|
|
||||
| // define
|
||||
| {
|
||||
| auth: 'Adonis/Middleware/Auth'
|
||||
| }
|
||||
|
|
||||
| // use
|
||||
| Route.get().middleware('auth')
|
||||
|
|
||||
*/
|
||||
const namedMiddleware = {
|
||||
auth: 'Adonis/Middleware/Auth',
|
||||
guest: 'Adonis/Middleware/AllowGuestOnly'
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Server Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Server level middleware are executed even when route for a given URL is
|
||||
| not registered. Features like `static assets` and `cors` needs better
|
||||
| control over request lifecycle.
|
||||
|
|
||||
*/
|
||||
const serverMiddleware = [
|
||||
'Adonis/Middleware/Static',
|
||||
'Adonis/Middleware/Cors'
|
||||
]
|
||||
|
||||
Server
|
||||
.registerGlobal(globalMiddleware)
|
||||
.registerNamed(namedMiddleware)
|
||||
.use(serverMiddleware)
|
|
@ -1,20 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Http routes are entry points to your web application. You can create
|
||||
| routes for different URL's and bind Controller actions to them.
|
||||
|
|
||||
| A complete guide on routing is available here.
|
||||
| http://adonisjs.com/docs/4.1/routing
|
||||
|
|
||||
*/
|
||||
|
||||
/** @type {typeof import('@adonisjs/framework/src/Route/Manager')} */
|
||||
const Route = use('Route')
|
||||
|
||||
Route.get('/:legacy?', 'DownloadController.index')
|
||||
Route.post('/:legacy?', 'DownloadController.download')
|
35
views/error.ejs
Normal file
35
views/error.ejs
Normal file
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="has-background-grey-dark" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="<%= error.status%>" />
|
||||
<meta property="og:description" content="A simple video downloader without any ad or tracking." />
|
||||
<meta property="og:url" content="https://namejeff.xyz/" />
|
||||
<meta property="og:image" content="https://namejeff.xyz/asset/jeff.png" />
|
||||
<meta name="theme-color" content="#3b2ccf" />
|
||||
<link rel="icon" href="/asset/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="asset/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="stylesheets/index.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css">
|
||||
<title><%= error.status%></title>
|
||||
</head>
|
||||
<body class="has-text-light gradientBG">
|
||||
<section class="section has-text-centered">
|
||||
<div class="container">
|
||||
<img src="https://http.cat/<%= error.status %>">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer class="footer has-background-grey-dark has-text-light has-text-centered">
|
||||
<p>Uses SponsorBlock API from <a href="https://sponsor.ajay.app/">https://sponsor.ajay.app/</a></p>
|
||||
<p>I don't take any accountability for downloads made using this website.</p>
|
||||
<p>Credit to <a href="https://github.com/rg3/youtube-dl/">youtube-dl</a> - My other projects <a href="https://discordapp.com/oauth2/authorize?client_id=377563711927484418&scope=bot&permissions=0">Haha yes</a> & <a href="https://twitter.com/YTPB5k">YTP twitter bot</a> - Contact <a href="https://discord.gg/cNRh5JQ">Supositware#1616</a> on Discord if you have any issues</p>
|
||||
<p>You can also support me either on <a href="https://www.paypal.me/supositware">Paypal</a> Or by tipping <a href="https://basicattentiontoken.org/">BAT</a> on this website!</p>
|
||||
<p><a href="https://git.namejeff.xyz/Supositware/jeff-downloader">Source code</a></p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
296
views/index.ejs
Normal file
296
views/index.ejs
Normal file
|
@ -0,0 +1,296 @@
|
|||
<!--
|
||||
What are you doing here 😳😳😳😳
|
||||
I guess have fun looking at the html, no easter egg to find here.
|
||||
Come take a look here https://git.namejeff.xyz/Supositware/jeff-downloader for all my bad coding
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<html class="has-background-grey-dark" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="Le epic video downloader v<%= version %>" />
|
||||
<meta property="og:description" content="A simple video downloader without any ad or tracking." />
|
||||
<meta property="og:url" content="https://namejeff.xyz/" />
|
||||
<meta property="og:image" content="https://namejeff.xyz/asset/jeff.png" />
|
||||
<meta name="theme-color" content="#3b2ccf" />
|
||||
<link rel="icon" href="/asset/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="asset/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="stylesheets/index.css">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheets/background.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css">
|
||||
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
|
||||
<title>Le epic video downloader v<%= version %></title>
|
||||
</head>
|
||||
<body class="has-text-light gradientBG">
|
||||
<section class="section has-text-centered">
|
||||
<div class="container">
|
||||
<h1 class="title has-text-light">Le epic downloader v<%= version %></h1>
|
||||
<div class="downloader form">
|
||||
<form id="download-form" method="POST" action="/" enctype="application/x-www-form-urlencoded">
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-body">
|
||||
<div class="field is-horizontal">
|
||||
<div class="control">
|
||||
<label class="checkbox" for="feed">
|
||||
<input class="checkbox" type="checkbox" name="feed" id="feed" title="Use this if you don't want the video you are downloading to be public">
|
||||
Hide from feed
|
||||
</label>
|
||||
|
||||
<label class="checkbox" for="sponsorBlock">
|
||||
<input class="checkbox" type="checkbox" name="sponsorBlock" id="sponsorBlock" title="(Using sponsor.ajay.app)">
|
||||
(W.I.P) Remove sponsors of video using <a href="https://sponsor.ajay.app/">SponsorBlock</a>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-body">
|
||||
<div class="field is-expanded">
|
||||
<div class="field has-addons">
|
||||
<p class="control is-expanded">
|
||||
<input type="text" id="url" name="url" class="downloadurl input is-rounded" placeholder="Link" onkeyup="CheckFormat()">
|
||||
</p>
|
||||
<p class="control">
|
||||
<button type="submit" class="downloadbtn button is-primary is-rounded" id="button">Download that mf video</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="select">
|
||||
<select name="format" id="format">
|
||||
<option value="mp4">MP4</option>
|
||||
<option value="mp3">MP3</option>
|
||||
<option value="flac">FLAC</option>
|
||||
</select>
|
||||
|
||||
<label for="advanced" class="checkbox">
|
||||
<input class="checkbox" type="checkbox" name="advanced" id="advanced" title="Advanced" onclick="CheckFormat()">
|
||||
Advanced (Prone to errors!)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="field is-horizontal level">
|
||||
<div class="field-body">
|
||||
<div class="field is-horizontal">
|
||||
<div class="control">
|
||||
<span>Proxy options:</span>
|
||||
<label class="radio" for="none">
|
||||
<input class="radio" type="radio" name="proxy" value="none" id="none" checked>
|
||||
None
|
||||
</label>
|
||||
<% proxy.forEach(function(proxy){ %>
|
||||
<label class="radio" for="<%= proxy.ip %>">
|
||||
<input class="radio" type="radio" name="proxy" value="<%= proxy.ip %>" id="<%= proxy.ip %>">
|
||||
<%= proxy.ip.substring(0, proxy.ip.length - 5) %> - <%= proxy.country %>
|
||||
</label>
|
||||
<% }) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="container" id="progress"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<% if (files != "") {%>
|
||||
<p class="title has-text-light has-text-centered">Recently downloaded videos</p>
|
||||
<section class="section">
|
||||
<div class="columns is-vcentered is-multiline fadein">
|
||||
<% files.forEach(function(file){ %>
|
||||
<div class="column hvr-grow">
|
||||
<div class="column box notification is-dark level">
|
||||
<p class="subtitle"><%= file.name %></p>
|
||||
<div>
|
||||
<figure class="is-4by3">
|
||||
<video muted loop onmouseover="this.play();" onmouseout="this.pause();this.currentTime = 0;" oncanplay="this.muted=true;" poster="<%= file.img %>" preload="metadata">
|
||||
<source src="/thumbnail/<%= file.name %>.mp4#t=0.5" >
|
||||
<img src="<%= file.img %>" title="Your browser does not support the <video> tag">
|
||||
</video>
|
||||
</figure>
|
||||
</div>
|
||||
<br>
|
||||
<div class="content">
|
||||
<div class="field has-addons is-centered">
|
||||
<p class="control">
|
||||
<a class="button is-link is-rounded" href="<%= file.location %>" download>Download<i class="fas fa-fw fa-file-download" aria-hidden="true"></i></a>
|
||||
</p>
|
||||
<p class="control">
|
||||
<button class="button is-link is-rounded" onclick="toClipboard('https:\/\/namejeff.xyz\/{{ file.location }}')">Copy to clipboard<i class="fas fa-fw fa-clipboard" aria-hidden="true"></i></button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<div class="tags has-addons">
|
||||
<span class="tag">File format</span>
|
||||
<span class="tag is-primary"><%= file.ext %></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control">
|
||||
<div class="tags has-addons">
|
||||
<span class="tag">File size</span>
|
||||
<span class="tag is-primary"><%= file.size%> <%= file.unit %></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control">
|
||||
<div class="tags has-addons">
|
||||
<span class="tag">Download date</span>
|
||||
<span class="tag is-primary"><%= file.date.toLocaleString() %></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% }) %>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
<% } %>
|
||||
<footer class="footer has-background-grey-dark has-text-light has-text-centered">
|
||||
<p>Uses SponsorBlock API from <a href="https://sponsor.ajay.app/">https://sponsor.ajay.app/</a></p>
|
||||
<p>I don't take any accountability for downloads made using this website.</p>
|
||||
<p>Credit to <a href="https://github.com/rg3/youtube-dl/">youtube-dl</a> - My other projects <a href="https://discordapp.com/oauth2/authorize?client_id=377563711927484418&scope=bot&permissions=0">Haha yes</a> & <a href="https://twitter.com/YTPB5k">YTP twitter bot</a> - Numbers of visits: <%= viewCounter %> - Contact <a href="https://discord.gg/cNRh5JQ">Supositware#1616</a> on Discord if you have any issues</p>
|
||||
<p>You can also support me either on <a href="https://www.paypal.me/supositware">Paypal</a> Or by tipping <a href="https://basicattentiontoken.org/">BAT</a> on this website!</p>
|
||||
<p><a href="https://git.namejeff.xyz/Supositware/jeff-downloader">Source code</a></p>
|
||||
</footer>
|
||||
</body>
|
||||
<script>
|
||||
let uuid = uuidv4();
|
||||
console.log(uuid);
|
||||
let form = document.getElementById('download-form');
|
||||
form.addEventListener("submit", function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
submitDownload();
|
||||
});
|
||||
|
||||
function submitDownload() {
|
||||
document.getElementById('progress').innerHTML = '<progress class="progress is-success" id="progress-bar" max="100">0%</progress>';
|
||||
let frm = new FormData(form);
|
||||
frm.append('uuid', uuid);
|
||||
let xhttp = new XMLHttpRequest();
|
||||
|
||||
let progress = setInterval(() => {
|
||||
CheckProgress();
|
||||
}, 2000);
|
||||
|
||||
xhttp.addEventListener("load", function(event) {
|
||||
const json = JSON.parse(event.target.responseText);
|
||||
console.log(json);
|
||||
if (json.error) {
|
||||
clearInterval(progress);
|
||||
document.getElementById('progress').innerHTML = '';
|
||||
alert(json.error);
|
||||
} else {
|
||||
const url = json.url;
|
||||
|
||||
let a = document.createElement("a");
|
||||
a.href = url;
|
||||
fileName = url.split("/").pop();
|
||||
a.download = fileName;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
a.remove();
|
||||
|
||||
}
|
||||
|
||||
clearInterval(progress);
|
||||
setTimeout(() => {
|
||||
document.getElementById('progress').innerHTML = '';
|
||||
}, 500)
|
||||
});
|
||||
|
||||
xhttp.addEventListener("error", function(event) {
|
||||
clearInterval(progress);
|
||||
document.getElementById('progress').innerHTML = '';
|
||||
alert('whoops, something gone wrong');
|
||||
});
|
||||
|
||||
xhttp.open("POST", "/", true);
|
||||
xhttp.send(frm);
|
||||
}
|
||||
|
||||
function CheckProgress() {
|
||||
let xhttp = new XMLHttpRequest();
|
||||
xhttp.open("GET", `/status/${uuid}?=${Math.random()}`, true);
|
||||
xhttp.send();
|
||||
xhttp.addEventListener("load", function(event) {
|
||||
console.log(event.target.responseText);
|
||||
if (event.target.responseText === '') return;
|
||||
document.getElementsByTagName("progress")[0].value = event.target.responseText;
|
||||
document.getElementsByTagName("progress")[0].innerHTML = `${event.target.responseText}%`;
|
||||
});
|
||||
|
||||
xhttp.addEventListener("error", function(event) {
|
||||
clearInterval(progress);
|
||||
document.getElementById('progress').innerHTML = '';
|
||||
alert('whoops, something gone wrong');
|
||||
console.error(event.target.responseText);
|
||||
});
|
||||
}
|
||||
|
||||
function CheckFormat() {
|
||||
let url;
|
||||
try {
|
||||
url = new URL(document.getElementById("url").value);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementsByClassName("select")[0].className = "select is-loading";
|
||||
|
||||
console.log(encodeURI(url.href));
|
||||
let xhttp = new XMLHttpRequest();
|
||||
xhttp.open("get", `/format?url=${url.href}&advanced=${document.getElementById("advanced").checked}`, true);
|
||||
xhttp.send();
|
||||
xhttp.addEventListener("load", function(event) {
|
||||
console.log(event.target.responseText);
|
||||
|
||||
let html = [];
|
||||
|
||||
let json = JSON.parse(event.target.responseText);
|
||||
json.forEach(format => {
|
||||
html.push(`<option value="${format.id}">${format.ext} - ${format.note}</option>`);
|
||||
});
|
||||
|
||||
html.reverse();
|
||||
html.push('<option value="mp3">MP3</option>');
|
||||
html.push('<option value="flac">FLAC</option>');
|
||||
|
||||
document.getElementById("format").innerHTML = html;
|
||||
document.getElementsByClassName("select")[0].className = "select";
|
||||
});
|
||||
|
||||
xhttp.addEventListener("error", function(event) {
|
||||
console.error(event.target.responseText);
|
||||
});
|
||||
}
|
||||
|
||||
function toClipboard(text) {
|
||||
if (navigator.clipboard)
|
||||
navigator.clipboard.writeText(text)
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
});
|
||||
else
|
||||
console.error('Could not access the clipboard.');
|
||||
}
|
||||
|
||||
function uuidv4() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
console.log('%cWhat are you doing here 😳😳😳😳', 'font-size: 40px;');
|
||||
</script>
|
||||
</html>
|
Loading…
Reference in a new issue