mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-07 12:05:35 +00:00
Upgraded stop handling for HLS and MP4
This commit is contained in:
parent
a6836744b5
commit
25f870ef15
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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(
|
||||
|
@ -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}")
|
||||
|
@ -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}"
|
||||
|
@ -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)
|
||||
|
@ -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}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user