Commit graph

225 commits

Author SHA1 Message Date
Jesse Bannon
83ecd19c77
[FEATURE] Process all subscriptions even if one or more error (#771)
Closes GH Issue #766, partially closes #520

Prior to this release, no other subscriptions would download if a subscription before it had an error. Now, subscriptions will continue to download even if one has an error, and will be reported in the output summary.
2023-10-21 12:25:38 -07:00
Jesse Bannon
1cb70e4520
[DEV] Refactor entrypoint file (#765) 2023-10-18 23:33:25 -07:00
Jesse Bannon
4105c2ed40
[FEATURE] No longer require a config.yaml (#763)
The only required field in a config was `working_directory`. This is now optional (defaults to `.ytdl-sub-working-directory`) making it so a config is no longer required. This sets the stage to onboard noob users who will solely use prebuilt presets in a single subscription file
2023-10-18 09:58:37 -07:00
Jesse Bannon
545f186c46
[FEATURE][BUGFIX] Beautiful subscriptions syntax update + fix (#758)
A follow-up to the prior commit which fixes some bugs in the 'beautiful subscriptions' implementation. A proper migration guide will be written in the wiki once it's ready
2023-10-17 16:30:50 -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
ae3739cdd3
[DEV] Do not hash .info.json files in expected download summaries (#752) 2023-10-03 13:22:19 -07:00
Jesse Bannon
c255f40348
[FEATURE] Subscription nesting (#747)
Closes Feature Request: https://github.com/jmbannon/ytdl-sub/issues/743

Subscriptions support using presets as keys, and using keys to set override variables as values.
For example:

```
tv_show:
  only_recent:
    [News]:
      "Breaking News": "https://www.youtube.com/@SomeBreakingNews"

  [Tech]:
    "Two Minute Papers": "https://www.youtube.com/@TwoMinutePapers"
```
Will create two subscriptions named "Breaking News" and "Two Minute Papers", equivalent to:

```
"Breaking News":
  preset:
    - "tv_show"
    - "only_recent"

  overrides:
    subscription_indent_1: "News"
    subscription_name: "Breaking News"
    subscription_value: "https://www.youtube.com/@SomeBreakingNews"

"Two Minute Papers":
  preset:
    - "tv_show"

  overrides:
    subscription_indent_1: "Tech"
    subscription_name: "Two Minute Papers"     subscription_value: "https://www.youtube.com/@TwoMinutePapers"
```

You can provide as many parent presets in the form of keys, and subscription indents as ``[keys]``.
This can drastically simplify subscription definitions by setting things you want configurable like so in your
parent preset:

```
presets:
  tv_show_name:
    overrides:
      tv_show_name: "{subscription_name}"
      url: "{subscription_value}"
      genre: "{subscription_indent_1}"
```

NOTE!!!
Changing your subscription name from 'legacy' subscriptions will need their download archive file migrated to a new name. A future update will assist in this migration process. Either wait until then or, if you consider yourself a ytdl-sub expert, keep a backup of your subscription file before migrating.
2023-10-02 16:07:48 -07:00
Jesse Bannon
3e41e0f59e
[FEATURE] Ability to add subscription value via config (#744)
`Subscription Value` is the mechanism used to achieve one-liner subscriptions. It works by having the subscription `"Subscription Name": "value"`, and assigning `"value"` to an override variable via setting the subscription value to that override variable's name.

This feature allows you to set subscription value within the config. In the near future, ytdl-sub will strive to make subscription files simpler by hiding most of the "under-the-hood" logic within the config file.
2023-09-27 21:37:36 -07:00
Jesse Bannon
6615e1d1ac
[BACKEND] Always filter out live, post_live, and upcoming videos on download (#742)
Closes Issue: https://github.com/jmbannon/ytdl-sub/issues/729

Add a new field to the match_filter plugin: `download_match_filters`. This set of filters will be applied at the download stage (as opposed to `filters` which get applied at the metadata stage). By default, always set `"!is_live & !is_upcoming & !post_live"` as a download filter. This prevents ytdl-sub from hanging when trying to grab live and upcoming videos.

Docs on match-filters: https://ytdl-sub.readthedocs.io/en/latest/config.html#match-filters
2023-09-24 06:24:21 -07:00
Jesse Bannon
3d9c35519d
[BACKEND] More explicit error message for PermissionError (#736)
Do not print the full stack trace when a PermissionError occurs
2023-09-21 23:06:57 -07:00
Jesse Bannon
0008bf3aca
[FEATURE] More verbose error logs when using ytdl-sub commands (#717)
Add a more informative error message when the config file is missing, and when no command is supplied (i.e. sub, dl, view)
2023-09-15 12:35:34 -07:00
Jesse Bannon
a48efdc84c
[FEATURE] format plugin to set yt-dlp format easier (#714)
Makes setting yt-dlp's `format` field easier by giving it its own documented plugin.

Old:
```
my_format_preset:
  ytdl_options:
    format: "best"
```

New:
```
my_format_preset:
  format: "best"
```

The old method will still work, so do not worry about updating configs ASAP. However, the option is available to save a few lines 😉
2023-09-13 00:02:19 -07:00
Jesse Bannon
792da1ba86
[BACKEND] Set merge_output_format to file_convert file type (#699)
Adds a small optimization to potentially avoid an additional remux by setting yt-dlp's merge output format to the desired format in the `file_convert` plugin (https://ytdl-sub.readthedocs.io/en/latest/config.html#file-convert)
2023-09-02 11:18:04 -07:00
Jesse Bannon
da70c725fc
[FEATURE] Support best codec type in audio_extract (#700)
Adds support to the `audio_extract` plugin (https://ytdl-sub.readthedocs.io/en/latest/config.html#audio-extract) to the following to grab the best audio format available:

```
audio_extract:
  codec: "best"
```
2023-09-02 00:50:26 -07:00
Jesse Bannon
ac7b366530
[DEV] Fix split-by-chapters test (#702)
Fixing the split_by_chapters test suite. Also do not make releases for commits with [DEV] in them. If you see this, it didn't work 😅
2023-09-02 00:04:37 -07:00
Jesse Bannon
85c98f2eb8
[BACKEND] Include yaml exception in error (#678)
* [BACKEND] Include yaml exception in error

* unit test

* escape
2023-07-29 23:05:34 -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
a9e6a80111
[REFACTOR] Support simple download (#671)
* [REFACTOR] Support simple `download`

* fix test

* asdfas
2023-07-26 09:00:00 -07:00
Jesse Bannon
598b1da8a4
[REFACTOR] Purge download_strategy from configs + tests (#670) 2023-07-25 20:26:04 -07:00
Jesse Bannon
d24048bb01
[REFACTOR] No more download strategy (#669)
* [REFACTOR] No more download strategy

* remove more
2023-07-25 19:51:50 -07:00
Jesse Bannon
3c0d05a383
[REFACTOR] Single download options (#668)
* [REFACTOR] Single download options

* update

* fix unit test msg
2023-07-25 14:41:33 -07:00
Jesse Bannon
77487aee86
[FEATURE] Simplify `video_tags` (#661)
* [FEATURE] Simplify ``video_tags``

* video tags old

* change for episode

* deprecation notice
2023-07-24 18:18:53 -07:00
Jesse Bannon
cc38db9c7a
[FEATURE] Simplify `music_tags` plugin (#660)
* [FEATURE] Simplify ``music_tags`` plugin

* docs

* more compatible

* check old format better

* better dict instantiate
2023-07-24 18:05:54 -07:00
Jesse Bannon
0cbd2af4d3
[FEATURE] embed_thumbnail plugin (#659)
* [REFACTOR] OptionsValidator + OptionsDictValidator

* more

* [FEATURE] Dedicated embed_thumbnail plugin

* tests

* fix test

* docs

* deprecation notices

* priority to run after file convert

* naming

* fixtures
2023-07-24 12:07:36 -07:00
Jesse Bannon
8d2999c2b2
[BACKEND] Upgrade yt-dlp version (#654)
* [BACKEND] Upgrade yt-dlp version

* downgrade pyyaml

* update mediafile

* update fixtures
2023-07-17 14:05:51 -07:00
Jesse Bannon
7a43b0a90b
[FEATURE] Add __value__ to subscription files to be able to create one-liner subs (#641)
* [FEATURE] Add __value__ to subscription files to create one-liner subs

* docs
2023-06-29 23:57:54 -07:00
Jesse Bannon
557854fc83
[FEATURE] release_date source variables (#638)
* [FEATURE] `release_date` source variables

* lint
2023-06-24 23:01:18 -07:00
Jesse Bannon
a993beff0e
[FEATURE] Ability to use overrides in regex plugin (#631)
* [FEATURE] Ability to use overrides in regex plugin

* lint

* more tests

* more docs

* docs
2023-06-17 13:02:35 -07:00
Jesse Bannon
ac5561cb2e
[FEATURE] Content rating override variable (#626)
* [FEATURE] Content rating override variable

* docs
2023-06-03 07:42:16 -07:00
Jesse Bannon
ec447cfbd7
[FEATURE] exclude field in regex plugin (#620)
* [FEATURE] `exclude` field in regex plugin

* tests

* excludes doc
2023-05-22 10:23:00 -07:00
Jesse Bannon
0497f2b749
[FEATURE] Perform match-filter on download, not metadata pull (#612)
* [FEATURE] Apply match-filter on download instead of metadata

* correct ytdl_option ordering

* lint

* test that downloads
2023-05-18 09:52:24 -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
Benjamin Hsieh
14c7865165
[FEATURE] channel_id source variable (#575) 2023-03-31 21:25:13 -07:00
Benjamin Hsieh
e1f2e37858
[FEATURE] creator_sanitized source variable (#574) 2023-03-31 20:47:44 -07:00
Jesse Bannon
fa6eae7423
[FEATURE] creator source variable (#572) 2023-03-31 15:37:06 -07:00
Jesse Bannon
1965bc0a40
[FEATURE] Multiple URLs supported for tv_show_by_date preset (#568)
* [BACKEND] Support empty urls for multi_url, add overrides for extra urls in tv_show_by_date preset

* need to check for missing urls in downloader

* use override in test

* docs about multi url

* wording
2023-03-30 09:28:32 -07:00
Jesse Bannon
c8de12833e
[BUGFIX] Read parent preset download strategy when partial validating (#566) 2023-03-28 20:35:07 -07:00
Jesse Bannon
4b9709aeab
[FEATURE] Configurable file_name_max_bytes (#562)
* config for max file size, need to move to defaults file

* wroking
2023-03-25 20:17:38 -07:00
Jesse Bannon
84cd611f89
[BUGFIX] File name too long with -thumb.jpg, upgrade docker alpine image (#560) 2023-03-24 11:15:54 -07:00
Jesse Bannon
7385aac1ee
[FEATURE][EXPERIMENTAL] --update-with-info-json (#557)
* [FEATURE
] Reformat existing downloads

* working?!?!

* reformat in output dir

* close, need info json enabled by default

* asdfadsfsaf

* lint

* closer

* multi created variables do not exist for update command!

* info json downloader

* [REFACTOR] Shared plugin and download options class

* more refactoring

* lint

* put in initialize plugins

* changes

* [REFACTOR] simplify enhanced download archive

* working!

* in main

* simplified, many url tests working

* ready?
2023-03-21 08:05:08 -07:00
Jesse Bannon
ecdae163f6
[FEATURE] tv_show_by_date preset to support multiple URLs (#552) 2023-03-16 20:25:10 -07:00
Jesse Bannon
7c692cda6e
[REFACTOR] BaseDownloader (#542)
* [REFACTOR] BaseDownloader

* doh

* fix mock
2023-03-14 23:42:50 -07:00
Jesse Bannon
f4807aa9a4
[BUGFIX] Do not load YAML unless dict is returned (#541) 2023-03-14 23:06:51 -07:00
Jesse Bannon
e69933d525
[REFACTOR] Split metadata and download into two separate steps (#540) 2023-03-13 22:41:09 -07:00
Jesse Bannon
1922296c31
[REFACTOR] BaseDownloader class (#539) 2023-03-13 00:42:32 -07:00
Jesse Bannon
52c1cc437d
[BACKEND] Fixed TV show name for prebuilt preset unit tests (#538) 2023-03-12 23:29:04 -07:00
Jesse Bannon
7502a76b99
[BACKEND] Enable info.json by default for TV show presets (#534) 2023-03-12 18:31:29 -07:00
Jesse Bannon
bc90348bf0
[BUGFIX] Reinitialize debug log for every test (#530) 2023-03-10 14:37:59 -08:00
Jesse Bannon
54697f6ddf
[BUGFIX] Fix flakey unit test (#529) 2023-03-10 13:21:27 -08:00
Jesse Bannon
0cd8df6e11
[BUGFIX] Fix extractor IDs in yt-dlp download archive (#528) 2023-03-10 12:48:53 -08:00