Commit Graph

561 Commits

Author SHA1 Message Date
rlaphoenix 96f408ca49 Only log available tracks if --list is used
Update dl.py
2023-02-25 13:12:46 +00:00
rlaphoenix 984582d19d Replace Tracks.print() calls with new rich tree 2023-02-25 13:10:49 +00:00
rlaphoenix 48e35fb4c4 Add rich tree generator to tracks wrapper 2023-02-25 13:05:56 +00:00
rlaphoenix 97b3dbeed2 Re-implement title listing with rich tree
Note that the full title list will no longer be printed unless --list-titles is used.
2023-02-25 13:02:00 +00:00
rlaphoenix f7c4d72108 Add rich tree generator to sorted title wrappers 2023-02-25 13:01:09 +00:00
rlaphoenix 92774dcfe6 Simplify str representation of Sorted title containers 2023-02-25 12:54:37 +00:00
rlaphoenix 389fa6e979 Use console.rule between sections of dl's new logs
These are handy to separate the logs to be per-title, and per section of initialization.
2023-02-25 12:52:51 +00:00
rlaphoenix b2bbc808c4 Use console.status across dl command 2023-02-25 12:22:32 +00:00
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 3e1a067724 Override the default traceback with rich traceback 2023-02-25 11:53:44 +00:00
rlaphoenix b8f3118775 Replace version logs with new ASCII banner log 2023-02-25 11:51:03 +00:00
rlaphoenix f1864ad63c Replace logging handler with ComfyRichHandler
This changes all logs via logging to be printed to the rich console instead. Specifically, using my custom ComfyRichHandler making the logs padded horizontally.

In this change the time is no longer printed. The log level is still printed but it's now the full log name in bold.
2023-02-25 11:47:39 +00:00
rlaphoenix 8d626822cb Remove coloredlogs and now unused log constants 2023-02-25 11:46:03 +00:00
rlaphoenix 77c16f557c Replace logging FileHandler with console.save_text 2023-02-25 11:38:02 +00:00
rlaphoenix 34a2a8e4e6 Create custom Comfy versions of Console, LogRender, and RichHandler
These add a bit of margin around all console prints/logs. It makes the logs feel a bit more comfortable rather than being crammed edge-to-edge in the terminal.

The methods used here are by no means good, but they work quite well. If you can find a better way to do it, please make a pull request.
2023-02-25 11:33:42 +00:00
rlaphoenix 6eac499ae0 Add new config option to set the terminal bg color
This is a hacky way to do it, but it works surprisingly well, considering there's no true way to modify a terminal's fully color scheme.
2023-02-25 11:29:46 +00:00
rlaphoenix 01e419d52c Create custom-themed 80-width rich console 2023-02-25 11:27:29 +00:00
rlaphoenix 39ff347f58 Add new dependency, rich 13.3.1 2023-02-25 11:22:54 +00:00
rlaphoenix 7ab39377db Update Changelog for v1.4.0 2023-02-25 23:05:52 +00:00
rlaphoenix 0f0000bdd0 Bump to v1.4.0 2023-02-25 23:05:14 +00:00
rlaphoenix 7958ad5e7c Create blank config if it did not exist 2023-02-25 23:01:11 +00:00
rlaphoenix 570e0aba00 Fix printing of download worker exceptions 2023-02-25 14:46:43 +00:00
rlaphoenix a8694cb049 Disable Insecure Request Warnings
These seem to occur when using HTTP+S proxies when connecting to a HTTPS URL. E.g., NordVPN proxies to https://google.com. While not ideal, we can't solve this solution and the warning logs are quite annoying.
2023-02-25 11:56:23 +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 4f1cff681c Increase connection pool limit to accommodate Byte-Range dls 2023-02-24 19:46:26 +00:00
rlaphoenix ad82eab712 Pad/depad data when decrypting with ClearKey DRM 2023-02-23 18:19:51 +00:00
rlaphoenix 45c9ba5198 Add support for data URIs from HLS playlists in ClearKey 2023-02-23 18:19:51 +00:00
rlaphoenix 221cd1c283 Fix JOC check on HLS playlists with no audio channel info 2023-02-23 18:19:51 +00:00
rlaphoenix 1f86775ac9 Add support for segment downloads with byte-ranges
Adds support for HLS's EXT-X-BYTERANGE and DASH's SegmentBase.
2023-02-23 18:19:51 +00:00
rlaphoenix 55da41c74f Remove byte_range param on aria2c downloader
Turns out, even if you manually set the Range header AND the server has full support, it does not work. It will act like it works, but it seems internally aria2c gets confused on what bytes it requested, what it returned, and it will either just download the full file, or the range requested (but still complain, and freeze!).

Yikes.
2023-02-23 16:47:14 +00:00
rlaphoenix 725480adf0 Update Changelog for v1.3.1 2023-02-23 09:25:46 +00:00
rlaphoenix da1beae28f Bump to v1.3.1 2023-02-23 09:25:34 +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
rlaphoenix 5624232e5e
Merge pull request #33 from varyg1001/master
always define track.path if track.descriptor is URL
2023-02-23 08:45:06 +00:00
varyg fc19358de4 Fix regression of missing track.path on URL downloads 2023-02-23 08:44:50 +00:00
rlaphoenix d8ae543d63 Update Changelog for v1.3.0 2023-02-22 04:39:55 +00:00
rlaphoenix 2aea4549ce Bump to v1.3.0 2023-02-22 04:39:42 +00:00
rlaphoenix 2ad3f04a5e Use the session DRM as the initial DRM for HLS
The variant-playlist may have DRM information that won't be in the invariant (stream) playlist. We need to begin with this DRM data if available.
2023-02-22 04:30:24 +00:00
rlaphoenix c1f716cb6c Drop support for Python 3.8 2023-02-22 03:43:22 +00:00
rlaphoenix f21aa5aac5 Silence aria2c when downloading segmented streams
It conflicts with the TQDM progress bar, it's also not really useful information.
2023-02-22 03:06:53 +00:00
rlaphoenix 4406e3bbab Add ability to silence aria2c's output 2023-02-22 03:06:17 +00:00
rlaphoenix 0913b0dda6 Add ability to set extra arguments with aria2c 2023-02-22 03:01:54 +00:00
rlaphoenix 1443dfaecc Replace Threading Pool system with Thread Storage in Vaults
This fixes the usage of vaults across different threads. It now makes a truly unique connection for each thread. The previous code did this as well, but put back the connection from x thread, to re-use in y thread. Now it simply creates and reuses the connection on their own thread.

Once the thread is closed, the data is now also garbage collected. This now reduces the risk of filling up memory over time.
2023-02-22 01:31:03 +00:00
rlaphoenix 4e875f5ffc Multi-thread the new DASH download system, improve redundency
Just like the commit for HLS multi-threading, this mimics the -j=16 system of aria2c, but manually via a ThreadPoolExecutor. Benefits of this is we still keep support for the new system, and we now get a useful progress bar via TQDM on segmented downloads, unlike aria2c which essentially fills the terminal with jumbled download progress stubs.
2023-02-22 01:06:24 +00:00
rlaphoenix 9e6f5b25f3 Multi-thread the new HLS download system
This mimics the -j=16 system of aria2c, but manually via a ThreadPoolExecutor. Benefits of this is we still keep support for the new system, and we now get a useful progress bar via TQDM on segmented downloads, unlike aria2c which essentially fills the terminal with jumbled download progress stubs.
2023-02-21 16:16:12 +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 8268825ba8 Use Widevine.from_init_data when downloading DASH
This is required as some DASH manifests do not explicitly list the PSSH with the Widevine ContentProtection, only listing that its a supported.
2023-02-21 08:02:32 +00:00