Commit graph

39 commits

Author SHA1 Message Date
Jesse Bannon
57fd6901e4
[DEV] Linter: Use ruff over black and isort (#1445)
Will eventually replace pylint with ruff
2026-03-09 11:39:01 -07:00
Jesse Bannon
a097c6a476
[BACKEND][v2] More flexible formatter post_process (#1424)
Makes the underlying formatting process better handle native (non-string) types in a more flexible way. 2nd attempt since the last one got reverted due to breaking changes.
2026-01-25 22:35:51 -08:00
Jesse Bannon
c1431c8d55
Revert "[BACKEND] More flexible formatter post_process (#1421)" (#1422)
This reverts commit 60cdbad8c7.

Caused a breaking change to ytdl_options
2026-01-24 00:22:18 -08:00
Jesse Bannon
60cdbad8c7
[BACKEND] More flexible formatter post_process (#1421)
Makes the underlying formatting process better handle native (non-string) types in a more flexible way.
2026-01-23 16:36:17 -08:00
Jesse Bannon
a5ae69550e
[BACKEND] Validate write permissions on working directory and output directory (#1395)
Closes https://github.com/jmbannon/ytdl-sub/issues/1394
Should help debug user issues like https://github.com/jmbannon/ytdl-sub/issues/1148

Checks permissions on the following:
- working directory
- output directory
- cookiefile (if specified)

And will fail immediately with a verbose message.
2025-12-06 15:54:41 -08:00
Colin Davis
63753c5649
[RFC] Add preserve_mtime config (#1382)
Closes https://github.com/jmbannon/ytdl-sub/issues/386

Adds the ability to preserve mtime via Output Options. Usage:

```
output_options:
  preserve_mtime: True
```

Thanks @e1ven for the contribution!
2025-11-17 22:42:13 -08:00
Jesse Bannon
987b1cd028
[FEATURE] Ability to customize date used for deleting old files (#1221)
Implements https://github.com/jmbannon/ytdl-sub/issues/1182

Adds the ability to change the `keep_files_date_eval` (traditionally upload_date_standardized) to any date, so long as its in the form of YYYY-MM-DD.

Will be able to use this to have episodes get deleted based on their release_date or epoch_date, instead of their upload_date.
2025-05-31 08:52:15 -07:00
Jesse Bannon
88110a816d
[BUGFIX] Fix playlists not downloading correctly
Due to url ytdl-options not materializing
2024-10-25 20:47:18 -07:00
Jesse Bannon
1499d7486c
[FEATURE] Override variable support in ytdl_options (#1087)
Adds the ability to use override variables in the [ytdl_options](https://ytdl-sub.readthedocs.io/en/latest/config_reference/plugins.html#ytdl-options) section of the config.
2024-10-05 21:25:50 -07:00
Jesse Bannon
f0b3991e3e
[FEATURE] Toggle date_range to break or not (#904)
Adds a the new field `breaking` to the `date_range` plugin, to toggle whether an entry breaks subsequent metadata pulls. This is useful to disable if you are grabbing a playlist that may have videos out of order, but still want to apply a date range to it.
2024-01-18 16:23:02 -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
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
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
e9b2214a0a
[DOCS] New README with only subscriptions (#791) 2023-11-02 23:28:55 -07:00
Jesse Bannon
9f408d2196
[FEATURE] Extend subscription syntax (#790)
Extends the subscription.yaml syntax at the cost of introducing a breaking change.

# New Syntax
## Mix-n-match presets and indent variables
```
# Can mix/match presets and indent override variables.
# Uses presets TV Show, Only Recent and assigns Kids, TV-Y to subscription_indent_1 and _2
TV Show | = Kids | = TV-Y | Only Recent:
  "Jake Trains": "https://..."
```

## Subscriptions with list-value support
```
TV Show | = Kids | = TV-Y | Only Recent:
  "Jake Trains":
    - "https://url.1..."  # Assigns to subscription_value and subscription_value_1
    - "https://url.2..."  # Assigns to subscription_value_2
```

## Subscriptions with override-keys support
```
TV Show | = Kids | = TV-Y | Only Recent:
  "~Jake Trains":  # the ~ means "all keys underneath get assigned as override variables"
    url: "https://url.1..."  # Assigns to url
    url2: "https://url.2..."  # Assigns to url2
```

# Breaking Changes
In the TV show subscriptions example (https://github.com/jmbannon/ytdl-sub/blob/master/examples/tv_show_subscriptions.yaml), it had
```
TV Show Full Archive:
  # Sets "Kids" for genre, "TV-Y" for content rating
  = Kids | TV-Y:
    "Jake Trains": "https://www.youtube.com/@JakeTrains"
    "Kids Toys Play": "https://www.youtube.com/@KidsToysPlayChannel"
```
This must be changed to
```
TV Show Full Archive:
  # Sets "Kids" for genre, "TV-Y" for content rating
  = Kids | = TV-Y:  # Each indent variable assignment must have an = before it
    "Jake Trains": "https://www.youtube.com/@JakeTrains"
    "Kids Toys Play": "https://www.youtube.com/@KidsToysPlayChannel"
```
2023-11-01 20:24:06 -07:00
Jesse Bannon
309f259464
[FEATURE] Ability to migrate download archive files (#751)
With the recent push to 'beautify subscriptions' (see https://github.com/jmbannon/ytdl-sub/releases/tag/2023.10.02), we need the ability to change subscription names from their legacy form:
```
rick_a:
  preset:
    - "tv_show"
  overrides:
    tv_show_name: "Rick A"
    url: "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
```
into:
```
tv_show:
  "Rick A": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
```

This however has implications from ytdl-sub's legacy download archive naming. By default, we write archives to `.ytdl-sub-{subscription_name}-download-archive.json`. If we change the subscription name, the archive will not be found, causing a complete redownload. This new feature gives us the ability to migrate download archives to a new naming schema.

# Migrating to Beautified Subscriptions
## Step 0
BACK UP ALL CONFIG + SUBSCRIPTION FILES!!!!! If something goes wrong, restore your backup and try again and/or ask for help.

## Step 1
Since we know we'll be changing our `subscripion_name` to the value of `tv_show_name`, we can use that in our newly migrated download archive name by setting this within the `tv_show` preset (or whatever your 'base' preset is).
```
presets:
  tv_show:
    output_options:
      migrated_download_archive_name: ".{tv_show_name_sanitized}-download-archive.json" 
```

## Step 2
Perform a download as usual, via `ytdl-sub sub ...`. This will load the old archive, and save it into the new archive. You should see `MIGRATION DETECTED` within the logs. Ensure it completes successfully.

Perform another download invocation and ensure you see the `MIGRATION SUCCESSFUL` within the logs.

## Step 3
Now we can set:
```
presets:
  tv_show:
    output_options:
      # rename migrated_download_archive_name to just download_archive_name
      download_archive_name: ".{tv_show_name_sanitized}-download-archive.json" 

  overrides:
    tv_show_name: "{subscription_name}"
    url: "{subscription_value}"
```
Our download archives now default to our new format, and we set `tv_show_name` + `url` to use subscription values by default.

## Step 4
We can now beautify our subscription.yaml file to:
```
tv_show:
  "Rick A": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
```
2023-10-03 16:08:14 -07:00
Jesse Bannon
5f9b8afc4b
[BUGFIX] Do not hard-fail if the thumbnail fails to download/convert (#675)
* [BUGFIX] Do not fail with thumbnail issues

* helper

* refactor

* dry-run

* regen fixture

* download arhcive txt -> json in docs, fixtures

* return if no download thumb path

* better test

* more test coverage
2023-07-28 13:12:46 -07:00
Jesse Bannon
dcd636192c
[REFACTOR] download abstraction overhaul (#663)
* [REFACTOR] `download` abstraction overhaul

* remove plugin options
2023-07-25 00:36:51 -07:00
Jesse Bannon
7e997f304d
[REFACTOR] OptionsValidator + OptionsDictValidator (#657)
* [REFACTOR] OptionsValidator + OptionsDictValidator

* more
2023-07-24 10:12:38 -07:00
Jesse Bannon
b8d1f1edbb
[FEATURE] Ability to change download archive name (#643) 2023-06-30 11:51:52 -07:00
Jesse Bannon
a2f1a2ba94
[FEATURE] Add subscription_name override variable by default (#599)
* [FEATURE] Add `subscription_name` override variable by default

* docs for it

* lint

* only test non-cli video test
2023-04-28 19:36:20 -07:00
Jesse Bannon
14ddd750d9
[REFACTOR] Shared OptionsValidator, downloader plugins (#550) 2023-03-15 23:06:55 -07:00
Jesse Bannon
c546ce89df
[DOCS] Empty value docs for thumbnail + info json (#535) 2023-03-12 20:50:12 -07:00
Jesse Bannon
2d2fff9a40
[FEATURE] Prebuilt presets to include title in their filename (#525) 2023-03-10 10:30:35 -08:00
Jesse Bannon
798bbbc62c
[BACKEND] Windows support (#476) 2023-02-28 17:07:03 -08:00
Jesse Bannon
741e4825a9
[DOCS] Automatic sanitized override variable docs (#453)
* [DOCS] Automatic sanitized override variable docs

* formatting
2023-02-20 11:01:43 -08:00
Jesse Bannon
ab52ebbfe5
[DOCS] Extractor args example for english metadata (#415) 2023-01-13 13:59:24 -08:00
Jesse Bannon
d9584dca63
[DOCS] Add popular ytdl_options to docs (#411) 2023-01-11 22:14:29 -08:00
Jesse Bannon
44ec463ab3
[BACKEND] More strict validation for config files (#301) 2022-10-26 00:00:36 -07:00
Jesse Bannon
64d4be0a42
[BACKEND] output_directory_nfo_tags to support source vars (#239) 2022-09-17 11:11:37 -07:00
Jesse Bannon
c08ea64b5a
[BACKEND] Add generic.collection download strategy, use it for soundcloud, youtube channel/playlist (#230) 2022-09-14 15:36:14 -07:00
Jesse Bannon
5782445366
[FEATURE] Add ability for downloaders to add new override variables. Add source_title, source_uploader, and source_description for YouTube channels and playlists (#203) 2022-09-01 00:25:01 -07:00
Jesse Bannon
ca0ac787b0
[FEATURE] Ability to write .info.json files (#201) 2022-08-29 22:50:42 -07:00
Jesse Bannon
73be77c500
[FEATURE] date_range plugin, supports Override variables (#199) 2022-08-28 11:09:11 -07:00
Jesse Bannon
1f09398ad5
[FEATURE] Subtitles support via Subtitles plugin (#169) 2022-08-12 09:58:08 -07:00
Jesse Bannon
9c97fb7572
sanitized suffix (#41) 2022-05-26 23:02:40 -07:00
Jesse Bannon
29ef377cc7
Add documentation for plugins + improve docs overall (#23) 2022-05-10 22:22:03 -07:00
Jesse Bannon
ab2df88299
Overhaul docs for readthedocs (#20) 2022-05-06 22:25:29 -07:00
jbannon
2db2c88441 setup cfg 2022-04-26 07:19:53 +00:00
Renamed from ytdl_subscribe/config/preset_options.py (Browse further)