xymaxim / ytpb

A playback for YouTube live streams
https://ytpb.readthedocs.io
MIT License
6 stars 0 forks source link

Title length in output filenames is quite long #1

Open xymaxim opened 9 months ago

xymaxim commented 9 months ago

The current default maximum output title length is 60, and it looks too long:

https://github.com/xymaxim/ytpb/blob/dfb8eb39f9cf7b0533221960019c43dc504db2ea/src/ytpb/config.py#L120

Considering the length of the date part ('20240102T102030+00') equals to 18, 4-characters extension plus the title length itself, the output filename turns out to be quite long. While it doesn't exceed the maximum length limitation, it looks fuzzy and other parts get visually lost.

Reasoning

The title length should be enough to identify a video. It helps to: (a) uniquely distinct a video among others, already downloaded ones, and (b) to understand/bring back to memory what's inside.

For the first, for example, the video ID is ideal, but it's almost impossible to connect them in your head. Usually, three or four words would be enough for the output titles. However, in some cases it won't work. For example, when there are two videos of the one location but from different cams:

It's not a problem for these examples because of the length:

One idea might be to compose the shorten output title from the original beginning and end, e.g. Jackman-Maine-Newton-Right. It's not general, however, and it will fail in other cases: some videos end with "live", "camera", etc.

Proposed solution

The solution would be to reduce the maximum length of the output title to, say, 30 characters. It would be enough to include three or four words with separators.

As for the case above, the resulted output filename will be Jackman-Maine-Newton-Field_20240102T102030+00.mp4. Not great for two videos, but we can, for example, introduce the --config-param option to override the default values: --config-param output.title.max-length=none.

xymaxim commented 9 months ago

Having the shorter length limit of 30 characters, to produce two distinctive titles from the example above, I'll need this:

$ ytpb ... --output <title>-Right_<input_start_date> ...
$ ytpb ... --output <title>-Left_<input_start_date> ...

Often, it's just too lazy and repetitive to retype the defined output template. It would be helpful to have an option to append a suffix after titles. For example:

--config-param 'output.title.suffix=Right'

or

--output-title-suffix Right