This commit is contained in:
Florian 2025-11-07 18:54:34 +01:00
parent ced5a440c1
commit 104ca5ff22
5 changed files with 7 additions and 6 deletions

View File

@ -29,7 +29,7 @@ def get_audiobookshelf_data()->tuple[int | None, str | None]:
except requests.RequestException as e: except requests.RequestException as e:
logger.warning(f"Failed to fetch Audiobookshelf data: {e}") logger.warning(f"Failed to fetch Audiobookshelf data: {e}")
return None return (None, None)
def download_episode(): def download_episode():

View File

@ -4,6 +4,6 @@ def return_string_as_html(input_text):
string_without_ads="" string_without_ads=""
for line in input_text.splitlines(): for line in input_text.splitlines():
line = re.sub(r'(https?://[^\s]+)', r'<a href="\1">\1</a>', line) line = re.sub(r'(https?://[^\s]+)', r'<a href="\1">\1</a>', line)
if not "Sponsored" in line: if "Sponsored" not in line:
string_without_ads+=line+"\n" string_without_ads+=line+"\n"
return("<p>"+string_without_ads.replace("\n\n", "</p>\n<p>").replace("\n", "<br>")+"</p>") return("<p>"+string_without_ads.replace("\n\n", "</p>\n<p>").replace("\n", "<br>")+"</p>")

View File

@ -98,7 +98,7 @@ def return_download_options(information:dict,track:str)->dict:
}], }],
"postprocessor_args": [ "postprocessor_args": [
"-metadata", f"title={information['title']}", "-metadata", f"title={information['title']}",
"-metadata", f"artist=Perun", "-metadata", "artist=Perun",
"-metadata", f"track={track}", "-metadata", f"track={track}",
"-metadata", f"date={information['date']}", "-metadata", f"date={information['date']}",
"-metadata", f"comment={information['description']}", "-metadata", f"comment={information['description']}",

View File

@ -1,9 +1,10 @@
FROM ubuntu:24.04 FROM ubuntu:24.04
RUN apt update && \ 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 && \ 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 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 RUN sh /uv-installer.sh && mv /root/.local/bin/uv /usr/local/bin/uv && rm /uv-installer.sh

View File

@ -107,7 +107,7 @@ def convert_episode_to_mp3(episode_data: EpisodeData, file_name: str):
ffmpeg_command = [ ffmpeg_command = [
"ffmpeg", "-i", file_name, "ffmpeg", "-i", file_name,
"-metadata", f"title={episode_data.title}", "-metadata", f"title={episode_data.title}",
"-metadata", f"artist=Pete Tong", "-metadata", "artist=Pete Tong",
"-metadata", f"track={episode_data.track}", "-metadata", f"track={episode_data.track}",
"-metadata", f"date={episode_data.timestamp}", "-metadata", f"date={episode_data.timestamp}",
"-metadata", f"comment={episode_data.description}", "-metadata", f"comment={episode_data.description}",