diff --git a/Dockerfile b/Dockerfile index f75e764..2477d47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,7 @@ ENV DOWNLOAD_DIR /downloads ENV STATE_DIR /downloads/.metube ENV TEMP_DIR /downloads ENV PUBLIC_HOST_URL download/ +ENV PUBLIC_HOST_AUDIO_URL audio_download/ VOLUME /downloads EXPOSE 8081 CMD [ "./docker-entrypoint.sh" ] diff --git a/README.md b/README.md index 0f0682b..51fae9f 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Certain values can be set via environment variables, using the `-e` parameter on * __DELETE_FILE_ON_TRASHCAN__: if `true`, downloaded files are deleted on the server, when they are trashed from the "Completed" section of the UI. Defaults to `false`. * __URL_PREFIX__: base path for the web server (for use when hosting behind a reverse proxy). Defaults to `/`. * __PUBLIC_HOST_URL__: base path for the links shown in the UI. Requires a trailing slash. Defaults to `download/`. +* __PUBLIC_HOST_AUDIO_URL__: same as PUBLIC_HOST_URL but for audio downloads. Defaults to `audio_download/`. * __OUTPUT_TEMPLATE__: the template for the filenames of the downloaded videos, formatted according to [this spec](https://github.com/yt-dlp/yt-dlp/blob/master/README.md#output-template). Defaults to `%(title)s.%(ext)s`. * __OUTPUT_TEMPLATE_CHAPTER__: the template for the filenames of the downloaded videos, when split into chapters via postprocessors. Defaults to `%(title)s - %(section_number)s %(section_title)s.%(ext)s`. * __YTDL_OPTIONS__: Additional options to pass to youtube-dl, in JSON format. [See available options here](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/YoutubeDL.py#L183). They roughly correspond to command-line options, though some do not have exact equivalents here, for example `--recode-video` has to be specified via `postprocessors`. Also note that dashes are replaced with underscores. diff --git a/app/main.py b/app/main.py index 3d70aa1..3daed83 100644 --- a/app/main.py +++ b/app/main.py @@ -25,6 +25,7 @@ class Config: 'STATE_DIR': '.', 'URL_PREFIX': '', 'PUBLIC_HOST_URL': 'download/', + 'PUBLIC_HOST_AUDIO_URL': 'audio_download/', 'OUTPUT_TEMPLATE': '%(title)s.%(ext)s', 'OUTPUT_TEMPLATE_CHAPTER': '%(title)s - %(section_number)s %(section_title)s.%(ext)s', 'YTDL_OPTIONS': '{}', diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts index 650a844..fc3eeb8 100644 --- a/ui/src/app/app.component.ts +++ b/ui/src/app/app.component.ts @@ -235,7 +235,7 @@ export class AppComponent implements AfterViewInit { buildDownloadLink(download: Download) { let baseDir = this.downloads.configuration["PUBLIC_HOST_URL"] ?? 'download/'; if (download.quality == 'audio' || download.filename.endsWith('.mp3')) { - baseDir = 'audio_download/'; + baseDir = this.downloads.configuration["PUBLIC_HOST_AUDIO_URL"] ?? 'audio_download/'; } if (download.folder) {