65 Commits

Author SHA1 Message Date
rlaphoenix
50193856c2 Add missing tqdm progress bar to DASH downloads 2023-02-21 06:35:40 +00:00
rlaphoenix
42aaa03941 Completely rewrite downloading system
The new system now downloads and decrypts segments individually instead of downloading all segments, merging them, and then decrypting. Overall the download system now acts more like a normal player.

This fixes #23 as the new HLS download system detects changes in keys and init segments as segments are downloaded. DASH still only supports one period, and one period only, but hopefully I can change that in the future.

Downloading code is now also moved from the Track classes to the manifest classes. Download progress is now also actually helpful for segmented downloads (all HLS, and most DASH streams). It uses TQDM to show a progress bar based on how many segments it needs to download, and how fast it downloads them.

There's only one down side currently. Downloading of segmented videos no longer have the benefit of aria2c's -j parameter. Where it can download n URLs concurrently. Aria2c is still used but only -x and -s is going to make a difference.

In the future I will make HLS and DASH download in a multi-threaded way, sort of a manual version of -j.
2023-02-21 06:00:39 +00:00
rlaphoenix
707469d252 Add ability to pass a proxy to ClearKey in HLS.get_drm 2023-02-21 01:37:39 +00:00
rlaphoenix
5197961d91 Add doc-string to HLS.get_drm 2023-02-21 01:36:01 +00:00
rlaphoenix
09989f8b94 Raise error if no supported drm was found in HLS.get_drm 2023-02-21 01:31:52 +00:00
rlaphoenix
c3f2d0d9cc Support HLS's EXT-X-KEY NONE
If EXT-X-KEY of Method=NONE is encountered, it assumes no DRM should be used, even if other supported DRM may have already been or is going to be iterated.
2023-02-21 01:24:04 +00:00
rlaphoenix
7025b5cef3 Only convert AES-128 EXT-X-KEYs to ClearKey objects
There's other AES methods like AES-CBC and such that is not currently supported by the ClearKey DRM class.
2023-02-21 01:21:28 +00:00
Arias800
7169eaa885
Detect redirection
If the manifest is hidden behind a redirect, the url is not updated and the segments are created with the old url.
I found a French service where this situation occurred.

After this change, it was possible to correctly parse the mpd.
2023-02-12 11:01:16 +01:00
rlaphoenix
f4363ae57e Fix HLS conversion of JOC Audio Tracks channels 2023-02-11 17:12:22 +00:00
rlaphoenix
4bee08c431 Fix FutureWarning when getting FPS for DASH videos 2023-02-10 20:05:31 +00:00
rlaphoenix
09e29cb2e1 Define exports with __ALL__ in sub-packages 2023-02-10 19:37:03 +00:00
rlaphoenix
d982e37ee5 Re-order all imports across project with isort 2023-02-10 19:25:25 +00:00
rlaphoenix
0a5f359217 Fix FutureWarning when getting segment URLs from SegmentTemplate 2023-02-08 12:57:09 +00:00
rlaphoenix
23153f0078 Only use SegmentBase's timescale as FPS if exists
Also optimised it to not require FPS.parse, as the Video class will run it under FPS.parse anyway.
2023-02-08 12:29:57 +00:00
rlaphoenix
7fd87b8aa2 Initial commit 2023-02-06 02:41:29 +00:00