Commit graph

39 commits

Author SHA1 Message Date
Nojyto
658f5ef3e1
[BUGFIX] Fix "File name too long" error when a title is used as a folder name (#1479)
Some checks failed
ytld-sub CI (Linux) / test-lint (push) Has been cancelled
ytld-sub CI (Linux) / test-unit (push) Has been cancelled
ytld-sub CI (Windows) / test-unit (push) Has been cancelled
ytld-sub CI (Windows) / test-integration (push) Has been cancelled
ytld-sub CI (Windows) / test-integration-prebuilt-presets (push) Has been cancelled
ytld-sub CI (Windows) / test-e2e (push) Has been cancelled
ytld-sub CI (Linux) / test-integration (push) Has been cancelled
ytld-sub CI (Linux) / test-integration-prebuilt-presets (push) Has been cancelled
ytld-sub CI (Linux) / test-e2e (push) Has been cancelled
ytld-sub Docker GUI Build / version (push) Has been cancelled
ytld-sub Docker GUI Build / build (3.12) (push) Has been cancelled
ytld-sub Docker Ubuntu Build / version (push) Has been cancelled
ytld-sub Docker Ubuntu Build / build (3.12) (push) Has been cancelled
ytld-sub Docker Build / version (push) Has been cancelled
ytld-sub Docker Build / build (3.12) (push) Has been cancelled
ytld-sub Release / version (push) Has been cancelled
ytld-sub CI (Linux) / codecov-upload (push) Has been cancelled
ytld-sub Docker GUI Build / package-arm64 (push) Has been cancelled
ytld-sub Docker GUI Build / package-amd64 (push) Has been cancelled
ytld-sub Docker GUI Build / deploy (push) Has been cancelled
ytld-sub Docker Ubuntu Build / package-arm64 (push) Has been cancelled
ytld-sub Docker Ubuntu Build / package-amd64 (push) Has been cancelled
ytld-sub Docker Ubuntu Build / deploy (push) Has been cancelled
ytld-sub Docker Build / package-arm64 (push) Has been cancelled
ytld-sub Docker Build / package-amd64 (push) Has been cancelled
ytld-sub Docker Build / deploy (push) Has been cancelled
ytld-sub Release / build-linux (push) Has been cancelled
ytld-sub Release / build-windows (push) Has been cancelled
ytld-sub Release / github-release (push) Has been cancelled
ytld-sub Release / pypi-publish (push) Has been cancelled
Some presets put the video title into a folder name (not just the file name). The code only shortened the file name, never the folder name. So a title with multi-byte characters (like bold/fancy Unicode, which take 4 bytes each) could make the folder name go over the OS 255-byte limit and crash with OSError: [Errno 36] File name too long.

This fix shortens every folder in the path too, not just the file name, while keeping the file extension. output_directory is left alone so real folders aren't touched.

Added a test with a title made of 4-byte bold Unicode characters.

Relates to #1092, #1189

-- Thanks @Nojyto for the contribution!
2026-06-23 09:05:10 -07:00
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
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
d6eda27371
[BACKEND] Less string casting behind the scenes (#1425)
Simplifies internal scripts by not casting things to String when unnecessary.
2026-01-27 10:15:32 -08:00
Jesse Bannon
6b99c31e45
[BACKEND] Simplify script quote generation (#1409)
Internal script -> string generation used triple-quotes redundantly. Try to use them less to make it more human-readable.
2026-01-06 12:58:37 -08:00
Jesse Bannon
0c0f05e4d0
[DEV] Get windows testing in better state (#1214) 2025-05-03 19:40:28 -07:00
Jesse Bannon
d3295cef86
[BUGFIX] Do not perform nested scripting on file path outputs (#1123)
Fixes a bug where curly braces in file-names causes scripting to think its a variable that does not exist
2024-11-18 00:22:20 -08:00
Jesse Bannon
a3f59d5420
[DEV] Separate integration actions (#1079) 2024-09-30 23:55:15 -07:00
Jesse Bannon
5e335b195c
[FEATURE] Allow YAML maps and lists in overrides, convert to script format (#956)
Adds the ability to create map and list-based override variables. 

For example, you can now create lists like this:
```
overrides:
  urls:
    - "https://...1"
    - "https://...2"
```
which is equivalent to:
```
overrides:
  urls: >-
    {
      [
        "https://...1",
        "https://...2",
      ]
    }
```

Likewise, maps can now look like:
```
overrides:
  music_video_category:
    concerts:
      - "https://...1"
      - "https://...2"
    interviews:
      - "https://...3"
```
which is equivalent to:
```
overrides:
  music_video_category: >-
    {
      "concerts": [
        "https://...1",
        "https://...2"
      ],
      "interviews": [
        "https://...3"
      ]
    }
```
2024-06-02 20:02:48 -07: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
52d1a5887e
[DEV] String validators to allow ints, floats, bools (#810) 2023-11-16 23:50:51 -08: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
7502a76b99
[BACKEND] Enable info.json by default for TV show presets (#534) 2023-03-12 18:31:29 -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
f9318b9d07
[BUGFIX] Handle truncating file names if too long (#524)
* [BUGFIX] Handle truncating file names if too long

* always import os

* test fix

* fix for windows

* lint
2023-03-10 07:20:43 -08:00
Jesse Bannon
a2808fa7fe
[BACKEND] Properly sanitize recursive variables (#477)
* [BACKEND] Properly sanitize recursive variables

* lint

* update tests
2023-02-25 09:35:41 -08:00
Jesse Bannon
9b90c367a5
[DOCS] Better error message for strict override variable fields (#452)
* [DOCS] Better error message for strict override variable fields

* fix unit test
2023-02-20 10:57:40 -08:00
Jesse Bannon
e5b5c5e638
[BACKEND] Bandcamp e2e test, update music example (#393)
* [BUGFIX] Fix missing contains function when checking entries

* remove children func

* [BACKEND] Bandcamp e2e test, update music example

* WIP

* combine soundcloud and all music into music_audio config

* sc fixtures

* updated tests and examples

* bandcamp e2e test

* regen off

* remove url validators

* use bandcamp artist url for more parent coverage

* lint
2023-01-14 16:48:27 -08:00
Jesse Bannon
f24860c729
[BUGFIX] Properly sanitize override variables after it is resolved (#223)
* [BUGFIX] Properly sanitize override variables after it is resolved

* fixtures
2022-09-08 07:47:55 -07:00
Jesse Bannon
034855fbc4
[FEATURE+BUGFIX] Add kodi_safe arg for NFO plugins, support YT shorts (#157) 2022-08-05 16:53:36 -07:00
Jesse Bannon
b28ef2365b
[BACKEND] Allow more nesting for source + override variables (#150) 2022-08-04 14:42:20 -07:00
Jesse Bannon
962b26d1ec
[BACKEND] Allow list validators to support length-1 lists without defining a yaml list (#126) 2022-07-26 09:10:51 -07:00
Philipp Rintz
12a857bf9a
[BUGFIX] Fix youtube url validator for channels without 'c', 'channel' or 'user' (#109)
* Fix youtube url validator for channels without 'c', 'channel' or 'user'

* Fix linter errors
2022-07-18 11:48:23 -07:00
Jesse Bannon
53adbbcb22
[FEATURE] Regex capture and filtering on source variables plugin (#100)
* actually working

* changed plugin format. Need unit tests, documentation, update e2e to filter

* refactor plugin name, matching now working

* description work in progress, need more intricate testing

* tests looks good, regenerate output

* e2e tested, need more failure tests, no dupe variable names, add docs

* unit tests passing again

* more fail tests

* updated with name, default, better docs

* sanitized vars created
2022-07-16 23:39:46 -07:00
Jesse Bannon
119a0c212f
[BACKEND] Add regex validators (#97)
* [BACKEND] Add regex validators
2022-07-10 17:47:55 -07:00
Jesse Bannon
4447f456d5
Validate all preset StringFormatValidators on init (#79)
* fast fail

* update error msg in test
2022-06-28 09:34:30 -07:00
Jesse Bannon
a79fcaa25b
Use URLs instead of IDs for sources (#70)
* youtube video url

* WIP, channel /user/ and /c/ should be valid

* unit tests passing

* soundcloud artist url

* soundcloud username

* break configs with name change

* Update all yamls with urls

* update all docs

* more negative url tests
2022-06-05 16:19:08 -07:00
jbannon
2db2c88441 setup cfg 2022-04-26 07:19:53 +00:00
jbannon
139d82e126 big midnight refactor 2022-04-22 07:34:51 +00:00
jbannon
21e8e6fa51 overrides formatter tests 2022-04-12 06:10:05 +00:00
jbannon
1243832178 more unit tests 2022-04-12 04:47:54 +00:00
jbannon
4c01198ce9 update unit tests 2022-04-12 04:23:52 +00:00
jbannon
2b9ab7c3af update black line-len to 100 2022-04-06 07:30:35 +00:00
jbannon
05737d2b19 remove formatting logic out of entry 2022-04-06 07:28:38 +00:00
jbannon
451b3564c5 return string formatters in overrides dict 2022-04-06 06:09:16 +00:00
jbannon
a6006b3def literal dict validator tests 2022-04-05 15:57:45 +00:00
jbannon
14d8440ee7 tests, docstrings 2022-04-05 07:37:34 +00:00
jbannon
84db8d20be make validator abstract, unit tests for bool and str validator 2022-04-05 07:00:45 +00:00