feature/continuous-release-check #1
@ -33,7 +33,7 @@ def get_audiobookshelf_data() -> tuple[int | None, str | None]:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
headers = {"Authorization": f"Bearer {PODCAST_AUTHORIZATION_TOKEN}"}
|
headers = {"Authorization": f"Bearer {PODCAST_AUTHORIZATION_TOKEN}"}
|
||||||
logger.debug(f"[Audiobookshelf] Fetching Audiobookshelf data")
|
logger.debug("[Audiobookshelf] Fetching Audiobookshelf data")
|
||||||
try:
|
try:
|
||||||
response = requests.get(PODCAST_API_URL, headers=headers)
|
response = requests.get(PODCAST_API_URL, headers=headers)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
@ -152,10 +152,10 @@ def download_episode() -> None:
|
|||||||
try:
|
try:
|
||||||
episode_description = episode_info.get("description", "")
|
episode_description = episode_info.get("description", "")
|
||||||
if "sponsored" in episode_description.lower():
|
if "sponsored" in episode_description.lower():
|
||||||
logger.debug(f"[App] Sponsored segments found in description, waiting for SponsorBlock")
|
logger.debug("[App] Sponsored segments found in description, waiting for SponsorBlock")
|
||||||
wait_for_sponsorblock_segments_to_be_added(episode_url)
|
wait_for_sponsorblock_segments_to_be_added(episode_url)
|
||||||
else:
|
else:
|
||||||
logger.debug(f"[App] No sponsored segments found in description")
|
logger.debug("[App] No sponsored segments found in description")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"[App] Failed during SponsorBlock wait: {e}", exc_info=True)
|
logger.warning(f"[App] Failed during SponsorBlock wait: {e}", exc_info=True)
|
||||||
|
|
||||||
|
|||||||
@ -75,7 +75,7 @@ def check_for_sponsorblock_segments(youtube_video:str) -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
if segments:
|
if segments:
|
||||||
logger.debug(f"[SponsorBlock] SponsorBlock segments found for video: {youtube_video}")
|
logger.info(f"[SponsorBlock] SponsorBlock segments found for video: {youtube_video}")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def return_download_options(information:dict,track:str)->dict:
|
def return_download_options(information:dict,track:str)->dict:
|
||||||
@ -110,7 +110,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={return_string_as_html(information['description'])}",
|
"-metadata", f"comment={return_string_as_html(information['description'])}",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user