Commit Graph

561 Commits

Author SHA1 Message Date
retouching 09eda16882
fix(dl): delete old file after repackage (#114)
* fix(dl): delete old file after repackage

* fix(dl): using original_path instead of self.path in repackage method
2024-06-03 16:57:26 +01:00
rlaphoenix a95d32de9e chore: Add config to gitignore 2024-05-17 02:29:46 +01:00
rlaphoenix 221cd145c4 refactor(dl): Make Widevine CDM config optional
With this change you no longer have to define/configure a CDM to load. This is something that isn't necessary for a lot of services.

Note: It's also now less hand-holdy in terms of correct config formatting/values. I.e. if you define a cdm by profile for a service slightly incorrectly, say a typo on the service or profile name, it will no longer warn you.
2024-05-17 01:52:45 +01:00
rlaphoenix 0310646cb2 fix(Subtitle): Skip merging segmented WebVTT if only 1 segment 2024-05-17 01:42:44 +01:00
rlaphoenix 3426fc145f fix(HLS): Decrypt AES-encrypted segments separately
We cannot merge all the encrypted AES-128-CBC (ClearKey) segments and then decrypt them in one go because each segment should be padded to a 16-byte boundary in CBC mode.

Since it uses PKCS#5 or #7 style (cant remember which) then the merged file has a 15 in 16 chance to fail the boundary check. And in the 1 in 16 odds that it passes the boundary check, it will not decrypt properly as each segment's padding will be treated as actual data, and not padding.
2024-05-17 01:15:37 +01:00
rlaphoenix e57d755837 fix(clearkey): Do not pad data before decryption
This is seemingly unnecessary and simply incorrect at least for two sources (VGTV, and TRUTV).

Without this change it is not possible to correctly merge all segments without at least some problem in the resulting file.
2024-05-17 01:00:11 +01:00
rlaphoenix 03f3fec5cc refactor(dl): Only log errors/warnings from mkvmerge, list after message 2024-05-16 18:12:57 +01:00
rlaphoenix 2acee30e54 fix(utilities): Prevent finding the same box index over and over
Since it removed the data before the found box's index(-4), all loops would only find the same box at the same index again, but this time the box index would be 4 since all previous data was removed in the prior loop. Since the index-=4 code is only run if the index > 4, this never run on the second loop, and since this data now does not have the box length, Box.parse failed with an IOError.

This corrects looping through boxes and correctly obtains and parses each box.
2024-05-15 17:54:21 +01:00
rlaphoenix 2e697d93fc fix(dl): Log output from mkvmerge on failure 2024-05-15 14:00:38 +01:00
rlaphoenix f08402d795 refactor: Warn falling back to requests as aria2c doesn't support Range 2024-05-11 22:59:31 +01:00
rlaphoenix 5ef95e942a fix(DASH): Use SegmentTemplate endNumber if available 2024-05-11 22:15:05 +01:00
rlaphoenix dde55fd708 fix(DASH): Correct SegmentTemplate range stop value
Since range(start, stop) is start-inclusive but stop-exclusive, and DASH startNumber of SegmentTemplate typically will be 1 or not specified (defaulting to 1) it effectively worked by coincidence.

However, if startNumber was anything other than 1 than we will have a problem.
2024-05-11 22:13:28 +01:00
rlaphoenix 345cc5aba6
Merge pull request #110 from adbbbb/master
Adding Arm64 OSX Shaka support
2024-05-11 20:13:30 +01:00
rlaphoenix 145e7a6c17 docs(contributors): Add adbbbb to Contributor list 2024-05-11 20:13:01 +01:00
Adam 5706bb1417 fix(binaries): Search for Arm64 builds of Shaka-Packager 2024-05-11 20:11:29 +01:00
rlaphoenix 85246ab419
Merge pull request #109 from pandamoon21/master
Fix uppercase letters in the fonts extension - Font attachment
2024-05-11 17:46:04 +01:00
rlaphoenix 71a3a4e2c4 docs(contributors): Add pandamoon21 to Contributor list 2024-05-11 17:45:10 +01:00
pandamoon21 06d414975c fix(Attachment): Check mime-type case-insensitively 2024-05-11 17:43:32 +01:00
rlaphoenix f419e04fad refactor(Track): Ensure data property is a defaultdict with dict factory
This is so both internal code and service code can save data to sub-keys without the parent keys needing to exist.

A doc-string is now set to the data property denoting some keys as reserved as well as their typing and meaning.

This also fixes a bug introduced in v3.3.3 where it will fail to download tracks without the "hls" key in the data property. This can happen when manually making Audio tracks using the HLS descriptor, and not putting any of the hls data the HLS class sets in to_tracks().
2024-05-09 15:15:22 +01:00
rlaphoenix 50d6f3a64d docs(changelog): Add v3.3.3 Changes 2024-05-07 07:10:20 +01:00
rlaphoenix 259434b59d docs(version): Bump to v3.3.3 2024-05-07 07:10:02 +01:00
rlaphoenix 7df8be46da build(poetry): Update dependencies
We can remove explicit dependency on language-data and marisa-trie because langcodes v3.3.0 now depends on language-data 1.2.0 and language-data 1.2.0 now depends on marisa-trie 1.1.0.
2024-05-07 07:06:22 +01:00
rlaphoenix 7aa797a4cc
Merge pull request #67 from Shivelight/feature/fix-webvtt-timestamp
Correct timestamps when merging fragmented WebVTT
2024-05-07 06:54:42 +01:00
Shivelight 0ba45decc6 fix(Subtitle): Correct timestamps when merging fragmented WebVTT
This applies the X-TIMESTAMP-MAP data to timestamps as it reads through a concatenated (merged) WebVTT file to correct timestamps on segmented WebVTT streams. It then removes the X-TIMESTAMP-MAP header.

The timescale and segment duration information is saved in the Subtitle's data dictionary under the hls/dash key: timescale (dash-only) and segment_durations. Note that this information will only be available post-download.

This is done regardless if you are converting to another subtitle or not, since the downloader automatically and forcefully concatenated the segmented subtitle data. We do not support the use of segmented Subtitles for downloading or otherwise, nor do we plan to.
2024-05-06 18:18:23 +01:00
rlaphoenix af95ba062a refactor(env): Shorten paths on Windows with env vars 2024-04-24 05:56:05 +01:00
rlaphoenix 3bfd96d53c fix(dl): Automatically convert TTML Subs to WebVTT for MKV support 2024-04-24 05:35:24 +01:00
rlaphoenix f23100077e refactor(dl): Improve readability of download worker errors
Now it will no longer print the full traceback for errors caused by a missing binary file. Other errors still include it and now explicitly label them as unexpected. CalledProcessError handling is now merged with all non-environment related errors and explicitly mentions that a binary call failed.
2024-04-24 05:28:10 +01:00
rlaphoenix fd64e6acf4 refactor(utilities): Remove get_binary_path, use binaries.find instead
The function now located at core/binaries should only be used by services to find a specific binary not listed in there already, or if the name of the binary needed by your service differs.
2024-04-24 05:10:34 +01:00
rlaphoenix 677fd9c56a feat(binaries): Move all binary definitions to core/binaries file
This simplifies and centralizes all definitions on where these binaries can be found to a singular reference, making it easier to modify, edit, and improve.
2024-04-24 05:07:25 +01:00
rlaphoenix 9768de8bf2 feat(env): List possible config path locations when not found 2024-04-19 19:28:15 +01:00
rlaphoenix 959b62222e fix(env): List all directories as table in info 2024-04-19 19:27:33 +01:00
rlaphoenix c101136d55 refactor(Config): Move possible config paths out of func to constant 2024-04-19 19:23:56 +01:00
rlaphoenix 4f1dfd7dd1 refactor(curl-impersonate): Update the default browser to chrome124 2024-04-18 09:50:17 +01:00
rlaphoenix c859465af2 refactor(curl-impersonate): Remove manual fix for curl proxy SSL
The new version of curl-cffi includes the proper fix for applying ca-bundles to proxy connections making this manual fix no longer required.
2024-04-18 09:49:35 +01:00
rlaphoenix d1ae361afc docs(changelog): Add v3.3.2 Changes 2024-04-16 06:07:00 +01:00
rlaphoenix a62dcff9ad docs(version): Bump to v3.3.2 2024-04-16 06:06:44 +01:00
rlaphoenix 920ce8375b build(poetry): Update dependencies 2024-04-16 06:06:05 +01:00
rlaphoenix 3abb869d80
Merge pull request #100 from retouching/patch-1
Check if width and height is digit if it's an str
2024-04-16 05:36:59 +01:00
rlaphoenix cbcb7e31b0 docs(contributors): Add retouching to Contributor list 2024-04-16 05:35:57 +01:00
retouching 4335806ca2 fix(Video): Allow specifying width/height as str, cast to int
We simply check the type near the top of the constructor, and later in the code it casts to int and handles failures there too (e.g., if the str is not a number, it will be handled).
2024-04-16 05:33:37 +01:00
rlaphoenix a850a35f3e fix(Basic): Return None not Exception if no proxy configured 2024-04-16 05:27:17 +01:00
rlaphoenix 09e80feee5 fix(cfg): Use loaded config path instead of hardcoded default 2024-04-14 03:44:30 +01:00
rlaphoenix f521ced3fe refactor(env): Use -- to indicate no config found/loaded 2024-04-14 03:42:41 +01:00
rlaphoenix b4e28050ab fix(env): List used config path, otherwise the default path 2024-04-14 03:35:17 +01:00
rlaphoenix 646c35fc1b fix(Subtitle): Optionalise constructor args, add doc-string & checks
Some HLS playlists can have extremely limited information so to accommodate this we need to make the Subtitle track support having almost no information. This isn't ideal but it's really the only solution.
2024-04-14 03:26:35 +01:00
rlaphoenix 7fa0ff1fc0 refactor(Subtitle): Do not print "?"/"Unknown" values in str() 2024-04-14 03:25:22 +01:00
rlaphoenix 5c7c080a34 fix(HLS): Ensure playlist.stream_info.resolution exists before use 2024-04-14 03:15:11 +01:00
rlaphoenix 1db8944b09 fix(HLS): Ensure playlist.stream_info.codecs exists before use 2024-04-14 03:14:45 +01:00
rlaphoenix 43585a76cb fix(Audio): Optionalise constructor args, add doc-string & checks
Some HLS playlists can have extremely limited information so to accommodate this we need to make the Audio track support having almost no information. This isn't ideal but it's really the only solution.
2024-04-14 03:13:46 +01:00
rlaphoenix 8ca91efbc5 refactor(Audio): Do not print "?"/"Unknown" values in str() 2024-04-14 03:12:50 +01:00