Commit graph

33 commits

Author SHA1 Message Date
Jesse Bannon
1156e0070a
[DEV] Make inspect resolution more human readable (#1451)
Removes a lot of the boilerplate output around `concat` and `sanitize`.
2026-03-13 16:27:56 -07:00
Jesse Bannon
c46de048ca
[FEATURE] %range function (#1405)
Add `%range` function, equivalent to Python's `range`.
2025-12-31 09:06:08 -08:00
Ross Patterson
895e6ea972
[DOCS] Clarify debugging, support, reporting (#1305)
Reconcile the various debugging hints throughout the documentation and integrate into a
central debugging page. Includes clarification of the roles of ytdl-sub, yt-dlp, and
external services. Also adds cross references to the relevant bits across the docs.
2025-08-27 09:10:01 -07:00
Ross Patterson
a642028d7b
[DOCS] Clarify the = YAML key prefix (#1297)
This is another change that touches the generated docs, so after finishing my writing, I
copied the change to `./docs/source/config_reference/scripting/static_variables.rst`
into the corresponding docstring in
`./src/ytdl_sub/entries/variables/override_variables.py` and formatted it as a
docstring. Then I ran:

    $ REGENERATE_DOCS=1 tox exec -e "py" -- pytest tests/unit/docgen/test_docgen.py

But all that did was revert the changes to
`./docs/source/config_reference/scripting/static_variables.rst`. IOW, it did *not*
update the rST from the changed docstring.
2025-08-24 09:17:38 -07:00
Ross Patterson
60ff645750
[DOCS] Consistent headings, newlines, wraps (#1293)
I've been running into variations in style in the docs I've edited so far. I've been
including changes for consistency in with other commits but in many cases that makes one
part of one doc more consistent with the rest but less consistent with itself. It seems
like a bit of cleanup may be in order.

This change applies the following conventions:

- Section heading heirarchy:
  #. ``=`` with overline for document title, IOW first heading
  #. ``-``
  #. ``~``
  #. ``"``

- Two newlines before ``-`` sections for readability

- A newline between every section of any level and the first line of text

- Wrap paragraph lines at 88 characters to match Python's Black

I've only applied these changes to those ``*.rst`` files that aren't generated.

In the future, I might suggest another bulk change to match [the Sphinx conventions for
section
headings](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#sections).
2025-08-20 20:20:19 -07:00
Jesse Bannon
191fa3c1bb
[DOCS] Add warning for auto-generated docs (#1285) 2025-08-17 07:07:25 -07:00
Jesse Bannon
f6bce88ebd
[FEATURE] height and width variables (#1243)
Adds `height` and `width` entry variables, representing pixels to know resolution. For audio, defaults to 0.
2025-06-18 20:56:25 -07:00
Jesse Bannon
66fd7cf41c
[FEATURE] Add scripting print functions (#1230)
Add the ability to print custom messages in override scripts. Adds the functions
- `print`
- `print_if_true`
- `print_if_false`

Will be used to make under-the-hood preset things more verbose.
2025-05-31 12:15:57 -07:00
Jesse Bannon
36e23839f3
[FEATURE] Ability to change season and episode ordering via variables, support for release_date (#1220)
Adds the ability to change season and episode ordering using override variables, like so:

```
       "~Kids Toys Play":
          url: "https://www.youtube.com/@KidsToysPlayChannel"
          tv_show_by_date_season_ordering: "upload-year-month"
          tv_show_by_date_episode_ordering: "upload-day"
```

In addition, adds support for release-date based episode ordering (and culling if using Only Recent).
More info here: https://ytdl-sub.readthedocs.io/en/latest/prebuilt_presets/tv_shows.html

Closes https://github.com/jmbannon/ytdl-sub/issues/1182
2025-05-31 10:26:42 -07: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
a4293398b7
[FEATURE] Add join and strip string functions to scripting (#1218) 2025-05-04 18:19:32 -07:00
Jesse Bannon
53d84d8c1e
[FEATURE] Toggleable keyword evaluation behavior (#1130)
With the `Filter Keywords` prebuilt preset, can now set keyword evaluation to be either `ANY` or `ALL`. More info here: https://ytdl-sub.readthedocs.io/en/latest/prebuilt_presets/helpers.html#filter-keywords
2024-11-26 08:20:42 -08:00
Jesse Bannon
6a756cfecf
[BUGFIX] Move unescape parsing to separate function (#1108)
Fixes #1107 
```
FunctionRuntimeException: Runtime error occurred when executing the function %from_json: Invalid control character
```
2024-10-27 15:26:25 -07:00
Jesse Bannon
79ba60021c
[BACKEND] Proper functions with docstrings (#1061)
Reimplement some of the 'hidden' functions, including `%regex_capture_many`, as standard functions with docstrings
2024-09-25 23:24:49 -07:00
Jesse Bannon
10cb82a69a
[BACKEND] %contains_any function, list + dict support for tilda overrides mode (#1054)
Adds the function `%contains_any`, and list support in a tilda override subscription. The end-goal of these features are to more easily add a title exclude list, like so:

```
__preset__:
  filter_exclude:
    - "{%contains_any( %lower(title), exclude_title_strings )}"

...
Jellyfin TV Show by Date:
  ~History Documentaries:
    url: "https://..."
    exclude_title_strings:
      - "trailer"
      - "preview"
```

A proper prebuilt preset or built-in functionality will follow this change.
2024-09-20 09:23:22 -07:00
Jesse Bannon
5e9472986a
[FEATURE] Enhance music video presets using specialized map syntax (#808)
Enhances the music video presets by supporting the following syntax:

`subscriptions.yaml`
```
__preset__:
  overrides:
    music_video_directory: "/music_videos"

# Choose between Jellyfin/Kodi/Plex Music Videos preset:
#   - Plex Music Videos:
#   - Jellyfin Music Videos:
#   - Kodi Music Videos:
#
"Plex Music Videos":

  = Pop:  # Sets genre tag to "Pop"
    "Rick Astley": "https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc"
    "Michael Jackson": "https://www.youtube.com/playlist?list=OLAK5uy_mnY03zP6abNWH929q2XhGzWD_2uKJ_n8E"

  = Rock:
    # Prefixing with '+' puts the subscription into 'map-mode'.
    # Music video presets in map-mode support grouping videos into different
    # categories, which get set on the album field.
    #
    # URLs can either be strings, or maps that can overload title, year, date
    "+ Guns N' Roses":
      Music Videos:
        - "https://www.youtube.com/playlist?list=PLOTK54q5K4INNXaHKtmXYr6J7CajWjqeJ"
      Concerts:
        - title: "Live at The Ritz - New York City"
          year: "1988"
          url: "https://www.youtube.com/watch?v=OldpIhHPsbs"
        - title: "Live at The Hollywood Bowl"
          date: "2023-01-11"
          url: "https://www.youtube.com/watch?v=Z7hutGlvq9I"
```
The 'map-mode' (denoted by `+`) lets you specify a map of music video categories. Under each category, a URL can be specified as-is or with additional metadata (title, year/date, url).

Music videos and concerts, especially older ones, are typically uploaded by random users with inconsistencies in their titles. This syntax aims to make it easy to specify individual URLs with the ability to overwrite their title and year, and group them by category.
2024-06-06 11:50:33 -07:00
Jesse Bannon
325d229061
[BUGFIX] Fix usage of ~ in paths (#981)
Fixes path with tildes in them, i.e. `~/videos/youtube`
2024-05-10 19:57:48 -07:00
Tomas Babej
1d176050a7
[FEATURE] %regex_sub built-in script function (#971)
This implements %regex_sub built-in function to enhance string-processing capabilities, allowing users to perform substitutes like:

- removing non-ascii characters
- replacing subsequent whitespace characters with a single whitespace

Thanks @tbabej !
2024-04-27 22:47:29 -07:00
Jesse Bannon
c622cf68b5
[DEV] Escapable curly braces (#955) 2024-04-01 22:40:56 -07:00
Jesse Bannon
017db953bf
[FEATURE] Automatically handle playlists ordered in reverse (#948)
Playlists have always been a pain-point with ytdl-sub. If an author adds new videos to the end of a playlist, as opposed to the front, it breaks ytdl-sub's intuition of incremental scraping by breaking on the first (oldest) video. This update now makes it possible to handle this in the prebuilt TV Show presets:
- Add each URL variable (`url`, `url2`, ...) into the `download` portion of the subscription twice
- First definition is what we all know and use, simply scrapes first-to-last, then downloads last-to-first
- Second definition does the following:
  - Check to see if a URL is a YouTube playlist URL, if so...
    - Set the field to download, but with modifications to scrape last-to-first, then download first-to-last
  - Otherwise...
    - Set the field to an empty string, which means ytdl-sub will skip it
2024-04-01 04:24:41 -07:00
Jesse Bannon
b3374cb4d5
[DEV] %map_extend scripting function (#906)
* [DEV] `%map_extend` scripting function

* lint
2024-01-19 00:51:44 -08:00
Jesse Bannon
213580ee84
[DEV] Add type-check functions (#905) 2024-01-18 23:24:10 -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
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
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
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