From 104ca5ff2297b0e31807f31d47e61a78ffb03757 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 7 Nov 2025 18:54:34 +0100 Subject: [PATCH] Linting --- src/perun/get_episode.py | 2 +- src/perun/helper.py | 2 +- src/perun/youtube_handler.py | 2 +- src/petetong/Dockerfile | 5 +++-- src/petetong/download_episode.py | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/perun/get_episode.py b/src/perun/get_episode.py index edcea96..ab5fa73 100644 --- a/src/perun/get_episode.py +++ b/src/perun/get_episode.py @@ -29,7 +29,7 @@ def get_audiobookshelf_data()->tuple[int | None, str | None]: except requests.RequestException as e: logger.warning(f"Failed to fetch Audiobookshelf data: {e}") - return None + return (None, None) def download_episode(): diff --git a/src/perun/helper.py b/src/perun/helper.py index 0eef539..9917f46 100644 --- a/src/perun/helper.py +++ b/src/perun/helper.py @@ -4,6 +4,6 @@ def return_string_as_html(input_text): string_without_ads="" for line in input_text.splitlines(): line = re.sub(r'(https?://[^\s]+)', r'\1', line) - if not "Sponsored" in line: + if "Sponsored" not in line: string_without_ads+=line+"\n" return("

"+string_without_ads.replace("\n\n", "

\n

").replace("\n", "
")+"

") diff --git a/src/perun/youtube_handler.py b/src/perun/youtube_handler.py index 8035559..770a15d 100644 --- a/src/perun/youtube_handler.py +++ b/src/perun/youtube_handler.py @@ -98,7 +98,7 @@ def return_download_options(information:dict,track:str)->dict: }], "postprocessor_args": [ "-metadata", f"title={information['title']}", - "-metadata", f"artist=Perun", + "-metadata", "artist=Perun", "-metadata", f"track={track}", "-metadata", f"date={information['date']}", "-metadata", f"comment={information['description']}", diff --git a/src/petetong/Dockerfile b/src/petetong/Dockerfile index 0e0db4e..213fe1b 100644 --- a/src/petetong/Dockerfile +++ b/src/petetong/Dockerfile @@ -1,9 +1,10 @@ FROM ubuntu:24.04 RUN apt update && \ - apt install -y python3 ffmpeg software-properties-common curl keychain ca-certificates && \ + apt install -y ca-certificates curl ffmpeg keychain python3 software-properties-common && \ add-apt-repository ppa:m-grant-prg/utils && \ - apt update -y && apt install -y get-iplayer + apt update && apt install -y get-iplayer && \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* ADD https://astral.sh/uv/install.sh /uv-installer.sh RUN sh /uv-installer.sh && mv /root/.local/bin/uv /usr/local/bin/uv && rm /uv-installer.sh diff --git a/src/petetong/download_episode.py b/src/petetong/download_episode.py index 13b20dc..9686c3e 100644 --- a/src/petetong/download_episode.py +++ b/src/petetong/download_episode.py @@ -107,7 +107,7 @@ def convert_episode_to_mp3(episode_data: EpisodeData, file_name: str): ffmpeg_command = [ "ffmpeg", "-i", file_name, "-metadata", f"title={episode_data.title}", - "-metadata", f"artist=Pete Tong", + "-metadata", "artist=Pete Tong", "-metadata", f"track={episode_data.track}", "-metadata", f"date={episode_data.timestamp}", "-metadata", f"comment={episode_data.description}",