From 5da8fc4809fd8485fa9f92749e940abebabae1a7 Mon Sep 17 00:00:00 2001 From: nandyalu <18457369+nandyalu@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:19:21 -0500 Subject: [PATCH 1/4] ADD: log to indicate using cookies for download --- .devcontainer/Dockerfile | 8 +++++++- backend/core/download/video.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a14581f..047f3a4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ FROM mcr.microsoft.com/devcontainers/python:1-3.12-bullseye # Install the xz-utils package -RUN apt-get update && apt-get install -y curl xz-utils tzdata git +RUN apt-get update && apt-get install -y curl xz-utils tzdata git gnupg2 # Install Node.js RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - &&\ @@ -37,5 +37,11 @@ ENV PYTHONPATH "${PYTHONPATH}:/app/backend" COPY dev-start.sh /usr/local/bin/startup.sh RUN chmod +x /usr/local/bin/startup.sh +# For GPG signing +RUN echo 'export GPG_TTY=$(tty)' >> /root/.bashrc +RUN echo 'export GPG_TTY=$(tty)' >> /home/vscode/.bashrc +RUN echo 'gpg-connect-agent updatestartuptty /bye >/dev/null' >> /root/.bashrc +RUN echo 'gpg-connect-agent updatestartuptty /bye >/dev/null' >> /home/vscode/.bashrc + # Expose the port the app runs on EXPOSE 7888 diff --git a/backend/core/download/video.py b/backend/core/download/video.py index fae8ebd..9189e1b 100644 --- a/backend/core/download/video.py +++ b/backend/core/download/video.py @@ -123,6 +123,7 @@ def _get_ytdl_options() -> dict[str, Any]: "postprocessor_args": {}, } if app_settings.yt_cookies_path: + logger.info(f"Using cookies file: {app_settings.yt_cookies_path}") ydl_options["cookiefile"] = f"{app_settings.yt_cookies_path}" postprocessors: list[dict] = [] output_options: list[str] = [] From 059d4841e293e4b8698e517978c5fc70489cfa05 Mon Sep 17 00:00:00 2001 From: nandyalu <18457369+nandyalu@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:31:41 -0500 Subject: [PATCH 2/4] FIX: Fixed a bug with trailer download task --- backend/core/tasks/download_trailers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/core/tasks/download_trailers.py b/backend/core/tasks/download_trailers.py index ebf0c0e..7395490 100644 --- a/backend/core/tasks/download_trailers.py +++ b/backend/core/tasks/download_trailers.py @@ -75,7 +75,8 @@ def _download_missing_media_trailers(is_movie: bool): logger.info( f"Skipping trailer download for {skip_count} {media_type}, waiting for media" ) - for skip_reason, skip_titles in skipped_titles: + for skip_reason in skipped_titles: + skip_titles = skipped_titles[skip_reason] if len(skip_titles) > 0: all_titles = ", ".join(skip_titles) else: From fb2fc997cf771faf0a21627a8b95943902ebfc36 Mon Sep 17 00:00:00 2001 From: nandyalu <18457369+nandyalu@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:33:34 -0500 Subject: [PATCH 3/4] UPD: log only on debug --- backend/core/download/video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/core/download/video.py b/backend/core/download/video.py index 9189e1b..f560cca 100644 --- a/backend/core/download/video.py +++ b/backend/core/download/video.py @@ -123,7 +123,7 @@ def _get_ytdl_options() -> dict[str, Any]: "postprocessor_args": {}, } if app_settings.yt_cookies_path: - logger.info(f"Using cookies file: {app_settings.yt_cookies_path}") + logger.debug(f"Using cookies file: {app_settings.yt_cookies_path}") ydl_options["cookiefile"] = f"{app_settings.yt_cookies_path}" postprocessors: list[dict] = [] output_options: list[str] = [] From 13377b0166deff52b959d763746bb3fb062464da Mon Sep 17 00:00:00 2001 From: nandyalu <18457369+nandyalu@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:37:29 -0500 Subject: [PATCH 4/4] UPD: trailer download - do not log skipped titles --- backend/core/tasks/download_trailers.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/core/tasks/download_trailers.py b/backend/core/tasks/download_trailers.py index 7395490..a744ab3 100644 --- a/backend/core/tasks/download_trailers.py +++ b/backend/core/tasks/download_trailers.py @@ -77,12 +77,13 @@ def _download_missing_media_trailers(is_movie: bool): ) for skip_reason in skipped_titles: skip_titles = skipped_titles[skip_reason] - if len(skip_titles) > 0: - all_titles = ", ".join(skip_titles) - else: - all_titles = "None" + # if len(skip_titles) > 0: + # all_titles = ", ".join(skip_titles) + # else: + # all_titles = "None" skip_reason = skip_reason.replace("_", " ") - logger.debug(f"Skipped {len(skip_titles)} titles - {skip_reason}: {all_titles}") + logger.debug(f"Skipped {len(skip_titles)} titles - {skip_reason}") + # logger.debug(f"Skipped {len(skip_titles)} titles - {skip_reason}: {all_titles}") if not media_trailer_list: logger.info(f"No missing {media_type} trailers to download")