ytdl-sub icon indicating copy to clipboard operation
ytdl-sub copied to clipboard

How to implement scripting functions

Open alan-cugler opened this issue 9 months ago • 2 comments

Hello, I am looking to take a youtube playlist and use the date to break things up into seasons and episodes. I see its suggested to use year as season and months or days as episodes. This works but I would like to make a python script to make standard seasons and episodes that are derived from those dates and cross referenced with the info.json file that is saved with other videos downloaded from the playlist for when the playlist gets updated the program can determine what the latest video should be labeled for season and episode.

example: video: 2000, 01, 10 --> season: Season 01, Episode 01 video: 2000, 03, 12 --> season: Season 01, Episode 02 video: 2001, 01, 22 --> season: Season 02, Episode 01

I am just not sure how to mark to use a custom python script in the yaml file for dynamically determining a variable.

I use the salt program for managing infrastructure. This is written in python and uses yaml just as this project does. When using that program they use jinja2 for dynamically filling variables and you can reference python scripts to run in that jinja. I see scripting docs for this project were developed, but I wasnt able to translate them into a working example yet.

alan-cugler avatar May 12 '24 14:05 alan-cugler