-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPKG-INFO
194 lines (130 loc) · 6.52 KB
/
PKG-INFO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
Metadata-Version: 2.1
Name: m3u8downloader
Version: 0.10.1
Summary: a cli program to download video at m3u8 url
Home-page: https://pypi.org/project/m3u8downloader/
Author: Yuanle Song
Author-email: [email protected]
Maintainer: Yuanle Song
Maintainer-email: [email protected]
License: GPLv2+
Description: m3u8downloader
============================
m3u8downloader is a tool to download video at a m3u8 link. `HTTP Live
Streaming (HLS)`_ is becoming popular. m3u8 playlist is used by HLS to serve
video fragments of different quality to different clients. This tool supports
HLS master playlist and media playlist. If master playlist is given, it
selects the highest resolution automatically. HLS fragment encryption is
supported. Resume from partial download is supported, just rerun the same
command to continue.
ffmpeg is used to convert the downloaded fragments into final mp4 video file.
.. _HTTP Live Streaming (HLS): https://developer.apple.com/streaming/
Installation
------------
To install m3u8downloader, simply:
.. code-block:: bash
$ sudo apt install -y ffmpeg
$ pip install --user m3u8downloader
Quick Start
-----------
Example command line usage:
.. code-block:: bash
downloadm3u8 -o ~/Downloads/foo.mp4 https://example.com/path/to/foo.m3u8
If ~/.local/bin is not in $PATH, you can use full path:
.. code-block:: bash
~/.local/bin/downloadm3u8 -o ~/Downloads/foo.mp4 https://example.com/path/to/foo.m3u8
Here is built-in command line help:
.. code-block:: bash
usage: m3u8downloader [-h] [--user-agent USER_AGENT] [--origin ORIGIN] [--version]
[--debug] --output OUTPUT [--tempdir TEMPDIR] [--concurrency N]
URL
download video at m3u8 url
positional arguments:
URL the m3u8 url
optional arguments:
-h, --help show this help message and exit
--user-agent USER_AGENT
specify User-Agent header for HTTP requests
--origin ORIGIN specify Origin header for HTTP requests
--version show program's version number and exit
--debug enable debug log
--output OUTPUT, -o OUTPUT
output video filename, e.g. ~/Downloads/foo.mp4
--tempdir TEMPDIR temp dir, used to store .ts files before combing them into mp4
--concurrency N, -c N
number of fragments to download at a time
Documentation
-------------
Config File Support
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You may use a config file to specify some command line arguments.
- supported config files, later takes precedence:
- /etc/m3u8downloader.conf
- /etc/m3u8downloader/m3u8downloader.conf
- ~/.config/m3u8downloader.conf
- ~/.config/m3u8downloader/m3u8downloader.conf
- config file format
.. code-block:: bash
# comments and empty lines are ignored.
KEY=VALUE
# or
KEY="VALUE"
# boolean values may be true|false|yes|no|1|0
- supported keys:
.. code-block:: bash
user_agent=<string>
origin=<string>
tempdir=<string>
concurrency=<int>
debug=<true|false>
Their meaning is the same as their counterpart in command line arguments.
- if a config is specified both in config file and command line arguments,
command line arguments will take precedence.
Limitations
-------------
This tool only parses minimum m3u8 extensions for selecting media playlist
from master playlist, downloading key and fragments from media playlist. If a
m3u8 file doesn't download correctly, it's probably some new extension was
added to the HLS spec which this tool isn't aware of.
ChangeLog
---------
* v0.10.1
- lifted lib version restriction
* v0.10.0
- add support for config file
- handle Ctrl+C and SIGTERM properly
* v0.9.0
- add support for --user-agent and --origin parameters
* v0.8.7
- bugfix: do not rewrite KEY URI if it is already a local file path.
* v0.8.6
- fix a regression in v0.8.4. the v0.8.4 release should be avoided. Either
use v0.8.3 or v0.8.6+
* v0.8.4
- minor bugfix: still try rewrite path when using m3u8 file from cache.
when rewrite path in m3u8 file, do not rewrite if path has already been
rewritten before. This is a minor change, it only fix things when process
is killed when .m3u8 file is downloaded but path in it has not been
rewritten yet.
* v0.8.3
- bugfix: ensure output file name and temp dir name is always valid for
windows platform.
* v0.8.1
- bugfix: should rewrite key uri to local file path.
- some bugfix for windows platform.
* v0.8.0 2019-03-31
- add logrotate for log handler
* v0.7.8 2019-03-09
- bugfix: fragment url rewrite fail for some cases
* v0.7.7 2019-03-08
- bugfix: always rewrite fragment url to local abs path
* v0.7.5 2019-03-07
- set default log level to INFO
* v0.7.4 2019-03-07
- initial release
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Classifier: Programming Language :: Python :: 3.5
Description-Content-Type: text/x-rst