127 Commits

Author SHA1 Message Date
rlaphoenix
a45c784569 Replace download speeds with "Downloaded" text when finished 2023-05-16 21:59:03 +01:00
rlaphoenix
cb82febb7c Add ability to choose downloader via config 2023-05-12 06:42:33 +01:00
rlaphoenix
b92708ef45 Alter behaviour of --skip-dl to allow DRM licensing
Most people used --skip-dl just to license the DRM pre-v1.3.0. Which makes sense, --skip-dl is otherwise a pointless feature. I've fixed it so that --skip-dl worked like before, allowing license calls, while still supporting the new per-segment features post-v1.3.0.

Fixes #37
2023-05-11 22:17:41 +01:00
rlaphoenix
86322159b6 Fix multiplexing of downloads without a video track
E.g., --subs-only and --audio-only
2023-04-17 14:09:36 +01:00
rlaphoenix
527cd4cca1 Fix regression where only last mux would be moved to dl folder 2023-03-27 18:51:32 +01:00
rlaphoenix
0a128e1f70 Fix regression where no-video dls fail, improve multiplex progress 2023-03-26 23:13:11 +01:00
rlaphoenix
8f5bbeb8e3 Split the download finished log into dl/title finish logs 2023-03-26 22:42:16 +01:00
rlaphoenix
0b2e3e2255 Remove the muxed download path log
It's not very appealing, nor is it info the user realistically needs for every download. They could check `devine env info` to see where downloads go if they are unsure.
2023-03-26 22:41:23 +01:00
rlaphoenix
2a8e86b057 Delete video tracks as they are muxed
This reduces the total cumulative temp download folder size.
2023-03-26 22:40:05 +01:00
rlaphoenix
63eeeca910 Fix regression where all videos are selected if --quality isnt used 2023-03-26 20:18:15 +01:00
rlaphoenix
33a9c307f3 Add ability to download multiple resolutions per title
Closes #26
2023-03-26 19:28:46 +01:00
rlaphoenix
2a4dfb3e93 Improve anti-duplicate checks in Widevine tree logs
While it already has anti-duplicate checks, these checks did not take into account the `*` indicator, or `from x vault` e.t.c. This rework of the duplicate check ignores all messages.
2023-03-17 01:52:47 +00:00
rlaphoenix
90818f201d Include the mkvmerge return code on error 2023-03-12 00:10:54 +00:00
rlaphoenix
7bb215d496 Prevent licensing Widevine DRM a second time
If you use --cdm-only, you will end up licensing multiple times if the PSSH has more than one Key ID. While this is checked for, with the KID check now being more lenient, it will end up continuing and licensing again.

However, even with the original check code this would have been pointless. If the first license did not return a content key for a KID, then the next license call with the exact same parameters wouldn't have either
2023-03-08 22:48:36 +00:00
rlaphoenix
da7acb0417 Specify URL Track Key IDs to prepare_drm 2023-03-08 22:42:25 +00:00
rlaphoenix
923cb71f81 Only raise error if the Track's KID was not found when licensing
For ex., if a service has the same PSSH or license call for 720p and 1080p video tracks, but it doesn't return a KID for the 1080p track, then the previous code would return an error, even though it has enough content key data to continue.

With this change it now only raises the error if the track's exact KID was not licensed. This adds support to prepare_drm for specifying the track's KID.
2023-03-08 22:41:13 +00:00
rlaphoenix
8337162991 Prepare DRM on URL tracks if they already have DRM
Previously it would only prepare the DRM, if it had to find DRM from the init data. Now it prepares DRM if already pre-provided with DRM objects.
2023-03-08 21:35:14 +00:00
rlaphoenix
d73256f1b3 Fix storing of DRM to be before preparation on URL tracks 2023-03-08 21:31:44 +00:00
rlaphoenix
fa84ef53e7 Don't space the * that denotes KIDs within PSSH
This prevents it from being 1 character over the size limit and wrapping to the next line.
2023-03-08 13:43:11 +00:00
rlaphoenix
0bceb772c2 Handle exceptions in user's Service license funcs 2023-03-04 11:23:58 +00:00
rlaphoenix
d9471f886f Raise exceptions in prepare_drm instead of using sys.exit(1) 2023-03-04 11:22:51 +00:00
rlaphoenix
9fff14af30 Fix regression that broke pproxy 2023-03-03 08:53:28 +00:00
rlaphoenix
714e9af99a Don't print traceback of subprocess errors on download failures
Since we now have pretty logs for them, the exception (which would be a CalledProcessError) would be generally pointless. However, the return code may be useful so that is kept.
2023-03-03 07:52:13 +00:00
rlaphoenix
d75996f6e4 Add title download time elapsed to finish log 2023-03-01 16:06:55 +00:00
rlaphoenix
7ee5e71075 Move download time elapsed code to utilities 2023-03-01 16:06:20 +00:00
rlaphoenix
7b7be47f7d Clean up residual files on download stops and fails 2023-03-01 11:19:32 +00:00
rlaphoenix
fbe78308eb Handle download worker exceptions outside thread loop
This is so that I can start to log information after the track listing. It's also not necessary to have the try catch within the loop, when both methods will have exited the loop.
2023-03-01 11:08:52 +00:00
rlaphoenix
3a98c93f03 Support CTRL+C on URL downloads, use FAILED/STOPPED messages 2023-03-01 11:08:52 +00:00
rlaphoenix
6a65617179 Reduce the download stop check to one if check in dl 2023-03-01 08:55:40 +00:00
rlaphoenix
840db6e689 Move segment merging from dl to DASH/HLS classes 2023-03-01 08:54:35 +00:00
rlaphoenix
d07fedbbe1 Move Widevine DRM prep for URL downloads before download 2023-03-01 08:44:50 +00:00
rlaphoenix
b482f86bb3 Skip post-download operations if dl stop event is set 2023-02-28 18:05:04 +00:00
rlaphoenix
383e7d9647 Add full support for CTRL+C on HLS and DASH 2023-02-28 18:05:04 +00:00
rlaphoenix
ad1990cc42 Print a download cancelled message on CTRL+C 2023-02-28 18:05:04 +00:00
rlaphoenix
53c005f727 Remove unnecessary dl stop event set on CTRL+C 2023-02-28 18:05:04 +00:00
rlaphoenix
9cfda3bb9c Don't shutdown pool or the for loop will lock
Since I'm using `futures.as_completed()`, it will never ever for loop over all tracks and segments and will forever be stuck in the primary thread of the operation. I.e., main thread for the download track threads, or the track thread for the download segment threads.

I've also removed all future cancelled checks as they will never be cancelled before they get the chance to run, because no future cancel calls are made anymore.
2023-02-28 18:05:03 +00:00
rlaphoenix
51fb7920c9 Mark track as skipped if it never got a chance to start downloading 2023-02-28 16:39:33 +00:00
rlaphoenix
acead803bd Remove unnecessary sleep calls at start of download threads 2023-02-28 16:38:10 +00:00
rlaphoenix
ce53a1b636 Don't run aria2c under asyncio, further improve progress updates
I've removed asyncio usage as it's generally unnecessary. If you want to run aria2c under a thread, run it under a thread. In the case for devine, this would take another thread, and would be another thread layer deep. Pointless. Would affect speed.

With this change I've been able to improve the aria2c progress capture code quite a bit.
2023-02-28 08:21:55 +00:00
rlaphoenix
7560ee96c9 Replace console.log calls with padded console.prints
While console.log is currently removing the need for `Padding(..., (0, 5))` as it is overwritten to do it automatically, but in terms of purpose the `console.print` function is more logical.

I hope to find a way to automate the padding within console.print in the future, but for now this will work.
2023-02-26 23:35:40 +00:00
rlaphoenix
eb3f268d64 Revert back to using logging over console.log where possible
It seems the commit I made to do this change initially seemed to help, it was actually pointless and issues I had were caused by other problems.

For consistency it seems best to stick with the logging module with the RichHandler applied. Using just console.log means being unable to control the log level and which level of logs appear.
2023-02-26 21:20:43 +00:00
rlaphoenix
6419c27e0a Remove spacer from Spinner of progress bars 2023-02-26 15:57:10 +00:00
rlaphoenix
73b68fe7fe Use OnMultiplex for auto SDH-strip subtitle 2023-02-25 22:00:44 +00:00
rlaphoenix
2635538205 Move repack to post-download, use rich status 2023-02-25 21:25:24 +00:00
rlaphoenix
7d1af8bd8c Move sub conversion to post-download, use rich status 2023-02-25 21:20:50 +00:00
rlaphoenix
8b405b6e02 Skip CC extraction if the binary isn't found 2023-02-25 21:06:11 +00:00
rlaphoenix
a5c6052292 Move CC extraction to be post-download, use rich status 2023-02-25 21:04:04 +00:00
rlaphoenix
b535715166 Print download thread exceptions with rich traceback 2023-02-25 17:47:59 +00:00
rlaphoenix
70106d32ce Log DRM license info under track downloads 2023-02-25 17:21:13 +00:00
rlaphoenix
cd0c419142 Print available tracks in a Panel 2023-02-25 14:01:46 +00:00