30 Commits

Author SHA1 Message Date
rlaphoenix
62d91a3e77 Replace log.info calls with console.log calls
I've moved log.info calls to console.log calls to reduce conflicts of logs at the same time as console refreshes, but also to reduce unnecessary log level text being printed to the console.

We don't need to know if a log is an `info` level log, but I've kept log.error's and such as we would want to know if a log is an error log and such.
2023-02-25 12:11:17 +00:00
rlaphoenix
570e0aba00 Fix printing of download worker exceptions 2023-02-25 14:46:43 +00:00
rlaphoenix
eebe76b6f6 Fix segment download merging on Linux machines
It seems on Windows the pathlib.iterdir() function is always in order. However, on Linux or at least some machines this is not the case. This change fixes the order.

If you think you were affected, check your previous downloads that used DASH or HLS segmentation and make sure they dont randomly change scenes out of order.
2023-02-24 23:10:51 +00:00
rlaphoenix
c6976a7112 Move --log from the dl cmd to the root cmd 2023-02-24 19:54:05 +00:00
rlaphoenix
739c17bf4c Initialize config when adding auth if non-existant 2023-02-23 09:09:09 +00:00
rlaphoenix
9932fa3f7a Fix mistake when logging where the cookie file was moved 2023-02-23 09:07:21 +00:00
rlaphoenix
3b5a199f31 Fix regression of missing title & track when licensing with Widevine
For some reason I had the partial removed and replaced with the direct function, meaning services using `title` and `track` during the license and service cert functions would crash.
2023-02-23 08:56:37 +00:00
varyg
fc19358de4 Fix regression of missing track.path on URL downloads 2023-02-23 08:44:50 +00:00
rlaphoenix
c1f716cb6c Drop support for Python 3.8 2023-02-22 03:43:22 +00:00
rlaphoenix
314079c75f Pass save path to DRM decrypt functions directly
This is required in segmented scenarios when multi-threaded where the same `track.path` would be get and set from possibly at the same time. It's also just better logically to do it this way.
2023-02-21 16:09:35 +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
c925cb8af9 Remove AtomicSQL, use Connection Pools in Vaults
This allows the use of vaults in any thread, while keeping database-file level thread safety. AtomicSQL doesn't actually do anything that useful.
2023-02-21 05:38:39 +00:00
varyg
f412b0e37f
Check if cookies exists 2023-02-14 21:56:55 +01:00
varyg
bb9e85d777 Use shutil.move to move data instead of Path.rename
Path.rename() cannot move data to different drives. It can only rename the path reference on the same file system. However, shutil.move() will move the data while also changing it's name.
2023-02-13 18:33:02 +00:00
rlaphoenix
47448aac3c Print traceback when download worker fails 2023-02-11 22:16:54 +00:00
rlaphoenix
067130990c Add missing exit when --abitrate returns no tracks 2023-02-10 21:11:28 +00:00
rlaphoenix
d612599e27 Add Audio Channels Selection option to dl command CLI
Sub-channel layouts like 5.1, 7.1, will match with e.g., 6.0 and 8.0 respectively.

Closes #9.
2023-02-10 21:10:09 +00:00
rlaphoenix
84bf9fde92 Add Bitrate Selection options to dl command CLI
It defaults to highest available. Closes #8.
2023-02-10 20:19:54 +00:00
rlaphoenix
268509fb49 Remove unused f-strings with no placeholders 2023-02-10 19:26:46 +00:00
rlaphoenix
d982e37ee5 Re-order all imports across project with isort 2023-02-10 19:25:25 +00:00
rlaphoenix
faabfb550c Replace use of with_stem + with_suffix to with_name 2023-02-10 19:13:31 +00:00
rlaphoenix
18e2d8617e Create credentials dict prior to assignment in auth add
Fixes #17.
2023-02-07 21:32:21 +00:00
rlaphoenix
c5d6ba09f2 Check if Cookie file for profile already exists during auth add
Fixes #16.
2023-02-07 21:25:26 +00:00
rlaphoenix
6619c29fb5 Create parent dirs when adding cookies with auth add
Fixes #21.
2023-02-07 21:21:15 +00:00
rlaphoenix
0446c44a42 Only iterate over cookie dir if exists in auth list
Fixes #18.
2023-02-07 21:08:45 +00:00
rlaphoenix
794de8b516 Efficiently store data in auth list, sort the data 2023-02-07 21:07:58 +00:00
rlaphoenix
1fa3ba61c8 Fix crash when using cfg on empty/new configs
Fixes #19.
2023-02-07 20:44:34 +00:00
rlaphoenix
5301ac2924 Add util to test decoding of the video/audio streams with FFmpeg 2023-02-07 00:58:53 +00:00
rlaphoenix
00f85f7206 Add util to change video range flag losslessly
This is useful for some services. Some times there's a random stream with the wrong video range.
2023-02-06 23:49:28 +00:00
rlaphoenix
7fd87b8aa2 Initial commit 2023-02-06 02:41:29 +00:00