Upgraded stop handling for HLS and MP4

This commit is contained in:
Gra 2025-02-01 12:38:41 +01:00
parent a6836744b5
commit 25f870ef15
7 changed files with 12 additions and 10 deletions

View File

@ -40,7 +40,8 @@ def download_film(select_title: MediaItem) -> str:
# Start message and display film information
start_message()
console.print(f"[yellow]Download: [red]{select_title.name} \n")
console.print(f"[cyan]You can safely stop the download with [bold]Ctrl+c[bold] [cyan] \n")
# Set domain and media ID for the video source
video_source = VideoSource(select_title.url)

View File

@ -38,6 +38,7 @@ def download_film(select_title: MediaItem) -> str:
# Start message and display film information
start_message()
console.print(f"[yellow]Download: [red]{select_title.name} \n")
console.print(f"[cyan]You can safely stop the download with [bold]Ctrl+c[bold] [cyan] \n")
# Setup api manger
print(select_title.url)

View File

@ -44,8 +44,8 @@ def download_video(index_episode_selected: int, scape_info_serie: GetSerieInfo,
# Get info about episode
obj_episode = scape_info_serie.list_episodes[index_episode_selected - 1]
console.print(f"[yellow]Download: [red]{obj_episode.get('name')}")
print()
console.print(f"[yellow]Download: [red]{obj_episode.get('name')}\n")
console.print(f"[cyan]You can safely stop the download with [bold]Ctrl+c[bold] [cyan] \n")
# Define filename and path for the downloaded video
title_name = os_manager.get_sanitize_file(

View File

@ -44,9 +44,8 @@ def download_video(index_season_selected: int, index_episode_selected: int, scap
# Get info about episode
obj_episode = scape_info_serie.list_episodes[index_episode_selected - 1]
console.print(f"[yellow]Download: [red]{index_season_selected}:{index_episode_selected} {obj_episode.get('name')}")
print()
console.print(f"[yellow]Download: [red]{index_season_selected}:{index_episode_selected} {obj_episode.get('name')}\n")
console.print(f"[cyan]You can safely stop the download with [bold]Ctrl+c[bold] [cyan] \n")
# Define filename and path for the downloaded video
mp4_name = f"{map_episode_title(scape_info_serie.tv_name, index_season_selected, index_episode_selected, obj_episode.get('name'))}.mp4"
mp4_path = os.path.join(SERIES_FOLDER, scape_info_serie.tv_name, f"S{index_season_selected}")

View File

@ -50,7 +50,7 @@ def download_film(movie_details: Json_film) -> str:
# Start message and display film information
start_message()
console.print(f"[yellow]Download: [red]{movie_details.title} \n")
console.print(f"[cyan]You can safely stop the download with [bold]Ctrl+c[bold] [cyan] \n")
# Make request to main site
try:
url = f"https://{SITE_NAME}.{DOMAIN_NOW}/set-movie-a/{movie_details.imdb_id}"

View File

@ -40,6 +40,7 @@ def download_film(select_title: MediaItem) -> str:
# Start message and display film information
start_message()
console.print(f"[yellow]Download: [red]{select_title.name} \n")
console.print(f"[cyan]You can safely stop the download with [bold]Ctrl+c[bold] [cyan] \n")
# Init class
video_source = VideoSource(SITE_NAME, False)

View File

@ -45,9 +45,9 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
# Get info about episode
obj_episode = scrape_serie.episode_manager.get(index_episode_selected - 1)
console.print(f"[yellow]Download: [red]{index_season_selected}:{index_episode_selected} {obj_episode.name}")
print()
console.print(f"[yellow]Download: [red]{index_season_selected}:{index_episode_selected} {obj_episode.name}\n")
console.print(f"[cyan]You can safely stop the download with [bold]Ctrl+c[bold] [cyan] \n")
# Define filename and path for the downloaded video
mp4_name = f"{map_episode_title(scrape_serie.series_name, index_season_selected, index_episode_selected, obj_episode.name)}.mp4"
mp4_path = os.path.join(SERIES_FOLDER, scrape_serie.series_name, f"S{index_season_selected}")