From d01fb2a5b48e54b716faf18d427faf078766ae49 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Wed, 10 Jan 2024 16:36:41 +0300 Subject: [PATCH 1/2] README update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e531b13a..a8411de9 100644 --- a/README.md +++ b/README.md @@ -65,10 +65,10 @@ Certain values can be set via environment variables, using the `-e` parameter on * __YTP_CONFIG_PATH__: path to where the queue persistence files will be saved. Defaults to `/config` in the docker image, and `./var/config` otherwise. * __YTP_DOWNLOAD_PATH__: path to where the downloads will be saved. Defaults to `/downloads` in the docker image, and `./var/downloads` otherwise. * __YTP_TEMP_PATH__: path where intermediary download files will be saved. Defaults to `/tmp` in the docker image, and `./var/tmp` otherwise. -* __YTP_TEMP_KEEP__: Whether to keep the Individual video temp directory or remove it. Useful for live streams that don't keep archive. Defaults to `false`. +* __YTP_TEMP_KEEP__: Whether to keep the Individual video temp directory or remove it. Defaults to `false`. * __YTP_URL_PREFIX__: base path for the web server (for use when hosting behind a reverse proxy). Defaults to `/`. * __YTP_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`. This will be the default for all downloads unless the request include output template. -* __YTP_KEEP_ARCHIVE__: Whether to keep history of downloaded videos to prevent downloading same file multiple times. Defaults to `false`. +* __YTP_KEEP_ARCHIVE__: Whether to keep history of downloaded videos to prevent downloading same file multiple times. Defaults to `true`. * __YTP_YTDL_DEBUG__: Whether to turn debug logging for the internal `yt-dlp` package. Defaults to `false`. * __YTP_ALLOW_MANIFESTLESS__: Allow `yt-dlp` to download live streams videos which are yet to be processed by YouTube. Defaults to `false` * __YTP_HOST__: Which ip address to bind to. Defaults to `0.0.0.0`. From c24f218670073455b008c88d90880818f3f7ab05 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Thu, 11 Jan 2024 19:08:01 +0300 Subject: [PATCH 2/2] Use different icon to differentiate Live vs normal download. --- .vscode/launch.json | 3 +-- app/Download.py | 4 +++- app/DownloadQueue.py | 2 +- frontend/src/components/Page-Completed.vue | 4 ++++ frontend/src/main.js | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index cc9939a7..00142ba4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -26,8 +26,7 @@ "type": "python", "request": "launch", "program": "app/main.py", - "console": "integratedTerminal", - "justMyCode": true, + "console": "internalConsole", "env": { "YTP_CONFIG_PATH": "${workspaceFolder}/var/config", "YTP_DOWNLOAD_PATH": "${workspaceFolder}/var/downloads", diff --git a/app/Download.py b/app/Download.py index 9d2fd40a..5f427ad2 100644 --- a/app/Download.py +++ b/app/Download.py @@ -29,6 +29,7 @@ class Download: tempPath: str = None notifier: Notifier = None canceled: bool = False + is_live: bool = False _ytdlp_fields: tuple = ( 'tmpfilename', @@ -73,6 +74,7 @@ class Download: config = Config.get_instance() self.max_workers = int(config.max_workers) self.tempKeep = bool(config.temp_keep) + self.is_live = bool(info.is_live) or info.live_in is not None def _progress_hook(self, data: dict): dicto = {k: v for k, v in data.items() if k in self._ytdlp_fields} @@ -209,7 +211,7 @@ class Download: if self.tempKeep is True or not self.tempPath: return - if self.info.status != 'finished' and (self.info.live_in or self.info.is_live): + if self.info.status != 'finished' and self.is_live: log.warning( f'Keeping live temp directory: {self.tempPath}, as the reported status is not finished [{self.info.status}].') return diff --git a/app/DownloadQueue.py b/app/DownloadQueue.py index 6a65bc8f..9d0b795c 100644 --- a/app/DownloadQueue.py +++ b/app/DownloadQueue.py @@ -130,7 +130,7 @@ class DownloadQueue: output_template=output_template if output_template else self.config.output_template, datetime=formatdate(time.time()), error=error, - is_live=entry.get('is_live', None), + is_live=entry.get('is_live', None) or live_in is not None, live_in=live_in, ) diff --git a/frontend/src/components/Page-Completed.vue b/frontend/src/components/Page-Completed.vue index 4d48b54e..b90e5cf7 100644 --- a/frontend/src/components/Page-Completed.vue +++ b/frontend/src/components/Page-Completed.vue @@ -328,6 +328,10 @@ const clearFailed = () => { emits('deleteItem', 'completed', keys); } const setIcon = (item) => { + if (item.status === 'finished' && item.is_live) { + return 'fa-solid fa-globe'; + } + if (item.status === 'finished') { return 'fa-solid fa-circle-check'; } diff --git a/frontend/src/main.js b/frontend/src/main.js index 1388bc1a..9156da27 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -6,7 +6,7 @@ import { library } from '@fortawesome/fontawesome-svg-core' import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' import { faCog, faTrash, faLink, faPlus, faTrashCan, faCircleXmark, faCircleCheck, faRotateRight, faDownload, faUpRightFromSquare, - faSpinner, faArrowUp, faArrowDown, faTasks, faCalendar, faArrowUpAZ, faArrowDownAZ, faEject + faSpinner, faArrowUp, faArrowDown, faTasks, faCalendar, faArrowUpAZ, faArrowDownAZ, faEject, faGlobe } from '@fortawesome/free-solid-svg-icons' import { faSquare, faSquareCheck } from '@fortawesome/free-regular-svg-icons' @@ -18,7 +18,7 @@ import './assets/css/style.css' import 'floating-vue/dist/style.css' library.add(faCog, faTrash, faLink, faPlus, faTrashCan, faCircleXmark, faCircleCheck, faRotateRight, faDownload, faUpRightFromSquare, - faSquare, faSquareCheck, faSpinner, faArrowUp, faArrowDown, faTasks, faCalendar, faArrowUpAZ, faArrowDownAZ, faEject) + faSquare, faSquareCheck, faSpinner, faArrowUp, faArrowDown, faTasks, faCalendar, faArrowUpAZ, faArrowDownAZ, faEject, faGlobe) const app = createApp(App); app.config.globalProperties.capitalize = s => s && s[0].toUpperCase() + s.slice(1);