Signed-off-by: Markus Birth <markus@birth-online.de>
This commit is contained in:
2025-12-18 22:20:38 +00:00
parent 4cb315217c
commit c6299c4e0c

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
import os
from os.path import dirname, isfile
from os.path import basename, dirname, isfile
import requests
import re
import json
@@ -62,7 +62,7 @@ with Progress(
for show in shows:
(station, title) = show["title"].split(" | ", 2)
prog.update(task_show, description=f"Show: {title}")
prog.update(task_show, description=f"Show: [bold magenta]{title}")
show_url = START_URL + show["id"] + "/"
#print(show_url)
@@ -84,7 +84,7 @@ with Progress(
episode_date = episode_aired[0:10]
episode_time = episode_aired[11:19]
prog.update(task_epi, description=f"Episode: {episode_date} / {episode_time}")
prog.update(task_epi, description=f"Episode: [bold green]{episode_date}[/bold green] / [bold yellow]{episode_time}")
destination_path = station + "/" + episode_date + "/" + episode_time.replace(":", "-") + " " + episode_title + ".m4a"
@@ -92,7 +92,7 @@ with Progress(
os.makedirs(dirname(destination_path), exist_ok=True)
if not isfile(destination_path):
task_dl = prog.add_task(f"Downloading {episode_date}/{episode_time} {episode_title}", use_alt_column=True)
task_dl = prog.add_task(f"Downloading [bold cyan]{episode_date}/{basename(destination_path)}", use_alt_column=True)
try:
with requests.get(episode_url, headers=DEFAULT_HEADERS, stream=True) as r:
r.raise_for_status()