Commit graph

637 commits

Author SHA1 Message Date
Jesse Bannon
d2e733f2e7
[BACKEND] Only download audio when using audio_extract plugin (#902)
This addition optimizes the `audio_extract` plugin by preemptively telling yt-dlp to discard the video and only download the audio stream
2024-01-18 15:00:17 -08:00
Jesse Bannon
c0ca3c3945
[BACKEND] Remove old format for video_tags, music_tags, download_strategy (#899)
Now that sufficient time has passed, we can formally deprecate the following:
- https://ytdl-sub.readthedocs.io/en/latest/deprecation_notices.html#video-tags
- https://ytdl-sub.readthedocs.io/en/latest/deprecation_notices.html#music-tags
- usage of `download_strategy` (simply remove it if you're getting an error about it)
2024-01-15 00:04:32 -08:00
Jesse Bannon
e3158583ca
[FEATURE] Toggleable plugin field enable for all dict-based plugins (#897)
For key/value-based plugins, add an `enable` field to make it easier for child presets to disable their functionality
2024-01-11 00:40:07 -08:00
Jesse Bannon
2076de3074
[BUGFIX] Smarter subscription validation (#895)
With the right functions, it was possible for subscription validation to raise a false-positive error. This should hopefully resolve that issue and give validation a small performance increase
2024-01-10 18:16:12 -08:00
Jesse Bannon
00e4cd8541
[BUGFIX] Fix rare case when yt-dlp returns None and is downloaded (#894) 2024-01-10 09:33:03 -08:00
Jesse Bannon
b9d05c5b8f
[BUGFIX] keep_max_files=0 downloading 2 (#893)
Fixes https://github.com/jmbannon/ytdl-sub/issues/892

Does not set max_downloads if keep_max_files = 0
2024-01-10 09:31:37 -08:00
Jesse Bannon
305d084a6d
[BUGFIX] Only apply --dl-override to subscriptions in --match (#890)
As title, to not accidently add breaking changes for subscriptions that are not going to run
2024-01-09 20:50:31 -08:00
Jesse Bannon
3b36ffd050
[BUGFIX] Fix source metadata getting fetched when yt-dlp breaks (#889)
Prior PR only got channel metadata for a playlist if it never 'broke' (i.e. MaxDownloads, BreakOnExisting). Will now fetch it regardless.
2024-01-09 19:25:09 -08:00
Jesse Bannon
be0f6f2d2d
[BUGFIX] Parent entry is not a dict (#888)
Fixes an AttributeError bug
2024-01-09 14:35:19 -08:00
Jesse Bannon
c29cca2b3d
[FEATURE] YouTube playlists to fetch playlist uploader's poster + fanart (#887)
Implements https://github.com/jmbannon/ytdl-sub/issues/756

TV Show presets whose URL is a playlist will try to get the playlist uploader's poster and fanart.
2024-01-08 22:51:42 -08:00
Jesse Bannon
915e29379a
[BACKEND] Try to fetch source metadata from uploader_url (#886)
Makes it possible to fix https://github.com/jmbannon/ytdl-sub/issues/756

In the case that uploader_url does not equal the input url, keep trying to fetch uploader_url to get all possible metadata that yt-dlp does not provide in a single API call
2024-01-08 18:53:00 -08:00
Jesse Bannon
961e04d027
[DOCS] Update Usage page (#883) 2024-01-08 16:20:08 -08:00
Jesse Bannon
78cdcce464
[FEATURE] Add --dl-override to pass dl arg overrides to all subscriptions (#882)
With both `--match` and `--dl-override`, it is now possible to more easily experiment with subscriptions without needing to create a separate file.

For example, suppose you are changing some values in your subscription "Rick A" and want to test them out. You can now run:
```
ytdl-sub sub --dry-run --match Rick --dl-override '--ytdl-options.max_downloads 3'
```
This will
1. Dry-run
2. Only run for the subscription "Rick A"
3. Apply setting max_downloads to 3
2024-01-08 15:19:01 -08:00
Jesse Bannon
9382be5c42
[FEATURE] --match flag to only run subset of subscriptions (#881)
Implements https://github.com/jmbannon/ytdl-sub/issues/880
and maybe fixes https://github.com/jmbannon/ytdl-sub/issues/827

Can now do `ytdl-sub sub --match SubA SubB` or `ytdl-sub sub --match SubA --match SubB`, which will only run subscriptions that contain `SubA` or `SubB` in their names
2024-01-08 13:37:07 -08:00
Jesse Bannon
d80a63631a
[BACKEND] String split scripting function (#877) 2024-01-07 00:13:32 -08:00
Jesse Bannon
ba71abc466
[BACKEND] Optional default in %array_at scripting function (#879)
As title
2024-01-06 23:47:09 -08:00
Jesse Bannon
dc74c6a52a
[BACKEND] elif scripting function (#876)
As titled
2024-01-05 17:48:59 -08:00
Jesse Bannon
8de9a5b6da
[BACKEND] Update yt-dlp to 2023.12.30 (#875)
As titled
2024-01-05 15:59:53 -08:00
Jesse Bannon
d96bf11b12
[BACKEND] More url variables in helper preset (#874)
Have `url` variables go up to 100
2024-01-05 14:45:03 -08:00
Jesse Bannon
5e384ba96e
[BACKEND] Info log for filter_include and filter_exclude plugins (#873)
Adds more verbose logging when entries get filtered using the `filter_include` and `filter_exclude` plugins
2024-01-05 14:44:16 -08:00
Jesse Bannon
4d0123c8b0
[BACKEND] Optimize memory usage (#872)
Reduce memory usage significantly when pulling large channels all at once by
- Not loading entry script until it is being processed
- Deleting the entry memory once fully processed
- Disable yt-dlp from keeping entry info in memory since ytdl-sub reads it from file
2024-01-05 13:04:01 -08:00
Qualis Svagtlys
891b951625
[DOCS] Unraid and FAQ Doc Updates (#869) 2024-01-05 11:12:09 -08:00
Jesse Bannon
db5f095a51
[BACKEND] Set max_downloads to keep_max_files if present (#871)
Implements: https://github.com/jmbannon/ytdl-sub/issues/829

Optimization to not scrape more than what you will keep
2024-01-04 16:38:20 -08:00
Jesse Bannon
2dbe426ced
[BUGFIX] Properly handle UIDs that have misbehaving chars that get sanitized (#870)
Should hopefuly fix both:
- https://github.com/jmbannon/ytdl-sub/issues/843
- https://github.com/jmbannon/ytdl-sub/issues/867

Various sites have unique IDs with characters that get sanitized (i.e. `/`, `:`). `ytdl-sub` was not using sanitized UIDs when looking for files, and would throw an error saying download was missing. This should resolve that issue.
2024-01-04 15:01:17 -08:00
Jesse Bannon
b3d298b664
[DOCS] Advanced scripting usage, rename Overrides to Static (#866) 2024-01-01 00:01:46 -08:00
Jesse Bannon
b99463d204
[DOCS] Explain String + Reduce better (#865) 2023-12-30 23:59:10 -08:00
Jesse Bannon
d1acae1a60
[DOCS] Update scripting types (#863) 2023-12-30 10:57:59 -08:00
Jesse Bannon
12430ecf1e
[DOCS] Scripting reference start (#862) 2023-12-29 22:34:36 -08:00
Jesse Bannon
735da8b647
[BUGFIX] Actually fix subscription_name with periods in it (#861)
Prior PR did not actually work - this actually fixes the bug (https://github.com/jmbannon/ytdl-sub/issues/844) where subscription names would drop periods from them, i.e. Mr. Beast would have the name  Beast.

POTENTIAL BREAKING CHANGE
If you have a subscription with a period in its name prior to this fix, this change will make it so your download archive is not found since it uses the subscription name in the download archive file path. To fix, simply change the download archive JSON's name to have the actual subscription name, and not the dropped-period one.
2023-12-29 15:41:33 -08:00
Jesse Bannon
f2d55fdb23
[REFACTOR] Organize variable definitions (#860) 2023-12-29 14:39:19 -08:00
Jesse Bannon
189e897888
[FEATURE] subscription_map value (#859)
To be used later for advanced presets. For subscriptions in the form of (+ as prefix)

```
   + Subscription Name:
     Music Videos:
       - "https://url1.com/..."
     Concerts:
       - "https://url2.com/..."
```

Stores all the contents under the subscription name into the override variable
``subscription_map`` as a Map value. The above example is stored as:

```
   {
     "Music Videos": [
       "https://url1.com/..."
     ],
     "Concerts: [
       "https://url2.com/..."
     ]
   }
```

Advanced scripting is needed to dissect this Map variable into a usable preset
2023-12-29 08:55:12 -08:00
Jesse Bannon
731d4e444c
[DOCS] Tooling to auto-generate custom sphinx docs (#849)
Tooling + updating docs
2023-12-28 22:39:59 -08:00
Jesse Bannon
1fcaba9274
[DOCS] Update links to reflect doc-upgrade (#858) 2023-12-27 11:07:11 -08:00
Jesse Bannon
65bb5c0a85
[BUGFIX] Fix periods not working in subscription names (#857)
Fixes the bug (#844) where subscription names would drop periods from them, i.e. Mr. Beast would have the name  Beast.

POTENTIAL BREAKING CHANGE
If you have a subscription with a period in its name prior to this fix, this change will make it so your download archive is not found since it uses the subscription name in the download archive file path. To fix, simply change the download archive JSON's name to have the actual subscription name, and not the dropped-period one.
2023-12-27 11:06:39 -08:00
Jesse Bannon
1375a0fbe3
[BACKEND] Remove subscription __value__ (#856)
Removes the deprecated `__value__` field in the subscriptions file (different from `__preset__` which is NOT deprecated). This was very short-lived, and most likely not used.
2023-12-27 10:49:39 -08:00
Qualis Svagtlys
008bcf1b2d
[DOCS] Begin complete overhaul of readthedocs (#847)
Readthedocs for ytdl-sub is getting a massive overhaul to both look and read like a modernized app. It is still very-much work-in-progress, stay tuned for more!

Huge thanks to @Svagtlys (aka Momo) for driving this
2023-12-27 10:27:40 -08:00
Jesse Bannon
02d51d6aec
[BACKEND] Make sibling metadata optional to compute (#855)
Partial fix to https://github.com/jmbannon/ytdl-sub/issues/853
Makes computing sibling metadata optional, defaulted to False. This prevents excessive memory usage when scraping large channels
2023-12-26 11:57:03 -08:00
Jesse Bannon
873ecc0147
[BUGFIX] Fix recursion limit when applying large reduce functions (#851)
Python would think a recursive error occurred, but in reality, the stack got too large due to poor optimization when executing array reduce functions. Thanks Melissa from Discord for the bug report!
2023-12-20 23:46:17 -08:00
Jesse Bannon
b8fb119f21
[BACKEND] Add collection_season_name variable to collection presets (#850)
Can now be used to change directory names for collection presets
2023-12-20 11:18:36 -08:00
Jesse Bannon
308c76a8f2
[FEATURE] Filter plugins, regex helper script functions (#848)
Adds generic `filter_include` and `filter_exclude` plugins in anticipation for function script usage. Will detail it more with official docs at a later time!
2023-12-20 09:52:12 -08:00
Jesse Bannon
c0e2ded1ae
[BACKEND] Improved error messages when script resolution does not work (#846) 2023-12-19 00:22:14 -08:00
Jesse Bannon
5d1fd0d7c6
[BACKEND] Validate override variable names (#845)
Validate as early as possible whether override names are invalid, to prevent confusing downstream errors
2023-12-18 17:11:25 -08:00
Jesse Bannon
e92b1cd12a
[BACKEND][HUGE] Function Support in variable syntax (#838)
A complete gutting of the internals of ytdl-sub to support functions in our variable syntax, in addition to being able to access a yt-dlp entry's .info.json fields using functions. Functionally, ytdl-sub should still look and behave the same from a user-perspective.

With so many lines of code changed (+8927, -2708), no doubt there will be new issues. Please make a GH issue or reach out on Discord if your config/subscriptions break in any way/shape/form.

Details on how to use function support will come soon in the form of proper documentation in our readthedocs.
2023-12-18 16:08:15 -08:00
Jesse Bannon
4d9a30779c
[BUGFIX] Use proper extractor key for download archive (#840)
For less popular sites, ytdl-sub's custom download archive was not working. This was because we weren't using the right extraction key (though it still worked for YouTube, Bandcamp, Soundcloud, and others). This bugfix should now exactly match yt-dlp's and never be a problem again.

Huge thanks to @Svagtlys for root-causing this 🤝
2023-12-14 17:04:03 -08:00
OmarAhmadyar
8998861b49
[BUGFIX] file_convert output file deleted (#822)
file_convert.py:modify_entry() deletes the converted output file if the output and input file names are identical.  Reordered the file deletion to avoid.

Thanks @OmarAhmadyar !
2023-11-25 00:23:46 -08:00
Jesse Bannon
544af2207b
[FEATURE] Add output_options.keep_max_files to limit number of downloads per subscription (#820)
Adds a new mechanism to limit subscriptions' number of videos to an explicit number (only supported date ranges prior to this).

Example usage:
```
output_options:
  keep_max_files: 10
```
will only keep 10 videos at max.

In addition:
- `keep_max_files` is bundled into the `Only Recent` preset and can be used via setting the `only_recent_max_files` override variable (see examples or README for usage).
- Changed the `date_range` variable name to `only_recent_date_range` for more clarity.  Usage of `date_range` will continue to work.
2023-11-17 09:01:21 -08:00
Jesse Bannon
52d1a5887e
[DEV] String validators to allow ints, floats, bools (#810) 2023-11-16 23:50:51 -08:00
Jesse Bannon
6123e35c64
[DEV] Test-case for subscription with existing download archive (#819) 2023-11-16 23:37:24 -08:00
Jesse Bannon
c7fce5dbdd
[BACKEND] Upgrade yt-dlp to 2023.11.16 (#817) 2023-11-15 16:58:29 -08:00
Jesse Bannon
9b8aa827ba
[BACKEND] Upgrade yt-dlp to 2023.11.14 (#815) 2023-11-14 19:23:35 -08:00