Add files from main branch to new-branch
3
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
github:
|
||||
custom: https://sponsor.fanmingming.com
|
||||
11
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
name: 问题反馈
|
||||
about: 遇到缺失或模糊不清有错误的频道logo请通过这里提交反馈,我们将尽快补齐或修复。
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees:
|
||||
|
||||
---
|
||||
|
||||
## 遇到的问题
|
||||
请在此描述您遇到的问题。
|
||||
11
.github/ISSUE_TEMPLATE/wish.md
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
name: 意见建议
|
||||
about: 您希望我们怎么做好这个项目,或对项目有任何意见和建议请在此提交。
|
||||
title: ''
|
||||
labels: wish
|
||||
assignees:
|
||||
|
||||
---
|
||||
|
||||
## 意见建议
|
||||
请在此提出您的意见或建议。
|
||||
22
.github/workflows/epg.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: EPG Update
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
- cron: '15 16,18,20,22,0,2,4,6,8,10,12,14 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Update EPG Files
|
||||
run: |
|
||||
rm -f e.xml && wget https://epg.112114.xyz/pp.xml -O e.xml
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add e.xml
|
||||
git commit -m "EPG Automatic Update."
|
||||
- name: Push changes
|
||||
run: git push origin main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
43
.github/workflows/n.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Create New Branch Without Commit History
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
create-branch:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Check out the repository code
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Configure git user
|
||||
- name: Configure git user
|
||||
run: |
|
||||
git config --global user.name "GitHub Actions"
|
||||
git config --global user.email "actions@github.com"
|
||||
|
||||
# Create a new orphan branch
|
||||
- name: Create orphan branch
|
||||
run: |
|
||||
git checkout --orphan new-branch # 创建没有历史记录的分支
|
||||
git rm -rf . # 删除当前工作目录中的所有文件
|
||||
|
||||
# Checkout files from main branch and add them to the new branch
|
||||
- name: Checkout files from main branch
|
||||
run: |
|
||||
git checkout main -- . # 从main分支获取文件
|
||||
git add . # 添加所有文件到暂存区
|
||||
|
||||
# Commit the changes
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git commit -m "Add files from main branch to new-branch"
|
||||
|
||||
# Push the new branch to remote repository
|
||||
- name: Push new branch
|
||||
run: |
|
||||
git push origin new-branch
|
||||
4
404.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<!DOCTYPE html><html><head>
|
||||
<title>404</title><link href="//fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type=text/css><style> html, body { height: 100%; } body { margin: 0; padding: 0; width: 100%; color: #B0BEC5; display: table; font-weight: 100; font-family: 'Lato'; } .container { text-align: center; display: table-cell; vertical-align: middle; } .content { text-align: center; display: inline-block; } .title { font-size: 72px; margin-bottom: 40px; } </style>
|
||||
<style></style>
|
||||
</head><body><div class="container"><div class="content"><div class="title">404 Not Found.</div></div></div></body></html>
|
||||
674
LICENSE
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is 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. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
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.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
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 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. Use with the GNU Affero General Public License.
|
||||
|
||||
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 Affero 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 special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU 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 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 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 General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 2023 fanmingming
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
fanmingming/live Copyright (C) 2023 fanmingming
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
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 GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
76
README.md
Normal file
@@ -0,0 +1,76 @@
|
||||
<p align="center"><img alt="live.fanmingming.com" src="https://live.fanmingming.com/logo.png"></p>
|
||||
<h1 align="center"> ✯ 一个可直连访问的电视/广播图标库与相关工具项目 ✯ </h1>
|
||||
<h3 align="center">🔕 永久免费 直连访问 完整开源 不断完善的台标 支持IPv4/IPv6双栈访问 🔕</h3>
|
||||
|
||||
<p align="center">
|
||||
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/fanmingming/live?style=flat-square">
|
||||
<img alt="GitHub forks" src="https://img.shields.io/github/forks/fanmingming/live?style=flat-square">
|
||||
<img alt="GitHub issues" src="https://img.shields.io/github/issues/fanmingming/live?style=flat-square">
|
||||
<img alt="GitHub watchers" src="https://img.shields.io/github/watchers/fanmingming/live?style=flat-square">
|
||||
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/fanmingming/live?style=flat-square">
|
||||
<img alt="GitHub" src="https://img.shields.io/github/license/fanmingming/live?style=flat-square">
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## 🤹♂️使用方法:
|
||||
|
||||
### 🌇电视/广播图标库:
|
||||
|
||||
| 类 别 | 调用路径 | 最后更新 |
|
||||
|-------|------------------------------------------------|------------|
|
||||
| 📺电视 | [https://live.fanmingming.com/tv/{name}.png](https://github.com/fanmingming/live/tree/main/tv) | 2024.12.01 |
|
||||
| 📻广播 | [https://live.fanmingming.com/radio/{name}.png](https://github.com/fanmingming/live/tree/main/radio) | 2024.8.29 |
|
||||
|
||||
### ⛓️创建您的m3u订阅链接:
|
||||
- 下载 `demo.m3u` 空白示例文件并使用文本编辑软件打开。
|
||||
- [https://live.fanmingming.com/tv/m3u/demo.m3u](https://live.fanmingming.com/tv/m3u/demo.m3u)
|
||||
|
||||
- 参考下方示例代码将`可用的CCTV1节目源`替换为您当地可用的直播源链接,依此类推逐个替换。
|
||||
|
||||
```
|
||||
#EXTM3U x-tvg-url="https://live.fanmingming.com/e.xml"
|
||||
#EXTINF:-1 tvg-name="CCTV1" tvg-logo="https://live.fanmingming.com/tv/CCTV1.png" group-title="央视",CCTV-1 综合
|
||||
可用的CCTV1节目源
|
||||
此处省略...
|
||||
```
|
||||
|
||||
- 将编辑完成的m3u文件上传到您的Github仓库。
|
||||
- 为您的Github仓库开启Pages。
|
||||
- 通过播放器订阅您的m3u链接。
|
||||
|
||||
> 关于Github Pages:[https://docs.github.com/en/enterprise-cloud@latest/pages/quickstart](https://docs.github.com/en/enterprise-cloud@latest/pages/quickstart)
|
||||
|
||||
## 🛠️工具
|
||||
- 📆**EPG接口地址**:
|
||||
- [https://live.fanmingming.com/e.xml](https://live.fanmingming.com/e.xml)
|
||||
- 🏞️**Bing每日图片**:
|
||||
- [https://fanmingming.com/bing](https://fanmingming.com/bing)
|
||||
- 🎞️**m3u8在线下载**:
|
||||
- [https://live.fanmingming.com/m3u8](https://live.fanmingming.com/m3u8)
|
||||
- 🆕**TXT转M3U格式**:
|
||||
- [https://live.fanmingming.com/txt2m3u](https://live.fanmingming.com/txt2m3u)
|
||||
- 📄**在线M3U转TXT**:
|
||||
- Demo🔗 [https://fanmingming.com/txt?url=https://live.fanmingming.com/tv/m3u/ipv6.m3u](https://fanmingming.com/txt?url=https://live.fanmingming.com/tv/m3u/ipv6.m3u)
|
||||
- 🌐**M3U8 Web Player**:
|
||||
- Demo🔗 [https://live.fanmingming.com/player/?vurl=https://0472.org/hls/cgtn.m3u8](https://live.fanmingming.com/player/?vurl=https://0472.org/hls/cgtn.m3u8)
|
||||
|
||||
## 📖说明
|
||||
- 项目EPG接口为112114.xyz站点分发,本项目无法确保其准确性。
|
||||
- 通过M3U8 Web Player测试直播源需使用https协议的直播源链接。
|
||||
- 在线M3U转TXT工具构建在Vercel,不会记录您的访问日志请放心使用。
|
||||
- TXT转M3U工具为前端网页转换,无需上传文件,粘贴即转换,安全不偷源。
|
||||
- 本项目不存储任何的流媒体内容,所有的法律责任与后果应由使用者自行承担。
|
||||
- 项目`/tv/m3u/`和`/radio/m3u/`目录下的内容收集于互联网,仅供测试研究使用,本项目无法保证其有效性。
|
||||
- 主域名【`live.fanmingming.com`】的WEB访问通过Github Pages自动构建,由CloudFlare提供CDN和安全防护。
|
||||
- 镜像域名【`live.fanmingming.cn`】提供完整的资源WEB访问,通过Github Actions自动构建在CloudFlare Pages。
|
||||
- 项目所有文件均托管在[GitHub](https://github.com/fanmingming/live)且自动构建,由项目发起人公益维护,欢迎Star本项目或点击[Issues](https://github.com/fanmingming/live/issues/new/choose)反馈您的问题。
|
||||
- 您可以Frok本项目到您的Github账户,将缺失的频道Logo上传到`tv`或`radio`目录下并发起拉取请求,收到请求后我们会对您提交的内容进行验证,审核通过后会自动为您署名并发布。
|
||||
|
||||
## 📱联系
|
||||
- Telegram: [@AirfoneBot](https://t.me/AirfoneBot)
|
||||
- 如遇资源访问问题请通过Telegram反馈。
|
||||
|
||||
## 📔更新
|
||||
- 2024.12.01
|
||||
- 添加了台标。
|
||||
3
_config.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
remote_theme: pages-themes/cayman@v0.2.0
|
||||
plugins:
|
||||
- jekyll-remote-theme
|
||||
BIN
assets/lapse.mp4
Normal file
7
assets/nosignal.m3u8
Normal file
@@ -0,0 +1,7 @@
|
||||
#EXTM3U
|
||||
#EXT-X-VERSION:3
|
||||
#EXT-X-TARGETDURATION:1
|
||||
#EXT-X-MEDIA-SEQUENCE:0
|
||||
#EXTINF:1.200000,
|
||||
nosignal.ts
|
||||
#EXT-X-ENDLIST
|
||||
BIN
assets/nosignal.mp3
Normal file
BIN
assets/nosignal.ts
Normal file
BIN
favicon.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
283
m3u8/aes-decryptor.js
Normal file
@@ -0,0 +1,283 @@
|
||||
// 代码来至 hls.js https://github.com/video-dev/hls.js
|
||||
|
||||
function removePadding(buffer) {
|
||||
const outputBytes = buffer.byteLength;
|
||||
const paddingBytes = outputBytes && (new DataView(buffer)).getUint8(outputBytes - 1);
|
||||
if (paddingBytes) {
|
||||
return buffer.slice(0, outputBytes - paddingBytes);
|
||||
} else {
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
||||
function AESDecryptor() {
|
||||
return {
|
||||
constructor() {
|
||||
this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
|
||||
this.subMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)];
|
||||
this.invSubMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)];
|
||||
this.sBox = new Uint32Array(256);
|
||||
this.invSBox = new Uint32Array(256);
|
||||
|
||||
// Changes during runtime
|
||||
this.key = new Uint32Array(0);
|
||||
|
||||
this.initTable();
|
||||
},
|
||||
|
||||
// Using view.getUint32() also swaps the byte order.
|
||||
uint8ArrayToUint32Array_(arrayBuffer) {
|
||||
let view = new DataView(arrayBuffer);
|
||||
let newArray = new Uint32Array(4);
|
||||
for (let i = 0; i < 4; i++) {
|
||||
newArray[i] = view.getUint32(i * 4);
|
||||
}
|
||||
|
||||
return newArray;
|
||||
},
|
||||
|
||||
initTable() {
|
||||
let sBox = this.sBox;
|
||||
let invSBox = this.invSBox;
|
||||
let subMix = this.subMix;
|
||||
let subMix0 = subMix[0];
|
||||
let subMix1 = subMix[1];
|
||||
let subMix2 = subMix[2];
|
||||
let subMix3 = subMix[3];
|
||||
let invSubMix = this.invSubMix;
|
||||
let invSubMix0 = invSubMix[0];
|
||||
let invSubMix1 = invSubMix[1];
|
||||
let invSubMix2 = invSubMix[2];
|
||||
let invSubMix3 = invSubMix[3];
|
||||
|
||||
let d = new Uint32Array(256);
|
||||
let x = 0;
|
||||
let xi = 0;
|
||||
let i = 0;
|
||||
for (i = 0; i < 256; i++) {
|
||||
if (i < 128) {
|
||||
d[i] = i << 1;
|
||||
} else {
|
||||
d[i] = (i << 1) ^ 0x11b;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
let sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
|
||||
sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
|
||||
sBox[x] = sx;
|
||||
invSBox[sx] = x;
|
||||
|
||||
// Compute multiplication
|
||||
let x2 = d[x];
|
||||
let x4 = d[x2];
|
||||
let x8 = d[x4];
|
||||
|
||||
// Compute sub/invSub bytes, mix columns tables
|
||||
let t = (d[sx] * 0x101) ^ (sx * 0x1010100);
|
||||
subMix0[x] = (t << 24) | (t >>> 8);
|
||||
subMix1[x] = (t << 16) | (t >>> 16);
|
||||
subMix2[x] = (t << 8) | (t >>> 24);
|
||||
subMix3[x] = t;
|
||||
|
||||
// Compute inv sub bytes, inv mix columns tables
|
||||
t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
|
||||
invSubMix0[sx] = (t << 24) | (t >>> 8);
|
||||
invSubMix1[sx] = (t << 16) | (t >>> 16);
|
||||
invSubMix2[sx] = (t << 8) | (t >>> 24);
|
||||
invSubMix3[sx] = t;
|
||||
|
||||
// Compute next counter
|
||||
if (!x) {
|
||||
x = xi = 1;
|
||||
} else {
|
||||
x = x2 ^ d[d[d[x8 ^ x2]]];
|
||||
xi ^= d[d[xi]];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
expandKey(keyBuffer) {
|
||||
// convert keyBuffer to Uint32Array
|
||||
let key = this.uint8ArrayToUint32Array_(keyBuffer);
|
||||
let sameKey = true;
|
||||
let offset = 0;
|
||||
|
||||
while (offset < key.length && sameKey) {
|
||||
sameKey = (key[offset] === this.key[offset]);
|
||||
offset++;
|
||||
}
|
||||
|
||||
if (sameKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.key = key;
|
||||
let keySize = this.keySize = key.length;
|
||||
|
||||
if (keySize !== 4 && keySize !== 6 && keySize !== 8) {
|
||||
throw new Error('Invalid aes key size=' + keySize);
|
||||
}
|
||||
|
||||
let ksRows = this.ksRows = (keySize + 6 + 1) * 4;
|
||||
let ksRow;
|
||||
let invKsRow;
|
||||
|
||||
let keySchedule = this.keySchedule = new Uint32Array(ksRows);
|
||||
let invKeySchedule = this.invKeySchedule = new Uint32Array(ksRows);
|
||||
let sbox = this.sBox;
|
||||
let rcon = this.rcon;
|
||||
|
||||
let invSubMix = this.invSubMix;
|
||||
let invSubMix0 = invSubMix[0];
|
||||
let invSubMix1 = invSubMix[1];
|
||||
let invSubMix2 = invSubMix[2];
|
||||
let invSubMix3 = invSubMix[3];
|
||||
|
||||
let prev;
|
||||
let t;
|
||||
|
||||
for (ksRow = 0; ksRow < ksRows; ksRow++) {
|
||||
if (ksRow < keySize) {
|
||||
prev = keySchedule[ksRow] = key[ksRow];
|
||||
continue;
|
||||
}
|
||||
t = prev;
|
||||
|
||||
if (ksRow % keySize === 0) {
|
||||
// Rot word
|
||||
t = (t << 8) | (t >>> 24);
|
||||
|
||||
// Sub word
|
||||
t = (sbox[t >>> 24] << 24) | (sbox[(t >>> 16) & 0xff] << 16) | (sbox[(t >>> 8) & 0xff] << 8) | sbox[t & 0xff];
|
||||
|
||||
// Mix Rcon
|
||||
t ^= rcon[(ksRow / keySize) | 0] << 24;
|
||||
} else if (keySize > 6 && ksRow % keySize === 4) {
|
||||
// Sub word
|
||||
t = (sbox[t >>> 24] << 24) | (sbox[(t >>> 16) & 0xff] << 16) | (sbox[(t >>> 8) & 0xff] << 8) | sbox[t & 0xff];
|
||||
}
|
||||
|
||||
keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;
|
||||
}
|
||||
|
||||
for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {
|
||||
ksRow = ksRows - invKsRow;
|
||||
if (invKsRow & 3) {
|
||||
t = keySchedule[ksRow];
|
||||
} else {
|
||||
t = keySchedule[ksRow - 4];
|
||||
}
|
||||
|
||||
if (invKsRow < 4 || ksRow <= 4) {
|
||||
invKeySchedule[invKsRow] = t;
|
||||
} else {
|
||||
invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[(t >>> 16) & 0xff]] ^ invSubMix2[sbox[(t >>> 8) & 0xff]] ^ invSubMix3[sbox[t & 0xff]];
|
||||
}
|
||||
|
||||
invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;
|
||||
}
|
||||
},
|
||||
|
||||
// Adding this as a method greatly improves performance.
|
||||
networkToHostOrderSwap(word) {
|
||||
return (word << 24) | ((word & 0xff00) << 8) | ((word & 0xff0000) >> 8) | (word >>> 24);
|
||||
},
|
||||
|
||||
decrypt(inputArrayBuffer, offset, aesIV, removePKCS7Padding) {
|
||||
let nRounds = this.keySize + 6;
|
||||
let invKeySchedule = this.invKeySchedule;
|
||||
let invSBOX = this.invSBox;
|
||||
|
||||
let invSubMix = this.invSubMix;
|
||||
let invSubMix0 = invSubMix[0];
|
||||
let invSubMix1 = invSubMix[1];
|
||||
let invSubMix2 = invSubMix[2];
|
||||
let invSubMix3 = invSubMix[3];
|
||||
|
||||
let initVector = this.uint8ArrayToUint32Array_(aesIV);
|
||||
let initVector0 = initVector[0];
|
||||
let initVector1 = initVector[1];
|
||||
let initVector2 = initVector[2];
|
||||
let initVector3 = initVector[3];
|
||||
|
||||
let inputInt32 = new Int32Array(inputArrayBuffer);
|
||||
let outputInt32 = new Int32Array(inputInt32.length);
|
||||
|
||||
let t0, t1, t2, t3;
|
||||
let s0, s1, s2, s3;
|
||||
let inputWords0, inputWords1, inputWords2, inputWords3;
|
||||
|
||||
let ksRow, i;
|
||||
let swapWord = this.networkToHostOrderSwap;
|
||||
|
||||
while (offset < inputInt32.length) {
|
||||
inputWords0 = swapWord(inputInt32[offset]);
|
||||
inputWords1 = swapWord(inputInt32[offset + 1]);
|
||||
inputWords2 = swapWord(inputInt32[offset + 2]);
|
||||
inputWords3 = swapWord(inputInt32[offset + 3]);
|
||||
|
||||
s0 = inputWords0 ^ invKeySchedule[0];
|
||||
s1 = inputWords3 ^ invKeySchedule[1];
|
||||
s2 = inputWords2 ^ invKeySchedule[2];
|
||||
s3 = inputWords1 ^ invKeySchedule[3];
|
||||
|
||||
ksRow = 4;
|
||||
|
||||
// Iterate through the rounds of decryption
|
||||
for (i = 1; i < nRounds; i++) {
|
||||
t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[(s1 >> 16) & 0xff] ^ invSubMix2[(s2 >> 8) & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];
|
||||
t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[(s2 >> 16) & 0xff] ^ invSubMix2[(s3 >> 8) & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];
|
||||
t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[(s3 >> 16) & 0xff] ^ invSubMix2[(s0 >> 8) & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];
|
||||
t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[(s0 >> 16) & 0xff] ^ invSubMix2[(s1 >> 8) & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];
|
||||
// Update state
|
||||
s0 = t0;
|
||||
s1 = t1;
|
||||
s2 = t2;
|
||||
s3 = t3;
|
||||
|
||||
ksRow = ksRow + 4;
|
||||
}
|
||||
|
||||
// Shift rows, sub bytes, add round key
|
||||
t0 = ((invSBOX[s0 >>> 24] << 24) ^ (invSBOX[(s1 >> 16) & 0xff] << 16) ^ (invSBOX[(s2 >> 8) & 0xff] << 8) ^ invSBOX[s3 & 0xff]) ^ invKeySchedule[ksRow];
|
||||
t1 = ((invSBOX[s1 >>> 24] << 24) ^ (invSBOX[(s2 >> 16) & 0xff] << 16) ^ (invSBOX[(s3 >> 8) & 0xff] << 8) ^ invSBOX[s0 & 0xff]) ^ invKeySchedule[ksRow + 1];
|
||||
t2 = ((invSBOX[s2 >>> 24] << 24) ^ (invSBOX[(s3 >> 16) & 0xff] << 16) ^ (invSBOX[(s0 >> 8) & 0xff] << 8) ^ invSBOX[s1 & 0xff]) ^ invKeySchedule[ksRow + 2];
|
||||
t3 = ((invSBOX[s3 >>> 24] << 24) ^ (invSBOX[(s0 >> 16) & 0xff] << 16) ^ (invSBOX[(s1 >> 8) & 0xff] << 8) ^ invSBOX[s2 & 0xff]) ^ invKeySchedule[ksRow + 3];
|
||||
ksRow = ksRow + 3;
|
||||
|
||||
// Write
|
||||
outputInt32[offset] = swapWord(t0 ^ initVector0);
|
||||
outputInt32[offset + 1] = swapWord(t3 ^ initVector1);
|
||||
outputInt32[offset + 2] = swapWord(t2 ^ initVector2);
|
||||
outputInt32[offset + 3] = swapWord(t1 ^ initVector3);
|
||||
|
||||
// reset initVector to last 4 unsigned int
|
||||
initVector0 = inputWords0;
|
||||
initVector1 = inputWords1;
|
||||
initVector2 = inputWords2;
|
||||
initVector3 = inputWords3;
|
||||
|
||||
offset = offset + 4;
|
||||
}
|
||||
|
||||
return removePKCS7Padding ? removePadding(outputInt32.buffer) : outputInt32.buffer;
|
||||
},
|
||||
|
||||
destroy() {
|
||||
this.key = undefined;
|
||||
this.keySize = undefined;
|
||||
this.ksRows = undefined;
|
||||
|
||||
this.sBox = undefined;
|
||||
this.invSBox = undefined;
|
||||
this.subMix = undefined;
|
||||
this.invSubMix = undefined;
|
||||
this.keySchedule = undefined;
|
||||
this.invKeySchedule = undefined;
|
||||
|
||||
this.rcon = undefined;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
982
m3u8/index.html
Normal file
@@ -0,0 +1,982 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta name="keywords" content="m3u8 下载工具">
|
||||
<meta name="description" content="m3u8 下载工具,无需下载软件,打开网站即可下载,自动检测,一键下载">
|
||||
<title>m3u8 downloader</title>
|
||||
<style>
|
||||
/*全局设置*/
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body::-webkit-scrollbar { display: none}
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
[v-cloak] {
|
||||
display: none;
|
||||
}
|
||||
#m-app {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 10px 50px 80px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.m-p-action {
|
||||
margin: 20px auto;
|
||||
max-width: 1100px;
|
||||
width: 100%;
|
||||
font-size: 35px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
.m-p-other, .m-p-tamper, .m-p-github, .m-p-language, .m-p-mse{
|
||||
position: fixed;
|
||||
right: 50px;
|
||||
background-color: #eff3f6;
|
||||
background-image: linear-gradient(-180deg, #fafbfc, #eff3f6 90%);
|
||||
color: #24292e;
|
||||
border: 1px solid rgba(27, 31, 35, .2);
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
line-height: 20px;
|
||||
padding: 6px 12px;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.m-p-help {
|
||||
position: fixed;
|
||||
right: 50px;
|
||||
top: 50px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
color: #666666;
|
||||
z-index: 2;
|
||||
line-height: 30px;
|
||||
font-weight: bolder;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(27, 31, 35, .2);
|
||||
cursor: pointer;
|
||||
background-color: #eff3f6;
|
||||
background-image: linear-gradient(-180deg, #fafbfc, #eff3f6 90%);
|
||||
}
|
||||
.m-p-github:hover, .m-p-other:hover, .m-p-tamper:hover, .m-p-help:hover, .m-p-language:hover, .m-p-mse:hover{
|
||||
opacity: 0.9;
|
||||
}
|
||||
.m-p-language {
|
||||
bottom: 70px;
|
||||
}
|
||||
.m-p-other {
|
||||
bottom: 150px;
|
||||
}
|
||||
.m-p-tamper {
|
||||
bottom: 30px;
|
||||
}
|
||||
.m-p-github {
|
||||
bottom: 190px;
|
||||
}
|
||||
.m-p-mse {
|
||||
bottom: 110px;
|
||||
}
|
||||
/*广告*/
|
||||
.m-p-refer {
|
||||
position: absolute;
|
||||
left: 50px;
|
||||
bottom: 50px;
|
||||
}
|
||||
.m-p-refer .text {
|
||||
position: absolute;
|
||||
top: -80px;
|
||||
left: -40px;
|
||||
animation-name: upAnimation;
|
||||
transform-origin: center bottom;
|
||||
animation-duration: 2s;
|
||||
animation-fill-mode: both;
|
||||
animation-iteration-count: infinite;
|
||||
animation-delay: .5s;
|
||||
}
|
||||
.m-p-refer .close {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: -110px;
|
||||
right: -50px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
z-index: 3;
|
||||
transition: 0.3s all;
|
||||
background-size: 30px 30px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-image: url(https://www.fanmingming.com/bg.php);
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.m-p-refer .close:hover {
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
.m-p-refer .link {
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
background-color: #4E84E6;
|
||||
transition: 0.3s all;
|
||||
}
|
||||
.m-p-refer .link:hover {
|
||||
top: -10px;
|
||||
color: #333333;
|
||||
border: 1px solid transparent;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
box-shadow: 2px 11px 20px 0 rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
@keyframes upAnimation {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
transition-timing-function: cubic-bezier(0.215, .61, .355, 1)
|
||||
}
|
||||
|
||||
10% {
|
||||
transform: rotate(-12deg);
|
||||
transition-timing-function: cubic-bezier(0.215, .61, .355, 1)
|
||||
}
|
||||
|
||||
20% {
|
||||
transform: rotate(12deg);
|
||||
transition-timing-function: cubic-bezier(0.215, .61, .355, 1)
|
||||
}
|
||||
|
||||
28% {
|
||||
transform: rotate(-10deg);
|
||||
transition-timing-function: cubic-bezier(0.215, .61, .355, 1)
|
||||
}
|
||||
|
||||
36% {
|
||||
transform: rotate(10deg);
|
||||
transition-timing-function: cubic-bezier(0.755, .5, .855, .06)
|
||||
}
|
||||
|
||||
42% {
|
||||
transform: rotate(-8deg);
|
||||
transition-timing-function: cubic-bezier(0.755, .5, .855, .06)
|
||||
}
|
||||
|
||||
48% {
|
||||
transform: rotate(8deg);
|
||||
transition-timing-function: cubic-bezier(0.755, .5, .855, .06)
|
||||
}
|
||||
|
||||
52% {
|
||||
transform: rotate(-4deg);
|
||||
transition-timing-function: cubic-bezier(0.755, .5, .855, .06)
|
||||
}
|
||||
|
||||
56% {
|
||||
transform: rotate(4deg);
|
||||
transition-timing-function: cubic-bezier(0.755, .5, .855, .06)
|
||||
}
|
||||
|
||||
60% {
|
||||
transform: rotate(0deg);
|
||||
transition-timing-function: cubic-bezier(0.755, .5, .855, .06)
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(0deg);
|
||||
transition-timing-function: cubic-bezier(0.215, .61, .355, 1)
|
||||
}
|
||||
}
|
||||
/*顶部信息录入*/
|
||||
.m-p-temp-url {
|
||||
padding-top: 50px;
|
||||
padding-bottom: 10px;
|
||||
width: 100%;
|
||||
color: #999999;
|
||||
text-align: left;
|
||||
font-style: italic;
|
||||
word-break: break-all;
|
||||
}
|
||||
.m-p-input-container {
|
||||
display: flex;
|
||||
}
|
||||
.m-p-input-container input {
|
||||
flex: 1;
|
||||
margin-bottom: 20px;
|
||||
display: block;
|
||||
width: 280px;
|
||||
padding: 16px;
|
||||
font-size: 24px;
|
||||
border-radius: 4px;
|
||||
box-shadow: none;
|
||||
color: #444444;
|
||||
border: 1px solid #cccccc;
|
||||
}
|
||||
.m-p-input-container .range-input {
|
||||
margin-left: 10px;
|
||||
flex: 0 0 100px;
|
||||
width: 100px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.m-p-input-container div {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin-left: 10px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
font-size: 24px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #eeeeee;
|
||||
background-color: #3D8AC7;
|
||||
opacity: 1;
|
||||
transition: 0.3s all;
|
||||
}
|
||||
.m-p-input-container div:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.m-p-input-container div {
|
||||
width: 200px;
|
||||
}
|
||||
.m-p-input-container .disable {
|
||||
cursor: not-allowed;
|
||||
background-color: #dddddd;
|
||||
}
|
||||
/*下载状态*/
|
||||
.m-p-line {
|
||||
margin: 20px 0 50px;
|
||||
vertical-align: top;
|
||||
width: 100%;
|
||||
height: 5px;
|
||||
border-bottom: dotted;
|
||||
}
|
||||
.m-p-tips {
|
||||
width: 100%;
|
||||
color: #999999;
|
||||
text-align: left;
|
||||
font-style: italic;
|
||||
word-break: break-all;
|
||||
}
|
||||
.m-p-tips p {
|
||||
width: 100px;
|
||||
display: inline-block;
|
||||
}
|
||||
.m-p-tips.error-tips{
|
||||
color: #DC5350;
|
||||
}
|
||||
.m-p-segment {
|
||||
text-align: left;
|
||||
}
|
||||
.m-p-segment .item {
|
||||
display: inline-block;
|
||||
margin: 10px 6px;
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
color: white;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
cursor: help;
|
||||
border: solid 1px #eeeeee;
|
||||
background-color: #dddddd;
|
||||
transition: 0.3s all;
|
||||
}
|
||||
.m-p-segment .finish {
|
||||
background-color: #0ACD76;
|
||||
}
|
||||
.m-p-segment .error {
|
||||
cursor: pointer;
|
||||
background-color: #DC5350;
|
||||
}
|
||||
.m-p-segment .error:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.m-p-stream, .m-p-report, .m-p-cross, .m-p-final {
|
||||
margin-top: 10px;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
font-size: 20px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #eeeeee;
|
||||
background-color: #3D8AC7;
|
||||
opacity: 1;
|
||||
transition: 0.3s all;
|
||||
}
|
||||
.m-p-stream {
|
||||
background-color: #0ACD76 !important;
|
||||
}
|
||||
.m-p-report {
|
||||
background-color: #e74c3c !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
.m-p-final {
|
||||
text-decoration: none;
|
||||
}
|
||||
.m-p-force, .m-p-retry {
|
||||
position: absolute;
|
||||
right: 50px;
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
font-size: 18px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #eeeeee;
|
||||
background-color: #3D8AC7;
|
||||
opacity: 1;
|
||||
transition: 0.3s all;
|
||||
}
|
||||
.m-p-retry {
|
||||
right: 250px;
|
||||
}
|
||||
.m-p-force:hover, .m-p-retry:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="m-loading">
|
||||
页面加载中,请耐心等待...
|
||||
<h1 style="white-space: pre;">
|
||||
推荐一个 m3u8 网页版提取工具,无需下载软件,打开网站即可下载,自动检测,一键下载。
|
||||
<a target="_blank" href="https://live.fanmingming.com/m3u8/">点击跳转</a>
|
||||
</h1>
|
||||
</div>
|
||||
<section id="m-app" v-cloak>
|
||||
<!--顶部操作提示-->
|
||||
<section class="m-p-action g-box">{{tips}}</section>
|
||||
<a class="m-p-help" target="_blank" href="https://live.fanmingming.com">?</a>
|
||||
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3656045783502609"
|
||||
crossorigin="anonymous"></script>
|
||||
<!-- 自适应展示广告 -->
|
||||
<ins class="adsbygoogle"
|
||||
style="display:block"
|
||||
data-ad-client="ca-pub-3656045783502609"
|
||||
data-ad-slot="5707543905"
|
||||
data-ad-format="auto"
|
||||
data-full-width-responsive="true"></ins>
|
||||
<script>
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
</script>
|
||||
|
||||
<!--文件载入-->
|
||||
<div class="m-p-temp-url">测试链接:https://0472.org/m3u8/index.m3u8</div>
|
||||
<section class="m-p-input-container">
|
||||
<input type="text" v-model="url" :disabled="downloading" placeholder="请输入 m3u8 链接">
|
||||
|
||||
<!--范围查询-->
|
||||
<template v-if="!downloading || rangeDownload.isShowRange">
|
||||
<div v-if="!rangeDownload.isShowRange" @click="getM3U8(true)">特定范围下载</div>
|
||||
<template v-else>
|
||||
<input class="range-input" type="number" v-model="rangeDownload.startSegment" :disabled="downloading" placeholder="起始片段">
|
||||
<input class="range-input" type="number" v-model="rangeDownload.endSegment" :disabled="downloading" placeholder="截止片段">
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<!--还未开始下载-->
|
||||
<template v-if="!downloading">
|
||||
<div @click="getM3U8(false)">原格式下载</div>
|
||||
<div @click="getMP4">转码为MP4下载</div>
|
||||
</template>
|
||||
<div v-else-if="finishNum === rangeDownload.targetSegment && rangeDownload.targetSegment > 0" class="disable">下载完成</div>
|
||||
<div v-else @click="togglePause">{{ isPause ? '恢复下载' : '暂停下载' }}</div>
|
||||
</section>
|
||||
<div v-if="!downloading && isSupperStreamWrite" class="m-p-stream" @click="streamDownload(true)">特大视频 MP4 格式下载,边下载边保存,彻底解决大文件下载内存不足问题 </div>
|
||||
<a class="m-p-final" href="https://live.fanmingming.com/m3u8/">下载完成?点击返回 m3u8 Downloader 首页</a>
|
||||
<template v-if="finishList.length > 0">
|
||||
<div class="m-p-line"></div>
|
||||
<!-- <div class="m-p-retry" v-if="errorNum && downloadIndex >= rangeDownload.targetSegment" @click="retryAll">重新下载错误片段</div> -->
|
||||
<div class="m-p-force" v-if="mediaFileList.length && !streamWriter" @click="forceDownload">强制下载现有片段</div>
|
||||
<div class="m-p-tips">待下载碎片总量:{{ rangeDownload.targetSegment }},已下载:{{ finishNum }},错误:{{ errorNum }},进度:{{ (finishNum / rangeDownload.targetSegment * 100).toFixed(2) }}%</div>
|
||||
<div class="m-p-tips" :class="[errorNum ? 'error-tips' : '']">若某视频碎片下载发生错误,将标记为红色,可点击相应图标进行重试</div>
|
||||
<section class="m-p-segment">
|
||||
<div class="item" v-for="(item, index) in finishList" :class="[item.status]" :title="item.title" @click="retry(index)">{{ index + 1 }}</div>
|
||||
</section>
|
||||
</template>
|
||||
</section>
|
||||
</body>
|
||||
<!--vue 前端框架-->
|
||||
<script src="https://live.fanmingming.com/m3u8/vue.js"></script>
|
||||
<script src="https://live.fanmingming.com/m3u8/aes-decryptor.js"></script>
|
||||
<script src="https://live.fanmingming.com/m3u8/mux-mp4.js"></script>
|
||||
<script src="https://live.fanmingming.com/m3u8/stream-saver.js"></script>
|
||||
|
||||
<script>
|
||||
// script注入
|
||||
document.getElementById('m-loading') && document.getElementById('m-loading').remove()
|
||||
new Vue({
|
||||
el: '#m-app',
|
||||
|
||||
data() {
|
||||
return {
|
||||
url: '', // 在线链接
|
||||
tips: 'm3u8 视频在线提取工具', // 顶部提示
|
||||
title: '', // 视频标题
|
||||
isPause: false, // 是否暂停下载
|
||||
isGetMP4: false, // 是否转码为 MP4 下载
|
||||
durationSecond: 0, // 视频持续时长
|
||||
isShowRefer: false, // 是否显示推送
|
||||
downloading: false, // 是否下载中
|
||||
beginTime: '', // 开始下载的时间
|
||||
errorNum: 0, // 错误数
|
||||
finishNum: 0, // 已下载数
|
||||
downloadIndex: 0, // 当前下载片段
|
||||
finishList: [], // 下载完成项目
|
||||
tsUrlList: [], // ts URL数组
|
||||
mediaFileList: [], // 下载的媒体数组
|
||||
isSupperStreamWrite: window.streamSaver && !window.streamSaver.useBlobFallback, // 当前浏览器是否支持流式下载
|
||||
streamWriter: null, // 文件流写入器
|
||||
streamDownloadIndex: 0, // 文件流写入器,正准备写入第几个视频片段
|
||||
rangeDownload: { // 特定范围下载
|
||||
isShowRange: false, // 是否显示范围下载
|
||||
startSegment: '', // 起始片段
|
||||
endSegment: '', // 截止片段
|
||||
targetSegment: 1, // 待下载片段
|
||||
},
|
||||
aesConf: { // AES 视频解密配置
|
||||
method: '', // 加密算法
|
||||
uri: '', // key 所在文件路径
|
||||
iv: '', // 偏移值
|
||||
key: '', // 秘钥
|
||||
decryptor: null, // 解码器对象
|
||||
|
||||
stringToBuffer: function (str) {
|
||||
return new TextEncoder().encode(str)
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getSource();
|
||||
window.addEventListener('keyup', this.onKeyup)
|
||||
setInterval(this.retryAll.bind(this), 2000) // 每两秒重新下载一遍错误片段,实现错误自动重试
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('keyup', this.onKeyup)
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取链接中携带的资源链接
|
||||
getSource() {
|
||||
let { href } = location
|
||||
if (href.indexOf('?source=') > -1) {
|
||||
this.url = href.split('?source=')[1]
|
||||
}
|
||||
},
|
||||
|
||||
// 获取顶部 window title,因可能存在跨域问题,故使用 try catch 进行保护
|
||||
getDocumentTitle(){
|
||||
let title = document.title;
|
||||
try {
|
||||
title = window.top.document.title
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
return title
|
||||
},
|
||||
|
||||
// 退出弹窗
|
||||
onKeyup(event) {
|
||||
if (event.keyCode === 13) { // 键入ESC
|
||||
this.getM3U8()
|
||||
}
|
||||
},
|
||||
|
||||
// ajax 请求
|
||||
ajax(options) {
|
||||
options = options || {};
|
||||
let xhr = new XMLHttpRequest();
|
||||
if (options.type === 'file') {
|
||||
xhr.responseType = 'arraybuffer';
|
||||
}
|
||||
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === 4) {
|
||||
let status = xhr.status;
|
||||
if (status >= 200 && status < 300) {
|
||||
options.success && options.success(xhr.response);
|
||||
} else {
|
||||
options.fail && options.fail(status);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.open("GET", options.url, true);
|
||||
xhr.send(null);
|
||||
},
|
||||
|
||||
// 合成URL
|
||||
applyURL(targetURL, baseURL) {
|
||||
baseURL = baseURL || location.href
|
||||
if (targetURL.indexOf('http') === 0) {
|
||||
// 当前页面使用 https 协议时,强制使 ts 资源也使用 https 协议获取
|
||||
if(location.href.indexOf('https') === 0){
|
||||
return targetURL.replace('http://','https://')
|
||||
}
|
||||
return targetURL
|
||||
} else if (targetURL[0] === '/') {
|
||||
let domain = baseURL.split('/')
|
||||
return domain[0] + '//' + domain[2] + targetURL
|
||||
} else {
|
||||
let domain = baseURL.split('/')
|
||||
domain.pop()
|
||||
return domain.join('/') + '/' + targetURL
|
||||
}
|
||||
},
|
||||
|
||||
// 使用流式下载,边下载边保存,解决大视频文件内存不足的难题
|
||||
streamDownload(isMp4){
|
||||
this.isGetMP4 = isMp4
|
||||
this.title = new URL(this.url).searchParams.get('title') || this.title // 获取视频标题
|
||||
let fileName = this.title || this.formatTime(new Date(), 'YYYY_MM_DD hh_mm_ss')
|
||||
if(document.title !== 'm3u8 downloader'){
|
||||
fileName = this.getDocumentTitle()
|
||||
}
|
||||
this.streamWriter = window.streamSaver.createWriteStream(`${fileName}.${isMp4 ? 'mp4' : 'ts'}`).getWriter()
|
||||
this.getM3U8()
|
||||
},
|
||||
|
||||
// 解析为 mp4 下载
|
||||
getMP4() {
|
||||
this.isGetMP4 = true
|
||||
this.getM3U8()
|
||||
},
|
||||
|
||||
// 获取在线文件
|
||||
getM3U8(onlyGetRange) {
|
||||
if (!this.url) {
|
||||
alert('请输入链接')
|
||||
return
|
||||
}
|
||||
if (this.url.toLowerCase().indexOf('m3u8') === -1) {
|
||||
alert('链接有误,请重新输入')
|
||||
return
|
||||
}
|
||||
if (this.downloading) {
|
||||
alert('资源下载中,请稍后')
|
||||
return
|
||||
}
|
||||
|
||||
// 在下载页面才触发,代码注入的页面不需要校验
|
||||
// 当前协议不一致,切换协议
|
||||
if (location.href.indexOf('blog.luckly-mjw.cn') > -1 && this.url.indexOf(location.protocol) === -1) {
|
||||
//alert('当前协议不一致,跳转至正确页面重新下载')
|
||||
location.href = `${this.url.split(':')[0]}://live.fanmingming.com/m3u8/index.html?source=${this.url}`
|
||||
return
|
||||
}
|
||||
|
||||
// 在下载页面才触发,修改页面 URL,携带下载路径,避免刷新后丢失
|
||||
if (location.href.indexOf('blog.luckly-mjw.cn') > -1) {
|
||||
window.history.replaceState(null, '', `${location.href.split('?')[0]}?source=${this.url}`)
|
||||
}
|
||||
|
||||
this.title = new URL(this.url).searchParams.get('title') || this.title // 获取视频标题
|
||||
this.tips = 'm3u8 文件下载中,请稍后'
|
||||
this.beginTime = new Date()
|
||||
this.ajax({
|
||||
url: this.url,
|
||||
success: (m3u8Str) => {
|
||||
this.tsUrlList = []
|
||||
this.finishList = []
|
||||
|
||||
// 提取 ts 视频片段地址
|
||||
m3u8Str.split('\n').forEach((item) => {
|
||||
// if (/.(png|image|ts|jpg|mp4|jpeg)/.test(item)) {
|
||||
// 放开片段后缀限制,下载非 # 开头的链接片段
|
||||
if (/^[^#]/.test(item)) {
|
||||
console.log(item)
|
||||
this.tsUrlList.push(this.applyURL(item, this.url))
|
||||
this.finishList.push({
|
||||
title: item,
|
||||
status: ''
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// 仅获取视频片段数
|
||||
if (onlyGetRange) {
|
||||
this.rangeDownload.isShowRange = true
|
||||
this.rangeDownload.endSegment = this.tsUrlList.length
|
||||
this.rangeDownload.targetSegment = this.tsUrlList.length
|
||||
return
|
||||
} else {
|
||||
let startSegment = Math.max(this.rangeDownload.startSegment || 1, 1) // 最小为 1
|
||||
let endSegment = Math.max(this.rangeDownload.endSegment || this.tsUrlList.length, 1)
|
||||
startSegment = Math.min(startSegment, this.tsUrlList.length) // 最大为 this.tsUrlList.length
|
||||
endSegment = Math.min(endSegment, this.tsUrlList.length)
|
||||
this.rangeDownload.startSegment = Math.min(startSegment, endSegment)
|
||||
this.rangeDownload.endSegment = Math.max(startSegment, endSegment)
|
||||
this.rangeDownload.targetSegment = this.rangeDownload.endSegment - this.rangeDownload.startSegment + 1
|
||||
this.downloadIndex = this.rangeDownload.startSegment - 1
|
||||
this.downloading = true
|
||||
}
|
||||
|
||||
// 获取需要下载的 MP4 视频长度
|
||||
if (this.isGetMP4) {
|
||||
let infoIndex = 0
|
||||
m3u8Str.split('\n').forEach(item => {
|
||||
if (item.toUpperCase().indexOf('#EXTINF:') > -1) { // 计算视频总时长,设置 mp4 信息时使用
|
||||
infoIndex++
|
||||
if (this.rangeDownload.startSegment <= infoIndex && infoIndex <= this.rangeDownload.endSegment) {
|
||||
this.durationSecond += parseFloat(item.split('#EXTINF:')[1])
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 检测视频 AES 加密
|
||||
if (m3u8Str.indexOf('#EXT-X-KEY') > -1) {
|
||||
this.aesConf.method = (m3u8Str.match(/(.*METHOD=([^,\s]+))/) || ['', '', ''])[2]
|
||||
this.aesConf.uri = (m3u8Str.match(/(.*URI="([^"]+))"/) || ['', '', ''])[2]
|
||||
this.aesConf.iv = (m3u8Str.match(/(.*IV=([^,\s]+))/) || ['', '', ''])[2]
|
||||
this.aesConf.iv = this.aesConf.iv ? this.aesConf.stringToBuffer(this.aesConf.iv) : ''
|
||||
this.aesConf.uri = this.applyURL(this.aesConf.uri, this.url)
|
||||
|
||||
// let params = m3u8Str.match(/#EXT-X-KEY:([^,]*,?METHOD=([^,]+))?([^,]*,?URI="([^,]+)")?([^,]*,?IV=([^,^\n]+))?/)
|
||||
// this.aesConf.method = params[2]
|
||||
// this.aesConf.uri = this.applyURL(params[4], this.url)
|
||||
// this.aesConf.iv = params[6] ? this.aesConf.stringToBuffer(params[6]) : ''
|
||||
this.getAES();
|
||||
} else if (this.tsUrlList.length > 0) { // 如果视频没加密,则直接下载片段,否则先下载秘钥
|
||||
this.downloadTS()
|
||||
} else {
|
||||
this.alertError('资源为空,请查看链接是否有效')
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.alertError('链接不正确,请查看链接是否有效')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 获取AES配置
|
||||
getAES() {
|
||||
// alert('视频被 AES 加密,点击确认,进行视频解码')
|
||||
this.ajax({
|
||||
type: 'file',
|
||||
url: this.aesConf.uri,
|
||||
success: (key) => {
|
||||
// console.log('getAES', key)
|
||||
// this.aesConf.key = this.aesConf.stringToBuffer(key)
|
||||
this.aesConf.key = key
|
||||
this.aesConf.decryptor = new AESDecryptor()
|
||||
this.aesConf.decryptor.constructor()
|
||||
this.aesConf.decryptor.expandKey(this.aesConf.key);
|
||||
this.downloadTS()
|
||||
},
|
||||
fail: () => {
|
||||
this.alertError('视频已加密,可试用右下角入口的「无差别提取工具」')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// ts 片段的 AES 解码
|
||||
aesDecrypt(data, index) {
|
||||
let iv = this.aesConf.iv || new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, index])
|
||||
return this.aesConf.decryptor.decrypt(data, 0, iv.buffer || iv, true)
|
||||
},
|
||||
|
||||
// 下载分片
|
||||
downloadTS() {
|
||||
this.tips = 'ts 视频碎片下载中,请稍后'
|
||||
let download = () => {
|
||||
let isPause = this.isPause // 使用另一个变量来保持下载前的暂停状态,避免回调后没修改
|
||||
let index = this.downloadIndex
|
||||
if (index >= this.rangeDownload.endSegment) {
|
||||
return
|
||||
}
|
||||
this.downloadIndex++
|
||||
if (this.finishList[index] && this.finishList[index].status === '') {
|
||||
this.finishList[index].status = 'downloading'
|
||||
this.ajax({
|
||||
url: this.tsUrlList[index],
|
||||
type: 'file',
|
||||
success: (file) => {
|
||||
this.dealTS(file, index, () => this.downloadIndex < this.rangeDownload.endSegment && !isPause && download())
|
||||
},
|
||||
fail: () => {
|
||||
this.errorNum++
|
||||
this.finishList[index].status = 'error'
|
||||
if (this.downloadIndex < this.rangeDownload.endSegment) {
|
||||
!isPause && download()
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (this.downloadIndex < this.rangeDownload.endSegment) { // 跳过已经成功的片段
|
||||
!isPause && download()
|
||||
}
|
||||
}
|
||||
|
||||
// 建立多少个 ajax 线程
|
||||
for (let i = 0; i < Math.min(6, this.rangeDownload.targetSegment - this.finishNum); i++) {
|
||||
download()
|
||||
}
|
||||
},
|
||||
|
||||
// 处理 ts 片段,AES 解密、mp4 转码
|
||||
dealTS(file, index, callback) {
|
||||
const data = this.aesConf.uri ? this.aesDecrypt(file, index) : file
|
||||
this.conversionMp4(data, index, (afterData) => { // mp4 转码
|
||||
this.mediaFileList[index - this.rangeDownload.startSegment + 1] = afterData // 判断文件是否需要解密
|
||||
this.finishList[index].status = 'finish'
|
||||
this.finishNum++
|
||||
if (this.streamWriter){
|
||||
for (let index = this.streamDownloadIndex; index < this.mediaFileList.length; index++) {
|
||||
if(this.mediaFileList[index]){
|
||||
this.streamWriter.write(new Uint8Array(this.mediaFileList[index]))
|
||||
this.mediaFileList[index] = null
|
||||
this.streamDownloadIndex = index + 1
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (this.streamDownloadIndex >= this.rangeDownload.targetSegment){
|
||||
this.streamWriter.close()
|
||||
}
|
||||
} else if (this.finishNum === this.rangeDownload.targetSegment) {
|
||||
let fileName = this.title || this.formatTime(this.beginTime, 'YYYY_MM_DD hh_mm_ss')
|
||||
if(document.title !== 'm3u8 downloader'){
|
||||
fileName = this.getDocumentTitle()
|
||||
}
|
||||
this.downloadFile(this.mediaFileList, fileName)
|
||||
}
|
||||
callback && callback()
|
||||
})
|
||||
},
|
||||
|
||||
// 转码为 mp4
|
||||
conversionMp4(data, index, callback) {
|
||||
if (this.isGetMP4) {
|
||||
let transmuxer = new muxjs.Transmuxer({
|
||||
keepOriginalTimestamps: true,
|
||||
duration: parseInt(this.durationSecond),
|
||||
});
|
||||
transmuxer.on('data', segment => {
|
||||
if (index === this.rangeDownload.startSegment - 1) {
|
||||
let data = new Uint8Array(segment.initSegment.byteLength + segment.data.byteLength);
|
||||
data.set(segment.initSegment, 0);
|
||||
data.set(segment.data, segment.initSegment.byteLength);
|
||||
callback(data.buffer)
|
||||
} else {
|
||||
callback(segment.data)
|
||||
}
|
||||
})
|
||||
transmuxer.push(new Uint8Array(data));
|
||||
transmuxer.flush();
|
||||
} else {
|
||||
callback(data)
|
||||
}
|
||||
},
|
||||
|
||||
// 暂停与恢复
|
||||
togglePause() {
|
||||
this.isPause = !this.isPause
|
||||
!this.isPause && this.retryAll(true)
|
||||
},
|
||||
|
||||
// 重新下载某个片段
|
||||
retry(index) {
|
||||
if (this.finishList[index].status === 'error') {
|
||||
this.finishList[index].status = ''
|
||||
this.ajax({
|
||||
url: this.tsUrlList[index],
|
||||
type: 'file',
|
||||
success: (file) => {
|
||||
this.errorNum--
|
||||
this.dealTS(file, index)
|
||||
},
|
||||
fail: () => {
|
||||
this.finishList[index].status = 'error'
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 重新下载所有错误片段
|
||||
retryAll(forceRestart) {
|
||||
|
||||
if (!this.finishList.length || this.isPause) {
|
||||
return
|
||||
}
|
||||
|
||||
let firstErrorIndex = this.downloadIndex // 没有错误项目,则每次都递增
|
||||
this.finishList.forEach((item, index) => { // 重置所有错误片段状态
|
||||
if (item.status === 'error') {
|
||||
item.status = ''
|
||||
firstErrorIndex = Math.min(firstErrorIndex, index)
|
||||
}
|
||||
})
|
||||
this.errorNum = 0
|
||||
// 已经全部下载进程都跑完了,则重新启动下载进程
|
||||
if (this.downloadIndex >= this.rangeDownload.endSegment || forceRestart) {
|
||||
this.downloadIndex = firstErrorIndex
|
||||
this.downloadTS()
|
||||
} else { // 否则只是将下载索引,改为最近一个错误的项目,从那里开始遍历
|
||||
this.downloadIndex = firstErrorIndex
|
||||
}
|
||||
},
|
||||
|
||||
// 下载整合后的TS文件
|
||||
downloadFile(fileDataList, fileName) {
|
||||
this.tips = 'ts 碎片整合中,请留意浏览器下载'
|
||||
let fileBlob = null
|
||||
let a = document.createElement('a')
|
||||
if (this.isGetMP4) {
|
||||
fileBlob = new Blob(fileDataList, { type: 'video/mp4' }) // 创建一个Blob对象,并设置文件的 MIME 类型
|
||||
a.download = fileName + '.mp4'
|
||||
} else {
|
||||
fileBlob = new Blob(fileDataList, { type: 'video/MP2T' }) // 创建一个Blob对象,并设置文件的 MIME 类型
|
||||
a.download = fileName + '.ts'
|
||||
}
|
||||
a.href = URL.createObjectURL(fileBlob)
|
||||
a.style.display = 'none'
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
a.remove()
|
||||
},
|
||||
|
||||
// 格式化时间
|
||||
formatTime(date, formatStr) {
|
||||
const formatType = {
|
||||
Y: date.getFullYear(),
|
||||
M: date.getMonth() + 1,
|
||||
D: date.getDate(),
|
||||
h: date.getHours(),
|
||||
m: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
}
|
||||
return formatStr.replace(
|
||||
/Y+|M+|D+|h+|m+|s+/g,
|
||||
target => (new Array(target.length).join('0') + formatType[target[0]]).substr(-target.length)
|
||||
)
|
||||
},
|
||||
|
||||
// 强制下载现有片段
|
||||
forceDownload() {
|
||||
if (this.mediaFileList.length) {
|
||||
let fileName = this.title || this.formatTime(this.beginTime, 'YYYY_MM_DD hh_mm_ss')
|
||||
if(document.title !== 'm3u8 downloader'){
|
||||
fileName = this.getDocumentTitle()
|
||||
}
|
||||
this.downloadFile(this.mediaFileList, fileName)
|
||||
} else {
|
||||
alert('当前无已下载片段')
|
||||
}
|
||||
},
|
||||
|
||||
// 发生错误,进行提示
|
||||
alertError(tips) {
|
||||
alert(tips)
|
||||
this.downloading = false
|
||||
this.tips = 'm3u8 视频在线提取工具';
|
||||
},
|
||||
|
||||
// 拷贝本页面本身,解决跨域问题
|
||||
copyCode() {
|
||||
if (this.tips !== '代码下载中,请稍后') {
|
||||
this.tips = '代码下载中,请稍后';
|
||||
this.ajax({
|
||||
url: './index.html',
|
||||
success: (fileStr) => {
|
||||
let fileList = fileStr.split(`<!--vue 前端框架--\>`);
|
||||
let dom = fileList[0];
|
||||
let script = fileList[1] + fileList[2];
|
||||
script = script.split('// script注入');
|
||||
script = script[1] + script[2];
|
||||
|
||||
if (this.url) {
|
||||
script = script.replace(`url: '', // 在线链接`, `url: '${this.url}',`);
|
||||
}
|
||||
|
||||
let codeStr = `
|
||||
// 注入html
|
||||
let $section = document.createElement('section')
|
||||
$section.innerHTML = \`${dom}\`
|
||||
$section.style.width = '100%'
|
||||
$section.style.height = '800px'
|
||||
$section.style.top = '0'
|
||||
$section.style.left = '0'
|
||||
$section.style.position = 'relative'
|
||||
$section.style.zIndex = '9999'
|
||||
$section.style.backgroundColor = 'white'
|
||||
document.body.appendChild($section);
|
||||
|
||||
// 加载 ASE 解密
|
||||
let $ase = document.createElement('script')
|
||||
$ase.src = 'https://live.fanmingming.com/m3u8/aes-decryptor.js'
|
||||
|
||||
// 加载 mp4 转码
|
||||
let $mp4 = document.createElement('script')
|
||||
$mp4.src = 'https://live.fanmingming.com/m3u8/mux-mp4.js'
|
||||
|
||||
// 加载 vue
|
||||
let $vue = document.createElement('script')
|
||||
$vue.src = 'https://live.fanmingming.com/m3u8/vue.js'
|
||||
|
||||
// 加载 stream 流式下载器
|
||||
let $streamSaver = document.createElement('script')
|
||||
$streamSaver.src = 'https://live.fanmingming.com/m3u8/stream-saver.js'
|
||||
|
||||
// 监听 vue 加载完成,执行业务代码
|
||||
$vue.addEventListener('load', () => {${script}})
|
||||
document.body.appendChild($mp4);
|
||||
document.body.appendChild($ase);
|
||||
document.body.appendChild($streamSaver);
|
||||
document.body.appendChild($vue);
|
||||
alert('注入成功,请滚动到页面底部,若白屏则等待资源加载')
|
||||
`;
|
||||
this.copyToClipboard(codeStr);
|
||||
this.tips = '复制成功,打开视频网页控制台,注入本代码';
|
||||
},
|
||||
fail: () => {
|
||||
this.alertError('链接不正确,请查看链接是否有效');
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 拷贝剪切板
|
||||
copyToClipboard(content) {
|
||||
clearTimeout(this.timeouter)
|
||||
|
||||
if (!document.queryCommandSupported('copy')) {
|
||||
return false
|
||||
}
|
||||
|
||||
let $input = document.createElement('textarea')
|
||||
$input.style.opacity = '0'
|
||||
$input.value = content
|
||||
document.body.appendChild($input)
|
||||
$input.select()
|
||||
|
||||
const result = document.execCommand('copy')
|
||||
document.body.removeChild($input)
|
||||
$input = null
|
||||
|
||||
return result
|
||||
},
|
||||
|
||||
}
|
||||
})
|
||||
// script注入
|
||||
</script>
|
||||
</html>
|
||||
154
m3u8/mitm.html
Normal file
@@ -0,0 +1,154 @@
|
||||
<!-- 中间层页面,专门用于下载,在此页面中注册 serviceWorker,并实现拦截 -->
|
||||
<!-- 本页面存在的意义,在于隔离 web 主进程的请求,让 serviceWorker 仅拦截本页面的请求 -->
|
||||
|
||||
<!-- serviceWorker 完全异步,全程 API 均使用 Promise 完成异步操作 -->
|
||||
<script>
|
||||
// 保活,每 10s 执行一次 ping,避免 serviceWorker 被删除
|
||||
let keepAlive = () => {
|
||||
keepAlive = () => { }
|
||||
var ping = location.href.substr(0, location.href.lastIndexOf('/')) + '/ping'
|
||||
var interval = setInterval(() => {
|
||||
if (serviceWorker) {
|
||||
serviceWorker.postMessage('ping')
|
||||
} else {
|
||||
fetch(ping).then(res => res.text(!res.ok && clearInterval(interval)))
|
||||
}
|
||||
}, 10000)
|
||||
}
|
||||
|
||||
let scope = '' // 当前 serviceWorker 所在域,是其唯一标识符
|
||||
let serviceWorker = null // serviceWorker 实例
|
||||
let tempMessageStore = [] // 在处理函数未准备好之前,临时存储的 message
|
||||
|
||||
// 进入页面马上进行消息监听,再后续处理函数 ready 后,再触发这些 message 的处理
|
||||
window.onmessage = evt => tempMessageStore.push(evt)
|
||||
|
||||
// 注册 serviceWorker,检测是否有旧的实例,进行复用。
|
||||
function registerWorker() {
|
||||
// 获取 ./ 域下已经注册过的 serviceWorker,getRegistration 返回单个,getRegistrations 返回所有
|
||||
return navigator.serviceWorker.getRegistration('./')
|
||||
.then(serviceWorkerRegistration => {
|
||||
// 如果已经存在注册过的 serviceWorkerRegistration,则直接返回,否则产生新的一个
|
||||
return serviceWorkerRegistration || navigator.serviceWorker.register('serviceWorker.js', { scope: './' })
|
||||
}).then(serviceWorkerRegistration => {
|
||||
scope = serviceWorkerRegistration.scope // 保存所在域
|
||||
|
||||
// 如果注册已就绪,则直接赋值并返回
|
||||
if (serviceWorkerRegistration.active) {
|
||||
serviceWorker = serviceWorkerRegistration.active
|
||||
return
|
||||
}
|
||||
|
||||
// 如果处于注册中,返回 promise,并监听其状态变更,等待其就绪状态
|
||||
const swRegTmp = serviceWorkerRegistration.installing || serviceWorkerRegistration.waiting
|
||||
return new Promise(resolve => {
|
||||
const onStatechange = () => {
|
||||
if (swRegTmp.state === 'activated') {
|
||||
swRegTmp.removeEventListener('statechange', onStatechange)
|
||||
serviceWorker = serviceWorkerRegistration.active
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
swRegTmp.addEventListener('statechange', onStatechange)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 消息监听,监听 web 主进程发送过来的消息,并进行数据中转,及数据的处理与转译
|
||||
function onMessage(event) {
|
||||
let {
|
||||
data, // 数据
|
||||
ports, // channel 所在渠道
|
||||
origin // 消息作用域
|
||||
} = event
|
||||
|
||||
console.log('onMessage', event)
|
||||
|
||||
// 检测消息通道
|
||||
if (!ports || !ports.length) {
|
||||
throw new TypeError("[StreamSaver] You didn't send a messageChannel")
|
||||
}
|
||||
|
||||
// 检测接受的数据实体
|
||||
if (typeof data !== 'object') {
|
||||
throw new TypeError("[StreamSaver] You didn't send a object")
|
||||
}
|
||||
|
||||
// 检查 readableStream
|
||||
if (data.readableStream) {
|
||||
console.warn("[StreamSaver] You should send the readableStream in the messageChannel, not throught mitm")
|
||||
}
|
||||
|
||||
// 检查 pathname
|
||||
if (!data.pathname) {
|
||||
console.warn("[StreamSaver] Please send `data.pathname` (eg: /pictures/summer.jpg)")
|
||||
data.pathname = Math.random().toString().slice(-6) + '/' + data.filename
|
||||
}
|
||||
|
||||
|
||||
/** @since v2.0.0 */
|
||||
if (!data.headers) {
|
||||
console.warn("[StreamSaver] pass `data.headers` that you would like to pass along to the service worker\nit should be a 2D array or a key/val object that fetch's Headers api accepts")
|
||||
} else {
|
||||
// test if it's correct
|
||||
// should throw a typeError if not
|
||||
new Headers(data.headers)
|
||||
}
|
||||
|
||||
|
||||
// the default public service worker for StreamSaver is shared among others.
|
||||
// so all download links needs to be prefixed to avoid any other conflict
|
||||
data.origin = origin
|
||||
|
||||
// if we ever (in some feature versoin of streamsaver) would like to
|
||||
// redirect back to the page of who initiated a http request
|
||||
data.referrer = data.referrer || document.referrer || origin
|
||||
|
||||
// 删除所有前导斜杠
|
||||
data.pathname = data.pathname.replace(/^\/+/g, '')
|
||||
|
||||
// remove protocol
|
||||
// 去除协议
|
||||
let org = origin.replace(/(^\w+:|^)\/\//, '')
|
||||
|
||||
// 设置绝对路径,以用于下载
|
||||
data.url = new URL(`${scope + org}/${data.pathname}`).toString()
|
||||
|
||||
// 检查路径是否合法
|
||||
if (!data.url.startsWith(`${scope + org}/`)) {
|
||||
throw new TypeError('[StreamSaver] bad `data.pathname`')
|
||||
}
|
||||
|
||||
// This sends the message data as well as transferring
|
||||
// messageChannel.port2 to the service worker. The service worker can
|
||||
// then use the transferred port to reply via postMessage(), which
|
||||
// will in turn trigger the onmessage handler on messageChannel.port1.
|
||||
|
||||
const transferable = data.readableStream
|
||||
? [ports[0], data.readableStream]
|
||||
: [ports[0]]
|
||||
|
||||
if (!(data.readableStream || data.transferringReadable)) {
|
||||
keepAlive()
|
||||
}
|
||||
|
||||
// 将从 web 主进程接收到的数据,传输给 serviceWorker 接收
|
||||
return serviceWorker.postMessage(data, transferable)
|
||||
}
|
||||
|
||||
// 消息回调,告知主进程,本页面已准备就绪
|
||||
if (window.opener) {
|
||||
window.opener.postMessage('StreamSaver::loadedPopup', '*')
|
||||
}
|
||||
|
||||
// 注册完成,并进行消息处理
|
||||
if (navigator.serviceWorker) {
|
||||
registerWorker().then(() => {
|
||||
window.onmessage = onMessage
|
||||
tempMessageStore.forEach(window.onmessage) // 将之前临时存储的 message 放入处理函数中执行
|
||||
})
|
||||
} else {
|
||||
keepAlive()
|
||||
}
|
||||
|
||||
</script>
|
||||
7051
m3u8/mux-mp4.js
Normal file
164
m3u8/serviceworker.js
Normal file
@@ -0,0 +1,164 @@
|
||||
// Service workers 本质上充当 Web 应用程序、浏览器与网络(可用时)之间的代理服务器。
|
||||
// 它会拦截网络请求并根据网络是否可用来采取适当的动作、更新来自服务器的的资源
|
||||
// 相当于网页端的正向代理,监听用户请求
|
||||
|
||||
// Service worker 是一个注册在指定源和路径下的事件驱动 worker
|
||||
// Service workers 只能由 HTTPS 承载,毕竟修改网络请求的能力暴露给中间人攻击会非常危险。
|
||||
|
||||
// self 在 web 主线程中等价于 windows,但 worker 是无窗口(no-window)环境,没有 window、需要通过 self 指向全局环境
|
||||
// self 是 worker 中的全局对象,https://www.zhangxinxu.com/wordpress/2017/07/js-window-self/
|
||||
|
||||
// 整体运行流程,
|
||||
// 数据存储,stream -> mitm -> serviceWorker 进行存储;
|
||||
// 数据下载 mitm 发起请求,serviceWorker 监听请求,并返回二进制流。
|
||||
// serviceWorker 存在的意义,本质上在主进程层面,不支持流式下载,需要将完整的资源保存后才下载。
|
||||
// 而在 URL 层面,将请求交给 浏览器运行时,浏览器能自动识别 application/octet-stream 响应类型,触发下载
|
||||
// 且 new Response 可以传入 读写流 stream,实现流式数据传输,进行流式下载
|
||||
|
||||
// 所以本 serviceWorker 只会被触发两次,一次是 onMessage 监听初始化,一次是 onFetch 拦截请求,触发下载
|
||||
|
||||
// 通过 href 触发下载后,下载流程就由 ReadableStream 控制。
|
||||
// 即整个下载过程就是 ReadableStream 的生命周期,ReadableStream 这个流代表了下载进程
|
||||
// ReadableStream 通过 enqueue 函数,往下载进程中填充内容。
|
||||
|
||||
// url 与 data 的映射 map
|
||||
const urlDataMap = new Map()
|
||||
|
||||
// 创建数据读取流
|
||||
function createStream (port) {
|
||||
// 数据读取流
|
||||
return new ReadableStream({
|
||||
// controller 是 ReadableStreamDefaultController,https://developer.mozilla.org/zh-CN/docs/Web/API/ReadableStreamDefaultController
|
||||
start (controller) {
|
||||
// 监听 messageChannel port 的消息,获取传递过来,需要下载的数据
|
||||
port.onmessage = ({ data }) => {
|
||||
// 接受结束事件,关闭流
|
||||
if (data === 'end') {
|
||||
return controller.close()
|
||||
}
|
||||
|
||||
// 终止事件
|
||||
if (data === 'abort') {
|
||||
controller.error('Aborted the download')
|
||||
return
|
||||
}
|
||||
|
||||
// 将数据推送到队列中,等待下载
|
||||
controller.enqueue(data)
|
||||
}
|
||||
},
|
||||
// 取消
|
||||
cancel (reason) {
|
||||
console.log('user aborted', reason)
|
||||
port.postMessage({ abort: true })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 监听 worker 注册完成事件,service worker 中所有状态如下:https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/state
|
||||
self.addEventListener('install', () => {
|
||||
// 如果现有 service worker 已启用,新版本会在后台安装,但不会被激活,这个时序称为 worker in waiting。直到所有已加载的页面不再使用旧的 service worker 才会激活新的 service worker。只要页面不再依赖旧的 service worker,新的 service worker 会被激活(成为active worker)。
|
||||
// 跳过等待环节,直接让当前 worker 为活跃状态,不再等待之前就得 worker 失效
|
||||
self.skipWaiting()
|
||||
})
|
||||
|
||||
// 监听当前为用状态事件
|
||||
self.addEventListener('activate', event => {
|
||||
// self.clients 获取当前 worker 的客户端对象,可能是 web 主进程,也可能是其他的 worker 对象。
|
||||
// self.clients.claim() 将当前 worker 本身设置为所有 clients 的控制器,即从旧的 worker 中将控制权拿过来
|
||||
event.waitUntil(self.clients.claim()) // 保持当前状态为 activate 可用状态,直到
|
||||
})
|
||||
|
||||
// 进行消息监听,监听外部传递进来的事件
|
||||
self.onmessage = event => {
|
||||
const data = event.data // 正则传输的数据
|
||||
const port = event.ports[0] // channelPort 端口,传递该消息时
|
||||
|
||||
// 跳过 ping 心跳检查事件
|
||||
if (data === 'ping') {
|
||||
return
|
||||
}
|
||||
|
||||
// 触发该数据下载对应的 url
|
||||
const downloadUrl = data.url || self.registration.scope + Math.random() + '/' + (typeof data === 'string' ? data : data.filename)
|
||||
|
||||
const metadata = new Array(3) // [stream, data, port]
|
||||
|
||||
metadata[1] = data
|
||||
metadata[2] = port
|
||||
|
||||
// Note to self:
|
||||
// old streamsaver v1.2.0 might still use `readableStream`...
|
||||
// but v2.0.0 will always transfer the stream through MessageChannel #94
|
||||
if (data.readableStream) {
|
||||
metadata[0] = data.readableStream
|
||||
} else if (data.transferringReadable) { // 如果支持 TransformStream,则使用 TransformStream 双向流完成下载数据传输,关闭 messageChannel 的传输
|
||||
port.onmessage = evt => {
|
||||
port.onmessage = null
|
||||
metadata[0] = evt.data.readableStream
|
||||
}
|
||||
} else {
|
||||
// 如果没有外部传入的 readStream 对象,则自己创建一个,且本质是通过 messageChannel 进行数据监听与数据传输
|
||||
metadata[0] = createStream(port)
|
||||
}
|
||||
|
||||
// 进行数据与 url 的映射记录
|
||||
urlDataMap.set(downloadUrl, metadata)
|
||||
|
||||
// 进行消息响应,返回下载地址
|
||||
port.postMessage({ download: downloadUrl })
|
||||
}
|
||||
|
||||
// service worker 的主要监听器,拦截监听该 web 下发起的所有网络请求,https://developer.mozilla.org/zh-CN/docs/Web/API/FetchEvent
|
||||
// 实际上,该 onfetch 除去 ping 请求外,只会被触发一次,用于拦截下载请求。
|
||||
// 下载请求,则返回一个 二进制流 响应,触发浏览器下载。
|
||||
self.onfetch = event => {
|
||||
// event request 获得 web 发起的请求对象,https://developer.mozilla.org/zh-CN/docs/Web/API/FetchEvent/request
|
||||
const url = event.request.url
|
||||
|
||||
// 仅在 Firefox 中有效,监听到 心跳检查 ping 请求
|
||||
if (url.endsWith('/ping')) {
|
||||
return event.respondWith(new Response('pong'))
|
||||
}
|
||||
|
||||
const urlCacheData = urlDataMap.get(url) // 获取之前缓存的 url 映射的信息
|
||||
|
||||
if (!urlCacheData) return null
|
||||
|
||||
const [
|
||||
stream, // 需要下载的数据二进制流
|
||||
data, // 配置信息
|
||||
port // 端口
|
||||
] = urlCacheData
|
||||
|
||||
urlDataMap.delete(url)
|
||||
|
||||
// 构造响应体,并只获取外部传入的 Content-Length 和 Content-Disposition 这两个响应头
|
||||
const responseHeaders = new Headers({
|
||||
'Content-Type': 'application/octet-stream; charset=utf-8', // 将响应格式设置为二进制流
|
||||
|
||||
// // 一些安全设置
|
||||
'Content-Security-Policy': "default-src 'none'",
|
||||
'X-Content-Security-Policy': "default-src 'none'",
|
||||
'X-WebKit-CSP': "default-src 'none'",
|
||||
'X-XSS-Protection': '1; mode=block'
|
||||
})
|
||||
|
||||
// 通过 data.headers 配置,生成 headers 对象,获取其内部值
|
||||
let headers = new Headers(data.headers || {})
|
||||
|
||||
// 设置长度
|
||||
if (headers.has('Content-Length')) {
|
||||
responseHeaders.set('Content-Length', headers.get('Content-Length'))
|
||||
}
|
||||
|
||||
// 指示回复的内容该以何种形式展示,是以内联的形式(即网页或者页面的一部分),还是以附件的形式下载并保存到本地。https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Content-Disposition
|
||||
if (headers.has('Content-Disposition')) {
|
||||
responseHeaders.set('Content-Disposition', headers.get('Content-Disposition'))
|
||||
}
|
||||
|
||||
// 针对该请求进行响应
|
||||
event.respondWith(new Response(stream, { headers: responseHeaders }))
|
||||
|
||||
port.postMessage({ debug: 'Download started' })
|
||||
}
|
||||
262
m3u8/stream-saver.js
Normal file
@@ -0,0 +1,262 @@
|
||||
(function () {
|
||||
|
||||
// 下载代理,使用 iframe,还是 navigate
|
||||
const downloadStrategy =
|
||||
window.isSecureContext // window.isSecureContext 判断是否为 https、wss 等安全环境
|
||||
|| 'MozAppearance' in document.documentElement.style // 是否为 firefox 浏览器
|
||||
? 'iframe' : 'navigate'
|
||||
|
||||
// 中间传输器
|
||||
let middleTransporter = null
|
||||
|
||||
// 是否使用 blob 替换 service worker 的能力
|
||||
// safari 不支持流式下载功能,https://github.com/jimmywarting/StreamSaver.js/issues/69
|
||||
let useBlobFallback = /constructor/i.test(window.HTMLElement) || !!window.safari || !!window.WebKitPoint
|
||||
try {
|
||||
new Response(new ReadableStream())
|
||||
if (window.isSecureContext && !('serviceWorker' in navigator)) {
|
||||
useBlobFallback = true
|
||||
}
|
||||
} catch (err) {
|
||||
useBlobFallback = true
|
||||
}
|
||||
|
||||
// 是否支持转换器传输流 TransformStream,支持则直接使用他的读写流,完成下载数据的传输。都在需要通过 messageChannel 进行数据传输
|
||||
let isSupportTransformStream = false
|
||||
try {
|
||||
const { readable } = new TransformStream() // 创建读写传输流
|
||||
const messageChannel = new MessageChannel() // 创建消息通道,与 iframe 或 window.open 新建的页面中进行消息通信
|
||||
messageChannel.port1.postMessage(readable, [readable])
|
||||
messageChannel.port1.close()
|
||||
messageChannel.port2.close()
|
||||
isSupportTransformStream = true
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
// 创建一个隐藏式的 Iframe,并通过 iframe 的 postMessage 进行消息传输
|
||||
function makeIframe(src) {
|
||||
console.log('makeIframe', src)
|
||||
const iframe = document.createElement('iframe')
|
||||
iframe.hidden = true
|
||||
iframe.src = src
|
||||
iframe.loaded = false
|
||||
iframe.name = 'iframe'
|
||||
iframe.isIframe = true
|
||||
// 调用 iframe 中的 postMessage 方法,即从 iframe 中发送消息
|
||||
iframe.postMessage = (...args) => iframe.contentWindow.postMessage(...args)
|
||||
iframe.addEventListener('load', () => {
|
||||
iframe.loaded = true
|
||||
}, { once: true }) // 该事件监听器只监听一次,自动回收
|
||||
document.body.appendChild(iframe)
|
||||
return iframe
|
||||
}
|
||||
|
||||
// 创建一个弹出窗口,模拟iframe的基本功能
|
||||
// 使用 popup 新建弹窗,来模拟 iframe 的跨页面消息传输功能
|
||||
function makePopup(src) {
|
||||
console.log('makePopup', src)
|
||||
// 事件代理器,使用 createDocumentFragment 来实现 popup 中的消息监听效果。
|
||||
// 与 document 相比,最大的区别是它不是真实 DOM 树的一部分,它的变化不会触发 DOM 树的重新渲染,且不会对性能产生影响。
|
||||
const delegate = document.createDocumentFragment()
|
||||
const popup = {
|
||||
frame: window.open(src, 'popupTitle', 'width=200,height=100'),
|
||||
loaded: false,
|
||||
isIframe: false,
|
||||
isPopup: true,
|
||||
remove() { popup.frame.close() },
|
||||
// 适配器模式,使得 popup 对象与 iframe 对象有一样的表现。发送事件,监听事件,移除事件
|
||||
dispatchEvent(...args) { delegate.dispatchEvent(...args) },
|
||||
addEventListener(...args) { delegate.addEventListener(...args) },
|
||||
removeEventListener(...args) { delegate.removeEventListener(...args) },
|
||||
// 调用
|
||||
postMessage(...args) { popup.frame.postMessage(...args) }
|
||||
}
|
||||
|
||||
// 监听 popup 是否就绪
|
||||
const onReady = evt => {
|
||||
// 如果接受到来自 popup 的事件,则证明 popup 已就绪
|
||||
if (evt.source === popup.frame) {
|
||||
popup.loaded = true
|
||||
window.removeEventListener('message', onReady)
|
||||
popup.dispatchEvent(new Event('load'))
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('message', onReady)
|
||||
|
||||
return popup
|
||||
}
|
||||
|
||||
// 创建写入流
|
||||
function createWriteStream(filename) {
|
||||
let bytesWritten = 0 // 记录已写入的文件大小
|
||||
let downloadUrl = null // 触发下载时,需要访问的 url 地址
|
||||
let messageChannel = null // 消息传输通道
|
||||
let transformStream = null // 中间传输流
|
||||
|
||||
if (!useBlobFallback) {
|
||||
// middleTransporter = middleTransporter || makeIframe(streamSaver.middleTransporterUrl) // https 环境下,则执行 iframe
|
||||
middleTransporter = middleTransporter || window.isSecureContext
|
||||
? makeIframe(streamSaver.middleTransporterUrl) // https 环境下,则执行 iframe
|
||||
: makePopup(streamSaver.middleTransporterUrl) // 普通环境下,则通过 window.open 新建弹窗来完成
|
||||
|
||||
messageChannel = new MessageChannel() // 创建消息通道
|
||||
|
||||
// 处理文件名,使其为 url 格式
|
||||
filename = encodeURIComponent(filename.replace(/\//g, ':'))
|
||||
.replace(/['()]/g, escape)
|
||||
.replace(/\*/g, '%2A')
|
||||
|
||||
// 如果支持 TransformStream,则将 TransformStream.readStream 传递给 port2
|
||||
if (isSupportTransformStream) {
|
||||
transformStream = new TransformStream(downloadStrategy === 'iframe' ? undefined : {
|
||||
// 流处理,中间转换器,监听每一个流分片的经过
|
||||
transform(chunk, controller) {
|
||||
// 传输的内容,仅支持 Uint8Arrays 格式
|
||||
if (!(chunk instanceof Uint8Array)) {
|
||||
throw new TypeError('Can only write Uint8Arrays')
|
||||
}
|
||||
bytesWritten += chunk.length // 记录已写入的内容消大小
|
||||
controller.enqueue(chunk) // 将消息推进队列
|
||||
|
||||
if (downloadUrl) {
|
||||
location.href = downloadUrl // 由于在 response 中设置了返回类型为二进制流,可直接触发其下载。不会发生跳转
|
||||
downloadUrl = null
|
||||
}
|
||||
},
|
||||
|
||||
// 结束写入时调用,如果数据量少,未经过 transform 就触发了 flush,则调用 location.href 触发下载
|
||||
flush() {
|
||||
if (downloadUrl) {
|
||||
location.href = downloadUrl
|
||||
}
|
||||
}
|
||||
})
|
||||
// 使用 port1 传递数据,将读数据端通过 channel Message 传递给 service worker
|
||||
// 由 write 暴露写端,供主线程写入数据。再在 service worker 中,通过 readStream 读取该数据。完成下载数据的传输。
|
||||
// 即下载数据,不需要通过 channel message 传输,而是通过 transformStream 进行传递。
|
||||
messageChannel.port1.postMessage({ readableStream: transformStream.readable }, [transformStream.readable])
|
||||
}
|
||||
|
||||
// 监听给 port1 传递的消息
|
||||
messageChannel.port1.onmessage = evt => {
|
||||
// 接受 Service worker 发送的 url,并访问它
|
||||
if (evt.data.download) {
|
||||
// 为 popup 做的特殊处理
|
||||
if (downloadStrategy === 'navigate') {
|
||||
// 中间人完成使命,则删除中间人,后续传输通过 channelMessage,直接由主进程与 service worker 进行通信
|
||||
middleTransporter.remove()
|
||||
middleTransporter = null
|
||||
// 首次访问该 url
|
||||
if (bytesWritten) {
|
||||
location.href = evt.data.download
|
||||
} else {
|
||||
downloadUrl = evt.data.download
|
||||
}
|
||||
} else {
|
||||
if (middleTransporter.isPopup) {
|
||||
middleTransporter.remove()
|
||||
middleTransporter = null
|
||||
// Special case for firefox, they can keep sw alive with fetch
|
||||
if (downloadStrategy === 'iframe') {
|
||||
makeIframe(streamSaver.middleTransporterUrl)
|
||||
}
|
||||
}
|
||||
|
||||
makeIframe(evt.data.download)
|
||||
}
|
||||
} else if (evt.data.abort) { // 消息终止
|
||||
chunks = []
|
||||
messageChannel.port1.postMessage('abort') //send back so controller is aborted
|
||||
messageChannel.port1.onmessage = null
|
||||
messageChannel.port1.close()
|
||||
messageChannel.port2.close()
|
||||
messageChannel = null
|
||||
}
|
||||
}
|
||||
|
||||
// 往中间人容器中发送消息,将 messageChannel.port2 传递给中间人
|
||||
const response = {
|
||||
transferringReadable: isSupportTransformStream,
|
||||
pathname: Math.random().toString().slice(-6) + '/' + filename,
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream; charset=utf-8',
|
||||
'Content-Disposition': "attachment; filename*=UTF-8''" + filename
|
||||
}
|
||||
}
|
||||
if (middleTransporter.loaded) {
|
||||
middleTransporter.postMessage(response, '*', [messageChannel.port2])
|
||||
} else {
|
||||
middleTransporter.addEventListener('load', () => {
|
||||
middleTransporter.postMessage(response, '*', [messageChannel.port2])
|
||||
}, { once: true })
|
||||
}
|
||||
}
|
||||
|
||||
let chunks = [] // 需要传输下载的内容数组
|
||||
|
||||
// 如果有 transformStream,则直接返回 transformStream 读写流的 WritableStream 实例
|
||||
if (!useBlobFallback && transformStream && transformStream.writable) {
|
||||
// writable 返回由这个 TransformStream 控制的 WritableStream 实例。
|
||||
// writable 返回的是一个实例,而不是一个 boolean 值
|
||||
return transformStream.writable
|
||||
}
|
||||
|
||||
// 如果不支持 transformStream,则自行创建一个 WritableStream,监听 WritableStream 的写入事件。将数据通过 messageChannel 的两个 port 进行传输
|
||||
return new WritableStream({
|
||||
// 写入数据
|
||||
write(chunk) {
|
||||
// 检查写入流,仅支持 Uint8Arrays 格式
|
||||
if (!(chunk instanceof Uint8Array)) {
|
||||
throw new TypeError('Can only write Uint8Arrays')
|
||||
}
|
||||
|
||||
// 如果使用 blob 功能进行下载,则仅存储该数据,无法使用流式边获取数据边下载
|
||||
if (useBlobFallback) {
|
||||
chunks.push(chunk)
|
||||
return
|
||||
}
|
||||
|
||||
// service worker 可用,则通过信道传输该二进制流
|
||||
messageChannel.port1.postMessage(chunk)
|
||||
bytesWritten += chunk.length
|
||||
|
||||
if (downloadUrl) {
|
||||
location.href = downloadUrl
|
||||
downloadUrl = null
|
||||
}
|
||||
},
|
||||
|
||||
// 关闭写入流,将流式文件进行保存
|
||||
close() {
|
||||
// 使用 blob 实现功能,则将所有片段当做 blob 的内容,通过 createObjectURL 生成其链接,点击触发下载
|
||||
if (useBlobFallback) {
|
||||
const blob = new Blob(chunks, { type: 'application/octet-stream; charset=utf-8' })
|
||||
const link = document.createElement('a')
|
||||
link.href = URL.createObjectURL(blob)
|
||||
link.download = filename
|
||||
link.click()
|
||||
} else { // service worker 有效,则仅发出 end 事件,由 service worker 执行结束操作
|
||||
messageChannel.port1.postMessage('end')
|
||||
}
|
||||
},
|
||||
|
||||
// 中断,不执行下载
|
||||
abort() {
|
||||
chunks = []
|
||||
messageChannel.port1.postMessage('abort')
|
||||
messageChannel.port1.onmessage = null
|
||||
messageChannel.port1.close()
|
||||
messageChannel.port2.close()
|
||||
messageChannel = null
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 全局挂载 streamSaver 对象
|
||||
window.streamSaver = {
|
||||
createWriteStream, // 创建写流
|
||||
middleTransporterUrl: 'https://live.fanmingming.com/m3u8/mitm.html',
|
||||
}
|
||||
})()
|
||||
11943
m3u8/vue.js
Normal file
185
player/cq/index.html
Normal file
@@ -0,0 +1,185 @@
|
||||
<html>
|
||||
<script src="jquery-1.8.3.min.js"></script>
|
||||
<script src="md5.min.js"></script>
|
||||
<script language="javascript">
|
||||
var vid = location.href.split('html?id=')[1];
|
||||
var n = [];
|
||||
n['cctv1'] = 'cctv1HD'; //CCTV1
|
||||
n['cctv2'] = 'cctv2HD'; //CCTV2
|
||||
n['cctv3'] = 'cctv3HD'; //CCTV3
|
||||
n['cctv4'] = 'cctv4HD'; //CCTV4
|
||||
n['cctv5'] = 'cctv5HD'; //CCTV5
|
||||
n['cctv5p'] = 'cctv5SportHD'; //CCTV5+
|
||||
n['cctv6'] = 'cctv6HD'; //CCTV6
|
||||
n['cctv7'] = 'cctv7HD'; //CCTV7
|
||||
n['cctv8'] = 'cctv8HD'; //CCTV8
|
||||
n['cctv9'] = 'cctv9HD'; //CCTV9
|
||||
n['cctv10'] = 'cctv10HD'; //CCTV10
|
||||
n['cctv11'] = 'cctv11HD'; //CCTV11
|
||||
n['cctv12'] = 'cctv12HD'; //CCTV12
|
||||
n['cctv13'] = 'CCTVNewsHD'; //CCTV13
|
||||
n['cctv14'] = 'cctvseHD'; //CCTV14
|
||||
n['cctv15'] = 'cctv15HD'; //CCTV15
|
||||
n['cctv16'] = 'cctv16HD'; //CCTV16
|
||||
n['cctv164k'] = 'CCTV16_4K'; //CCTV16-4K
|
||||
n['cctv17'] = 'cctv17HD'; //CCTV17
|
||||
n['cctv4k'] = 'CCTV4K'; //CCTV4K
|
||||
n['bqkj'] = 'bqkjHD'; //CCTV兵器科技
|
||||
n['dyjc'] = 'diyijuchangHD'; //CCTV第一剧场
|
||||
n['hjjc'] = 'hjjcHD'; //CCTV怀旧剧场
|
||||
n['fyjc'] = 'fyjcHD'; //CCTV风云剧场
|
||||
n['fyjc2'] = 'shandongHD'; //CCTV风云剧场2
|
||||
n['fyyy'] = 'fyyyHD'; //CCTV风云音乐
|
||||
n['fyzq'] = 'fyzqHD'; //CCTV风云足球
|
||||
n['whjp'] = 'yswhHD'; //CCTV央视文化精品
|
||||
n['gefwq'] = 'golfHD'; //CCTV高尔夫网球
|
||||
n['nxss'] = 'nvxing'; //CCTV女性时尚
|
||||
n['ystq'] = 'ystqHD'; //CCTV央视台球
|
||||
n['yggw'] = 'yggw'; //央广购物
|
||||
n['zsgw'] = 'ysgw'; //中视购物*
|
||||
|
||||
n['zxs'] = 'qicai'; //中央新影-中学生
|
||||
n['fxzl'] = 'faxian'; //中央新影-发现之旅
|
||||
n['lgs'] = 'gushi'; //中央新影-老故事
|
||||
n['sh'] = 'shuhua'; //书画
|
||||
n['zgtq'] = 'tianqiSD'; //中国气象
|
||||
|
||||
n['cgtn'] = 'cgtnSD'; //CGTN
|
||||
|
||||
n['cetv1'] = 'cetv-1SD'; //CETV1中教1台
|
||||
n['cetv4'] = 'cetv-4SD'; //CETV4中教4台
|
||||
n['zqjy'] = 'zaojiaoHD'; //CETV早期教育
|
||||
|
||||
n['chcgq'] = 'chcgqdyHD'; //CHC高清电影
|
||||
n['chcdz'] = 'chcdzdyHD'; //CHC动作电影
|
||||
n['chcjt'] = 'chcjtyyHD'; //CHC家庭影院
|
||||
|
||||
n['bjws'] = 'beijingHD'; //北京卫视
|
||||
n['dfws'] = 'shanghaiHD'; //东方卫视
|
||||
n['tjws'] = 'tianjinHD'; //天津卫视
|
||||
n['cqws'] = 'chongqingHD'; //重庆卫视
|
||||
n['hljws'] = 'heilongjiangHD'; //黑龙江卫视
|
||||
n['jlws'] = 'jilinHD'; //吉林卫视
|
||||
n['lnws'] = 'liaoningHD'; //辽宁卫视
|
||||
n['nmws'] = 'neimengkuSD'; //内蒙古卫视
|
||||
n['nxws'] = 'ningxia'; //宁夏卫视
|
||||
n['qhws'] = 'qinghaiSD'; //青海卫视
|
||||
n['hbws'] = 'hebeiSD'; //河北卫视
|
||||
n['sxiws'] = 'shanxiSD'; //山西卫视
|
||||
n['ahws'] = 'anhuiSD'; //安徽卫视
|
||||
n['hnws'] = 'henanHD'; //河南卫视
|
||||
n['hubws'] = 'hubeiSD'; //湖北卫视
|
||||
n['hunws'] = 'hunanHD'; //湖南卫视
|
||||
n['jxws'] = 'jiangxiHD'; //江西卫视
|
||||
n['jsws'] = 'jiangsuHD'; //江苏卫视
|
||||
n['zjws'] = 'zhejiangHD'; //浙江卫视
|
||||
n['dnws'] = 'dongnanHD'; //东南卫视
|
||||
n['gdws'] = 'guangdongHD'; //广东卫视
|
||||
n['szws'] = 'shenzhenHD'; //深圳卫视
|
||||
n['gxws'] = 'guangxiHD'; //广西卫视
|
||||
n['ynws'] = 'yunnanSD'; //云南卫视
|
||||
n['gzws'] = 'guizhouHD'; //贵州卫视
|
||||
n['scws'] = 'sichuanHD'; //四川卫视
|
||||
n['xjws'] = 'xinjiangSD'; //新疆卫视
|
||||
n['btws'] = 'bingtuanSD'; //兵团卫视
|
||||
n['xzws'] = 'xizangSD'; //西藏卫视
|
||||
n['hinws'] = 'hainanSD'; //海南卫视
|
||||
n['ssws'] = 'sanshaSD'; //三沙卫视
|
||||
|
||||
n['bjjskj'] = 'bjayjsSD'; //北京纪实科教
|
||||
n['bjkk'] = 'bjkakuSD'; //卡酷少儿
|
||||
n['zhtc'] = 'techan'; //中华特产
|
||||
n['sthj'] = 'shengtai'; //生态环境
|
||||
n['shdy'] = 'diaoyu'; //四海钓鱼
|
||||
n['cmpd'] = 'doxtv'; //车迷频道
|
||||
n['bxjk'] = 'jiankangSD'; //百姓健康
|
||||
n['hqqg'] = 'car'; //环球奇观
|
||||
n['hqly'] = 'huanqiulvyou'; //环球旅游
|
||||
n['yybb'] = 'youxi'; //优优宝贝
|
||||
n['jshqjx'] = 'jusha'; //聚鲨环球精选*
|
||||
|
||||
n['dfcj'] = 'dfcj'; //东方财经
|
||||
n['hxjc4k'] = 'hxjc_4K'; //欢笑剧场4K
|
||||
n['dsjc'] = 'dsjcHD'; //都市剧场
|
||||
n['mlzq'] = 'mlzqHD'; //魅力足球
|
||||
n['dmxc'] = 'dmxcHD'; //动漫秀场
|
||||
n['yxfy'] = 'yxfyHD'; //游戏风云
|
||||
n['shss'] = 'shenghuo'; //生活时尚
|
||||
n['fztd'] = 'fazhi'; //法治天地
|
||||
n['jsxt'] = 'jinse'; //金色学堂
|
||||
|
||||
n['cqxw'] = 'CQTVNewsHD'; //重庆新闻
|
||||
n['cqkj'] = 'CQTVkejiaoHD'; //重庆科教
|
||||
n['cqys'] = 'cqyingshiHD'; //重庆影视
|
||||
n['cqwtyl'] = 'cqwtylHD'; //重庆文体娱乐
|
||||
n['cqse'] = 'cqseHD'; //重庆少儿
|
||||
n['cqsssh'] = 'cqssgwHD'; //重庆时尚生活
|
||||
n['cqxnc'] = 'cqggncHD'; //重庆新农村
|
||||
n['cqqm'] = 'cqcarSD'; //重庆汽摩
|
||||
n['cqsf'] = 'CQTVTrendyHD'; //重庆社会与法
|
||||
n['cqyd'] = 'mryyHD'; //重庆移动
|
||||
n['cgrm'] = 'cqrongmei'; //重广融媒
|
||||
n['akds'] = 'aikanHD'; //爱看导视
|
||||
|
||||
n['hczh'] = 'hechuan'; //合川综合
|
||||
n['cszh'] = 'changshou'; //长寿综合
|
||||
n['yyxwzh'] = 'youyang'; //酉阳综合*
|
||||
n['xszh'] = 'xiushan'; //秀山综合
|
||||
n['qjzh'] = 'qianjiang'; //黔江综合
|
||||
n['wszh'] = 'wushanzhSD'; //巫山综合x
|
||||
n['flzh'] = 'fulingzh'; //涪陵综合x
|
||||
n['yyzh'] = 'jiangjinHD'; //云阳综合*
|
||||
n['tlzh'] = 'tongliangzongheHD'; //铜梁综合
|
||||
n['rczh'] = 'rongchangHD'; //荣昌综合
|
||||
n['wxzh'] = 'wlzh'; //巫溪综合
|
||||
|
||||
n['jygw'] = 'jygw'; //家有购物
|
||||
|
||||
n['wlqp'] = 'qipai'; //网络棋牌
|
||||
n['xdm'] = 'dongman'; //新动漫
|
||||
|
||||
n['zqfw'] = 'jiazheng'; //证券服务
|
||||
|
||||
n['ygw'] = 'jyougouwu'; //优购物*
|
||||
|
||||
n['sdjy'] = 'sdjiaoyuSD'; //山东教育
|
||||
n['sctx'] = 'soucang'; //收藏天下
|
||||
|
||||
n['jjgw'] = 'jjgw'; //家家购物
|
||||
|
||||
n['gxpd'] = 'guoxue'; //国学频道
|
||||
|
||||
n['klcd'] = 'klcdHD'; //快乐垂钓
|
||||
n['jykt'] = 'jinyingSD'; //金鹰卡通
|
||||
n['xfpy'] = 'xianfeng'; //先锋乒羽
|
||||
|
||||
n['fsgw'] = 'fsgw'; //风尚购物
|
||||
|
||||
n['jslz'] = 'liang'; //江苏靓妆
|
||||
n['cftx'] = 'caifu'; //财富天下
|
||||
|
||||
n['tywq'] = 'weiqi'; //天元围棋
|
||||
n['sy'] = 'sheying'; //摄影频道
|
||||
|
||||
n['fhzw'] = 'xfjcHD'; //凤凰中文
|
||||
n['fhzx'] = 'xfylHD'; //凤凰资讯
|
||||
n['qsjl'] = 'qsjlHD'; //求索纪录
|
||||
|
||||
timestamps = new Date().getTime();
|
||||
sign = md5('aIErXY1rYjSpjQs7pq2Gp5P8k2W7P^Y@appIdkdds-chongqingdemocityId5AplayId' + n[vid] + 'relativeId' + n[vid] + 'timestamps' + timestamps + 'type1');
|
||||
url = 'http://portal.centre.bo.cbnbn.cn/others/common/playUrlNoAuth?cityId=5A&playId='+n[vid]+'&relativeId='+n[vid]+'&type=1';
|
||||
$.ajax({
|
||||
type:'get',
|
||||
url:url,
|
||||
headers:{"appId": "kdds-chongqingdemo","sign": sign,"timestamps":timestamps},
|
||||
success:function(res){
|
||||
m3u8 = res.data.result.protocol[0].transcode[0].url;
|
||||
if(vid == 'cctv4k'||vid == 'cctv16_4k'||vid == 'hxjc4k'){
|
||||
location.href = '/player/hls.html?vurl=' +m3u8;
|
||||
} else {
|
||||
location.href = '/player/?vurl=' +m3u8;
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
4208
player/cq/jquery-1.8.3.min.js
vendored
Normal file
161
player/cq/md5.min.js
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
!
|
||||
function(n) {
|
||||
"use strict";
|
||||
function t(n, t) {
|
||||
var r = (65535 & n) + (65535 & t),
|
||||
e = (n >> 16) + (t >> 16) + (r >> 16);
|
||||
return e << 16 | 65535 & r
|
||||
}
|
||||
function r(n, t) {
|
||||
return n << t | n >>> 32 - t
|
||||
}
|
||||
function e(n, e, o, u, c, f) {
|
||||
return t(r(t(t(e, n), t(u, f)), c), o)
|
||||
}
|
||||
function o(n, t, r, o, u, c, f) {
|
||||
return e(t & r | ~t & o, n, t, u, c, f)
|
||||
}
|
||||
function u(n, t, r, o, u, c, f) {
|
||||
return e(t & o | r & ~o, n, t, u, c, f)
|
||||
}
|
||||
function c(n, t, r, o, u, c, f) {
|
||||
return e(t ^ r ^ o, n, t, u, c, f)
|
||||
}
|
||||
function f(n, t, r, o, u, c, f) {
|
||||
return e(r ^ (t | ~o), n, t, u, c, f)
|
||||
}
|
||||
function i(n, r) {
|
||||
n[r >> 5] |= 128 << r % 32,
|
||||
n[(r + 64 >>> 9 << 4) + 14] = r;
|
||||
var e, i, a, h, d, l = 1732584193,
|
||||
g = -271733879,
|
||||
v = -1732584194,
|
||||
m = 271733878;
|
||||
for (e = 0; e < n.length; e += 16) i = l,
|
||||
a = g,
|
||||
h = v,
|
||||
d = m,
|
||||
l = o(l, g, v, m, n[e], 7, -680876936),
|
||||
m = o(m, l, g, v, n[e + 1], 12, -389564586),
|
||||
v = o(v, m, l, g, n[e + 2], 17, 606105819),
|
||||
g = o(g, v, m, l, n[e + 3], 22, -1044525330),
|
||||
l = o(l, g, v, m, n[e + 4], 7, -176418897),
|
||||
m = o(m, l, g, v, n[e + 5], 12, 1200080426),
|
||||
v = o(v, m, l, g, n[e + 6], 17, -1473231341),
|
||||
g = o(g, v, m, l, n[e + 7], 22, -45705983),
|
||||
l = o(l, g, v, m, n[e + 8], 7, 1770035416),
|
||||
m = o(m, l, g, v, n[e + 9], 12, -1958414417),
|
||||
v = o(v, m, l, g, n[e + 10], 17, -42063),
|
||||
g = o(g, v, m, l, n[e + 11], 22, -1990404162),
|
||||
l = o(l, g, v, m, n[e + 12], 7, 1804603682),
|
||||
m = o(m, l, g, v, n[e + 13], 12, -40341101),
|
||||
v = o(v, m, l, g, n[e + 14], 17, -1502002290),
|
||||
g = o(g, v, m, l, n[e + 15], 22, 1236535329),
|
||||
l = u(l, g, v, m, n[e + 1], 5, -165796510),
|
||||
m = u(m, l, g, v, n[e + 6], 9, -1069501632),
|
||||
v = u(v, m, l, g, n[e + 11], 14, 643717713),
|
||||
g = u(g, v, m, l, n[e], 20, -373897302),
|
||||
l = u(l, g, v, m, n[e + 5], 5, -701558691),
|
||||
m = u(m, l, g, v, n[e + 10], 9, 38016083),
|
||||
v = u(v, m, l, g, n[e + 15], 14, -660478335),
|
||||
g = u(g, v, m, l, n[e + 4], 20, -405537848),
|
||||
l = u(l, g, v, m, n[e + 9], 5, 568446438),
|
||||
m = u(m, l, g, v, n[e + 14], 9, -1019803690),
|
||||
v = u(v, m, l, g, n[e + 3], 14, -187363961),
|
||||
g = u(g, v, m, l, n[e + 8], 20, 1163531501),
|
||||
l = u(l, g, v, m, n[e + 13], 5, -1444681467),
|
||||
m = u(m, l, g, v, n[e + 2], 9, -51403784),
|
||||
v = u(v, m, l, g, n[e + 7], 14, 1735328473),
|
||||
g = u(g, v, m, l, n[e + 12], 20, -1926607734),
|
||||
l = c(l, g, v, m, n[e + 5], 4, -378558),
|
||||
m = c(m, l, g, v, n[e + 8], 11, -2022574463),
|
||||
v = c(v, m, l, g, n[e + 11], 16, 1839030562),
|
||||
g = c(g, v, m, l, n[e + 14], 23, -35309556),
|
||||
l = c(l, g, v, m, n[e + 1], 4, -1530992060),
|
||||
m = c(m, l, g, v, n[e + 4], 11, 1272893353),
|
||||
v = c(v, m, l, g, n[e + 7], 16, -155497632),
|
||||
g = c(g, v, m, l, n[e + 10], 23, -1094730640),
|
||||
l = c(l, g, v, m, n[e + 13], 4, 681279174),
|
||||
m = c(m, l, g, v, n[e], 11, -358537222),
|
||||
v = c(v, m, l, g, n[e + 3], 16, -722521979),
|
||||
g = c(g, v, m, l, n[e + 6], 23, 76029189),
|
||||
l = c(l, g, v, m, n[e + 9], 4, -640364487),
|
||||
m = c(m, l, g, v, n[e + 12], 11, -421815835),
|
||||
v = c(v, m, l, g, n[e + 15], 16, 530742520),
|
||||
g = c(g, v, m, l, n[e + 2], 23, -995338651),
|
||||
l = f(l, g, v, m, n[e], 6, -198630844),
|
||||
m = f(m, l, g, v, n[e + 7], 10, 1126891415),
|
||||
v = f(v, m, l, g, n[e + 14], 15, -1416354905),
|
||||
g = f(g, v, m, l, n[e + 5], 21, -57434055),
|
||||
l = f(l, g, v, m, n[e + 12], 6, 1700485571),
|
||||
m = f(m, l, g, v, n[e + 3], 10, -1894986606),
|
||||
v = f(v, m, l, g, n[e + 10], 15, -1051523),
|
||||
g = f(g, v, m, l, n[e + 1], 21, -2054922799),
|
||||
l = f(l, g, v, m, n[e + 8], 6, 1873313359),
|
||||
m = f(m, l, g, v, n[e + 15], 10, -30611744),
|
||||
v = f(v, m, l, g, n[e + 6], 15, -1560198380),
|
||||
g = f(g, v, m, l, n[e + 13], 21, 1309151649),
|
||||
l = f(l, g, v, m, n[e + 4], 6, -145523070),
|
||||
m = f(m, l, g, v, n[e + 11], 10, -1120210379),
|
||||
v = f(v, m, l, g, n[e + 2], 15, 718787259),
|
||||
g = f(g, v, m, l, n[e + 9], 21, -343485551),
|
||||
l = t(l, i),
|
||||
g = t(g, a),
|
||||
v = t(v, h),
|
||||
m = t(m, d);
|
||||
return [l, g, v, m]
|
||||
}
|
||||
function a(n) {
|
||||
var t, r = "",
|
||||
e = 32 * n.length;
|
||||
for (t = 0; t < e; t += 8) r += String.fromCharCode(n[t >> 5] >>> t % 32 & 255);
|
||||
return r
|
||||
}
|
||||
function h(n) {
|
||||
var t, r = [];
|
||||
for (r[(n.length >> 2) - 1] = void 0, t = 0; t < r.length; t += 1) r[t] = 0;
|
||||
var e = 8 * n.length;
|
||||
for (t = 0; t < e; t += 8) r[t >> 5] |= (255 & n.charCodeAt(t / 8)) << t % 32;
|
||||
return r
|
||||
}
|
||||
function d(n) {
|
||||
return a(i(h(n), 8 * n.length))
|
||||
}
|
||||
function l(n, t) {
|
||||
var r, e, o = h(n),
|
||||
u = [],
|
||||
c = [];
|
||||
for (u[15] = c[15] = void 0, o.length > 16 && (o = i(o, 8 * n.length)), r = 0; r < 16; r += 1) u[r] = 909522486 ^ o[r],
|
||||
c[r] = 1549556828 ^ o[r];
|
||||
return e = i(u.concat(h(t)), 512 + 8 * t.length),
|
||||
a(i(c.concat(e), 640))
|
||||
}
|
||||
function g(n) {
|
||||
var t, r, e = "0123456789abcdef",
|
||||
o = "";
|
||||
for (r = 0; r < n.length; r += 1) t = n.charCodeAt(r),
|
||||
o += e.charAt(t >>> 4 & 15) + e.charAt(15 & t);
|
||||
return o
|
||||
}
|
||||
function v(n) {
|
||||
return unescape(encodeURIComponent(n))
|
||||
}
|
||||
function m(n) {
|
||||
return d(v(n))
|
||||
}
|
||||
function p(n) {
|
||||
return g(m(n))
|
||||
}
|
||||
function s(n, t) {
|
||||
return l(v(n), v(t))
|
||||
}
|
||||
function C(n, t) {
|
||||
return g(s(n, t))
|
||||
}
|
||||
function A(n, t, r) {
|
||||
return t ? r ? s(t, n) : C(t, n) : r ? m(n) : p(n)
|
||||
}
|
||||
"function" == typeof define && define.amd ? define(function() {
|
||||
return A
|
||||
}) : "object" == typeof module && module.exports ? module.exports = A: n.md5 = A
|
||||
} (this);
|
||||
26
player/hls.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>M3U8 Player</title>
|
||||
<script src="hls.min.js"></script>
|
||||
<style>
|
||||
body{
|
||||
background-color:black;
|
||||
}
|
||||
#video{
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
margin: auto;
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<video id="video" style="width: 100%; height: 100%;" controls autoplay></video>
|
||||
<script src="player.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
1
player/hls.min.js
vendored
Normal file
22
player/index.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>LIVE视频播放器</title>
|
||||
<link href="https://web.sdk.qcloud.com/player/tcplayer/release/v4.7.2/tcplayer.min.css" rel="stylesheet"/>
|
||||
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.7.2/libs/TXLivePlayer-1.2.3.min.js"></script>
|
||||
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.7.2/libs/hls.min.1.1.6.js"></script>
|
||||
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.7.2/libs/flv.min.1.6.3.js"></script>
|
||||
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.7.2/libs/dash.all.min.4.5.2.js"></script>
|
||||
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.7.2/tcplayer.v4.7.2.min.js"></script>
|
||||
</head>
|
||||
<body bgcolor="black" style="margin:0">
|
||||
<video id="player-container-id" style="width:100%;height:100%" preload="auto" playsinline webkit-playsinline></video>
|
||||
<a href="https://live.fanmingming.com" target="_blank"><img id="logo" src="https://live.fanmingming.com/small-logo.png" style="width:135px; height:76px; z-index:999;position:absolute;right:50px;top:50px"></a>
|
||||
<script>
|
||||
playurl = location.href.split('?vurl=')[1];
|
||||
var player = TCPlayer('player-container-id', {});
|
||||
player.src(playurl);
|
||||
player.autoplay(1);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
12
player/player.js
Normal file
@@ -0,0 +1,12 @@
|
||||
var video = document.getElementById('video');
|
||||
var vurl = location.search.split('vurl=')[1];
|
||||
var videoSrc = vurl;
|
||||
// 检查浏览器是否支持hls
|
||||
if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
||||
video.src = videoSrc;
|
||||
// 如不支持则调用hls.min.js
|
||||
} else if (Hls.isSupported()) {
|
||||
var hls = new Hls();
|
||||
hls.loadSource(videoSrc);
|
||||
hls.attachMedia(video);
|
||||
}
|
||||
BIN
radio/8fm.png
Normal file
|
After Width: | Height: | Size: 379 KiB |
BIN
radio/988.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
radio/BTV影视.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
radio/BTV文艺.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
radio/BTV新闻.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
radio/BTV生活.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
radio/BTV科教.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
radio/BTV财经.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
radio/BTV青年.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
radio/Big Radio.jpg
Normal file
|
After Width: | Height: | Size: 227 KiB |
BIN
radio/CCTV4k.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
radio/My Radio.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
radio/RTHK31.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
radio/RTHK32.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
radio/abc.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
radio/aifm.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
radio/aline.png
Normal file
|
After Width: | Height: | Size: 123 KiB |
BIN
radio/aljazeera.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
radio/bbc1.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
radio/bbc1dance.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
radio/bbc1relax.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
radio/bbc1x.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
radio/bbc1xtra.png
Normal file
|
After Width: | Height: | Size: 178 KiB |
BIN
radio/bbc2.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
radio/bbc3.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
radio/bbc4.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
radio/bbc4extra.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
radio/bbc5.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
radio/bbc6.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
radio/bbcws.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
radio/capital958.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
radio/cctv1.png
Normal file
|
After Width: | Height: | Size: 379 KiB |
BIN
radio/cctv10.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
radio/cctv11.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
radio/cctv12.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
radio/cctv13.png
Normal file
|
After Width: | Height: | Size: 294 KiB |
BIN
radio/cctv14.png
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
radio/cctv15.png
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
radio/cctv16.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
radio/cctv17.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
radio/cctv2.png
Normal file
|
After Width: | Height: | Size: 235 KiB |
BIN
radio/cctv3.png
Normal file
|
After Width: | Height: | Size: 252 KiB |
BIN
radio/cctv4.png
Normal file
|
After Width: | Height: | Size: 135 KiB |
BIN
radio/cctv5+.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
radio/cctv5.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
radio/cctv6.png
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
radio/cctv7.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
radio/cctv8.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
radio/cctv9.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
radio/cetv1.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
radio/cetv2.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
radio/cetv3.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
radio/cetv4.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
radio/cgtn.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
radio/cheddar.png
Normal file
|
After Width: | Height: | Size: 607 KiB |
BIN
radio/chinaplusradio.png
Normal file
|
After Width: | Height: | Size: 511 KiB |
BIN
radio/cityfm.png
Normal file
|
After Width: | Height: | Size: 229 KiB |
BIN
radio/cna.png
Normal file
|
After Width: | Height: | Size: 423 KiB |
BIN
radio/cnr中华之声.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
radio/cnr哈萨克语广播.png
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
radio/cnr民族之声.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
radio/cnr神州之声.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
radio/cnr维吾尔语广播.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
radio/cnr藏语广播.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
radio/cnr香港之声.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
radio/dw.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
radio/hiradio.png
Normal file
|
After Width: | Height: | Size: 180 KiB |
BIN
radio/hitfm.png
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
radio/hitfm联播网.png
Normal file
|
After Width: | Height: | Size: 146 KiB |