Originally created by @ascpixi on GitHub (Sep 7, 2024).
describe the feature you'd like to see
A custom filename format feature would be useful for e.g. those that like to have a consistent naming scheme when archiving videos or audio. For example, if cobalt were to support an arbitrary JavaScript snippet, one could specify the following template:
`[${service.toUpperCase()}] ${name} (${id})`
...where the variables are defined as follows:
service="YouTube"name="Rick Astley - Never Gonna Give You Up (Official Music Video)"id="dQw4w9WgXcQ"
...cobalt would download the file as [YOUTUBE] Rick Astley - Never Gonna Give You Up (Official Music Video) (dQw4w9WgXcQ).mp4. As audio and video files have different parameters, the user would be able to specify a different template for videos and audio.
As I have not contributed to cobalt, I'm not sure if eval would be a security risk (I don't know if the filename is determined client-side or server-side). If it is, a simple token replacement would also be great, e.g. [$service] $name ($id), where cobalt would simply do:
Originally created by @ascpixi on GitHub (Sep 7, 2024).
### describe the feature you'd like to see
A custom filename format feature would be useful for e.g. those that like to have a consistent naming scheme when archiving videos or audio. For example, if cobalt were to support an arbitrary JavaScript snippet, one could specify the following template:
```js
`[${service.toUpperCase()}] ${name} (${id})`
```
...where the variables are defined as follows:
```js
service = "YouTube"
name = "Rick Astley - Never Gonna Give You Up (Official Music Video)"
id = "dQw4w9WgXcQ"
```
...cobalt would download the file as `[YOUTUBE] Rick Astley - Never Gonna Give You Up (Official Music Video) (dQw4w9WgXcQ).mp4`. As audio and video files have different parameters, the user would be able to specify a different template for videos and audio.
As I have not contributed to cobalt, I'm not sure if `eval` would be a security risk (I don't know if the filename is determined client-side or server-side). If it is, a simple token replacement would also be great, e.g. `[$service] $name ($id)`, where cobalt would simply do:
```js
filenameTemplate
.replaceAll("$service", serviceName)
.replaceAll("$name", mediaName)
.replaceAll("$id", mediaId);
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @ascpixi on GitHub (Sep 7, 2024).
describe the feature you'd like to see
A custom filename format feature would be useful for e.g. those that like to have a consistent naming scheme when archiving videos or audio. For example, if cobalt were to support an arbitrary JavaScript snippet, one could specify the following template:
...where the variables are defined as follows:
...cobalt would download the file as
[YOUTUBE] Rick Astley - Never Gonna Give You Up (Official Music Video) (dQw4w9WgXcQ).mp4. As audio and video files have different parameters, the user would be able to specify a different template for videos and audio.As I have not contributed to cobalt, I'm not sure if
evalwould be a security risk (I don't know if the filename is determined client-side or server-side). If it is, a simple token replacement would also be great, e.g.[$service] $name ($id), where cobalt would simply do:@KwiatekMiki commented on GitHub (Sep 7, 2024):
#228
@ascpixi commented on GitHub (Sep 7, 2024):
Ah, I see, thanks. Closing as a duplicate.