From 25f870ef1566a8308724bdb012a8d34ed4f47dd0 Mon Sep 17 00:00:00 2001 From: Gra Date: Sat, 1 Feb 2025 12:38:41 +0100 Subject: [PATCH] Upgraded stop handling for HLS and MP4 --- StreamingCommunity/Api/Site/altadefinizionegratis/film.py | 3 ++- StreamingCommunity/Api/Site/cb01new/film.py | 1 + StreamingCommunity/Api/Site/ddlstreamitaly/series.py | 4 ++-- StreamingCommunity/Api/Site/guardaserie/series.py | 5 ++--- StreamingCommunity/Api/Site/mostraguarda/film.py | 2 +- StreamingCommunity/Api/Site/streamingcommunity/film.py | 1 + StreamingCommunity/Api/Site/streamingcommunity/series.py | 6 +++--- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/StreamingCommunity/Api/Site/altadefinizionegratis/film.py b/StreamingCommunity/Api/Site/altadefinizionegratis/film.py index 67135a8..2e857c8 100644 --- a/StreamingCommunity/Api/Site/altadefinizionegratis/film.py +++ b/StreamingCommunity/Api/Site/altadefinizionegratis/film.py @@ -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) diff --git a/StreamingCommunity/Api/Site/cb01new/film.py b/StreamingCommunity/Api/Site/cb01new/film.py index 282a639..5969350 100644 --- a/StreamingCommunity/Api/Site/cb01new/film.py +++ b/StreamingCommunity/Api/Site/cb01new/film.py @@ -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) diff --git a/StreamingCommunity/Api/Site/ddlstreamitaly/series.py b/StreamingCommunity/Api/Site/ddlstreamitaly/series.py index 95ee7ea..e55a154 100644 --- a/StreamingCommunity/Api/Site/ddlstreamitaly/series.py +++ b/StreamingCommunity/Api/Site/ddlstreamitaly/series.py @@ -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( diff --git a/StreamingCommunity/Api/Site/guardaserie/series.py b/StreamingCommunity/Api/Site/guardaserie/series.py index 114ed08..757e445 100644 --- a/StreamingCommunity/Api/Site/guardaserie/series.py +++ b/StreamingCommunity/Api/Site/guardaserie/series.py @@ -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}") diff --git a/StreamingCommunity/Api/Site/mostraguarda/film.py b/StreamingCommunity/Api/Site/mostraguarda/film.py index c4b1268..7c2a859 100644 --- a/StreamingCommunity/Api/Site/mostraguarda/film.py +++ b/StreamingCommunity/Api/Site/mostraguarda/film.py @@ -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}" diff --git a/StreamingCommunity/Api/Site/streamingcommunity/film.py b/StreamingCommunity/Api/Site/streamingcommunity/film.py index 2b06174..627afee 100644 --- a/StreamingCommunity/Api/Site/streamingcommunity/film.py +++ b/StreamingCommunity/Api/Site/streamingcommunity/film.py @@ -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) diff --git a/StreamingCommunity/Api/Site/streamingcommunity/series.py b/StreamingCommunity/Api/Site/streamingcommunity/series.py index 5de0267..4a9415d 100644 --- a/StreamingCommunity/Api/Site/streamingcommunity/series.py +++ b/StreamingCommunity/Api/Site/streamingcommunity/series.py @@ -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}")