Skip to content

Commit d543154

Browse files
committed
Develop * 2
1 parent 39a014e commit d543154

File tree

11 files changed

+23
-23
lines changed

11 files changed

+23
-23
lines changed

StreamingCommunity/Api/Service/altadefinizione/film.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def download_film(select_title: MediaItem) -> str:
7272
master_playlist = video_source.get_playlist()
7373

7474
# Define the filename and path for the downloaded film
75-
title_name = os_manager.get_sanitize_file(select_title.name, select_title.date) + extension_output
76-
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, title_name.replace(extension_output, ""))
75+
title_name = f"{os_manager.get_sanitize_file(select_title.name, select_title.date)}.{extension_output}"
76+
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, title_name.replace(f".{extension_output}", ""))
7777

7878
# Download the film using the m3u8 playlist, and output filename
7979
hls_process = HLS_Downloader(

StreamingCommunity/Api/Service/crunchyroll/film.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def download_film(select_title: MediaItem) -> str:
4343
return None, True
4444

4545
# Define filename and path for the downloaded video
46-
mp4_name = os_manager.get_sanitize_file(select_title.name, select_title.date) + extension_output
47-
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, mp4_name.replace(extension_output, ""))
46+
mp4_name = f"{os_manager.get_sanitize_file(select_title.name, select_title.date)}.{extension_output}"
47+
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, mp4_name.replace(f".{extension_output}", ""))
4848

4949
# Generate mpd and license URLs
5050
url_id = select_title.get('url').split('/')[-1]

StreamingCommunity/Api/Service/hd4me/film.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def download_film(select_title: MediaItem) -> str:
5656
return None
5757

5858
# Define the filename and path for the downloaded film
59-
title_name = os_manager.get_sanitize_file(select_title.name, select_title.date) + extension_output
60-
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, title_name.replace(extension_output, ""))
59+
mp4_name = f"{os_manager.get_sanitize_file(select_title.name, select_title.date)}.{extension_output}"
60+
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, mp4_name.replace(f".{extension_output}", ""))
6161

6262
# Download the film using the mega downloader
6363
mega = MEGA_Downloader(choose_files=True)
@@ -68,6 +68,6 @@ def download_film(select_title: MediaItem) -> str:
6868

6969
output_path = mega.download_url(
7070
url=mega_link,
71-
dest_path=os.path.join(mp4_path, title_name)
71+
dest_path=os.path.join(mp4_path, mp4_name)
7272
)
7373
return output_path

StreamingCommunity/Api/Service/mediasetinfinity/film.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def download_film(select_title: MediaItem) -> Tuple[str, bool]:
4040
console.print(f"\n[yellow]Download: [red]{site_constants.SITE_NAME} → [cyan]{select_title.name} \n")
4141

4242
# Define the filename and path for the downloaded film
43-
title_name = os_manager.get_sanitize_file(select_title.name, select_title.date) + extension_output
44-
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, title_name.replace(extension_output, ""))
43+
mp4_name = f"{os_manager.get_sanitize_file(select_title.name, select_title.date)}.{extension_output}"
44+
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, mp4_name.replace(f".{extension_output}", ""))
4545

4646
# Get playback URL and tracking info
4747
playback_json = get_playback_url(select_title.id)
@@ -54,7 +54,7 @@ def download_film(select_title: MediaItem) -> Tuple[str, bool]:
5454
dash_process = DASH_Downloader(
5555
license_url=license_url,
5656
mpd_url=mpd_url,
57-
output_path=os.path.join(mp4_path, title_name),
57+
output_path=os.path.join(mp4_path, mp4_name),
5858
)
5959
dash_process.parse_manifest(custom_headers=get_headers())
6060

StreamingCommunity/Api/Service/raiplay/film.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def download_film(select_title: MediaItem) -> Tuple[str, bool]:
4747
master_playlist = VideoSource.extract_m3u8_url(first_item_path)
4848

4949
# Define the filename and path for the downloaded film
50-
mp4_name = os_manager.get_sanitize_file(select_title.name, select_title.date) + extension_output
51-
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, mp4_name.replace(extension_output, ""))
50+
mp4_name = f"{os_manager.get_sanitize_file(select_title.name, select_title.date)}.{extension_output}"
51+
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, mp4_name.replace(f".{extension_output}", ""))
5252

5353
# HLS
5454
if ".mpd" not in master_playlist:

StreamingCommunity/Api/Service/streamingcommunity/film.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ def download_film(select_title: MediaItem) -> str:
4949
return None
5050

5151
# Define the filename and path for the downloaded film
52-
title_name = f"{os_manager.get_sanitize_file(select_title.name, select_title.date)}.{extension_output}"
53-
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, title_name.replace(extension_output, ""))
52+
mp4_name = f"{os_manager.get_sanitize_file(select_title.name, select_title.date)}.{extension_output}"
53+
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, mp4_name.replace(f".{extension_output}", ""))
5454

5555
# Download the film using the m3u8 playlist, and output filename
5656
hls_process = HLS_Downloader(
5757
m3u8_url=master_playlist,
58-
output_path=os.path.join(mp4_path, title_name)
58+
output_path=os.path.join(mp4_path, mp4_name)
5959
).start()
6060

6161
if hls_process['error'] is not None:

StreamingCommunity/Api/Service/tubitv/film.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def download_film(select_title: MediaItem) -> Tuple[str, bool]:
6868
return None, True
6969

7070
# Define the filename and path for the downloaded film
71-
mp4_name = os_manager.get_sanitize_file(select_title.name, select_title.date) + extension_output
72-
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, mp4_name.replace(extension_output, ""))
71+
mp4_name = f"{os_manager.get_sanitize_file(select_title.name, select_title.date)}.{extension_output}"
72+
mp4_path = os.path.join(site_constants.MOVIE_FOLDER, mp4_name.replace(f".{extension_output}", ""))
7373

7474
# HLS Download
7575
r_proc = HLS_Downloader(

StreamingCommunity/Lib/DASH/segments.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ async def download_segments(self, output_dir: str = None, concurrent_downloads:
144144
worker_type = 'video' if 'Video' in description else 'audio'
145145
concurrent_downloads = self._get_worker_count(worker_type)
146146

147-
print("")
148147
progress_bar = tqdm(
149148
total=len(segment_urls) + 1,
150149
desc=f"Downloading {rep_id}",

StreamingCommunity/Lib/HLS/downloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def select_streams(self):
195195
# 3. Filters are configured (not empty)
196196
if not self.audio_streams and all_audio and DOWNLOAD_SPECIFIC_AUDIO:
197197
first_audio_lang = all_audio[0].get('language', 'unknown')
198-
console.print(f"[yellow]Auto-selecting first available audio track: {first_audio_lang}")
198+
#console.print(f"[yellow]Auto-selecting first available audio track: {first_audio_lang}")
199199
self.audio_streams = [all_audio[0]]
200200

201201
# Subtitle selection

StreamingCommunity/Lib/HLS/segments.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def get_info(self) -> None:
176176
response.raise_for_status()
177177

178178
self.parse_data(response.text)
179-
with open(os.path.join(self.tmp_folder, "playlist.m3u8"), "w") as f:
179+
with open(os.path.join(self.tmp_folder, "playlist.m3u8"), "w", encoding='utf-8') as f:
180180
f.write(response.text)
181181

182182
def _throttled_progress_update(self, content_size: int, progress_bar: tqdm):
@@ -467,7 +467,10 @@ async def download_segments_async(self, description: str, type: str):
467467

468468
# NOT DRM
469469
else:
470-
#print(self.segment_init_url, self.segments[0])
470+
if len(self.segments) == 0:
471+
console.print("[red]No segments found to download.")
472+
return self._generate_results(type)
473+
471474
decrypted_file, kill = MP4_Downloader(
472475
url = self.segments[0],
473476
path=os.path.join(self.tmp_folder, f"{type}_decrypted.mp4"),

0 commit comments

Comments
 (0)