Skip to content

Commit

Permalink
feat: add 'url' template option to '--exec'
Browse files Browse the repository at this point in the history
  • Loading branch information
lightpohl committed Oct 9, 2024
1 parent f4cd705 commit 6f305c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ If no match is found, the `custom_<n>` keyword will be replaced with an empty st
- `episode_path_base`: The path to the folder of the downloaded episode.
- `episode_filename`: The filename of the episode.
- `episode_filename_base`: The filename of the episode without its extension.
- `url`: URL of episode audio file.

## Log Levels

Expand Down
1 change: 1 addition & 0 deletions bin/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ const downloadItemsAsync = async ({
basePath,
outputPodcastPath,
episodeFilename,
episodeAudioUrl,
});
}

Expand Down
4 changes: 3 additions & 1 deletion bin/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ const runExec = async ({
basePath,
outputPodcastPath,
episodeFilename,
episodeAudioUrl,
}) => {
const episodeFilenameBase = episodeFilename.substring(
0,
Expand All @@ -699,7 +700,8 @@ const runExec = async ({
.replace(/{{episode_path}}/g, `"${outputPodcastPath}"`)
.replace(/{{episode_path_base}}/g, `"${basePath}"`)
.replace(/{{episode_filename}}/g, `"${episodeFilename}"`)
.replace(/{{episode_filename_base}}/g, `"${episodeFilenameBase}"`);
.replace(/{{episode_filename_base}}/g, `"${episodeFilenameBase}"`)
.replace(/{{url}}/g, `"${episodeAudioUrl}"`);

await execWithPromise(execCmd, { stdio: "ignore" });
};
Expand Down

0 comments on commit 6f305c1

Please sign in to comment.