Skip to content

Commit 388a62f

Browse files
committed
v8
1 parent f5a6ed5 commit 388a62f

File tree

10 files changed

+52
-22
lines changed

10 files changed

+52
-22
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ active_requests.json
5555
working_proxies.json
5656
start.sh
5757
.DS_Store
58-
GUI/db.sqlite3
58+
GUI/db.sqlite3

GUI/searchapp/api/animeunity.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
# External utilities
1313
from StreamingCommunity.Util import config_manager
14+
from StreamingCommunity.Api.Template.loader import get_folder_name
1415
from StreamingCommunity.Api.Service.animeunity.util.ScrapeSerie import ScrapeSerieAnime
1516

1617

@@ -29,7 +30,7 @@ def _load_config(self):
2930
def _get_search_fn(self):
3031
"""Lazy load the search function."""
3132
if self._search_fn is None:
32-
module = importlib.import_module("StreamingCommunity.Api.Site.animeunity")
33+
module = importlib.import_module(f"StreamingCommunity.Api.{get_folder_name()}.animeunity")
3334
self._search_fn = getattr(module, "search")
3435
return self._search_fn
3536

GUI/searchapp/api/streamingcommunity.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
# External utilities
1313
from StreamingCommunity.Util import config_manager
14+
from StreamingCommunity.Api.Template.loader import get_folder_name
1415
from StreamingCommunity.Api.Service.streamingcommunity.util.ScrapeSerie import GetSerieInfo
1516

1617

@@ -28,7 +29,7 @@ def _load_config(self):
2829
def _get_search_fn(self):
2930
"""Lazy load the search function."""
3031
if self._search_fn is None:
31-
module = importlib.import_module("StreamingCommunity.Api.Site.streamingcommunity")
32+
module = importlib.import_module(f"StreamingCommunity.Api.{get_folder_name()}.streamingcommunity")
3233
self._search_fn = getattr(module, "search")
3334
return self._search_fn
3435

StreamingCommunity/Api/Service/raiplay/film.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
# Logic
2020
from .util.get_license import generate_license_url
21+
from .util.fix_mpd import fix_manifest_url
2122
from StreamingCommunity.Api.Player.mediapolisvod import VideoSource
2223

2324

@@ -42,7 +43,7 @@ def download_film(select_title: MediaItem) -> Tuple[str, bool]:
4243

4344
# Extract m3u8 URL from the film's URL
4445
response = create_client(headers=get_headers()).get(select_title.url + ".json")
45-
first_item_path = "https://www.raiplay.it" + response.json().get("first_item_path")
46+
first_item_path = "https://www.raiplay.it" + response.json().get("first_item_path")
4647
master_playlist = VideoSource.extract_m3u8_url(first_item_path)
4748

4849
# Define the filename and path for the downloaded film
@@ -52,7 +53,7 @@ def download_film(select_title: MediaItem) -> Tuple[str, bool]:
5253
# HLS
5354
if ".mpd" not in master_playlist:
5455
r_proc = HLS_Downloader(
55-
m3u8_url=master_playlist,
56+
m3u8_url=fix_manifest_url(master_playlist),
5657
output_path=os.path.join(mp4_path, mp4_name)
5758
).start()
5859

StreamingCommunity/Api/Service/raiplay/series.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# Logic
2929
from .util.ScrapeSerie import GetSerieInfo
3030
from .util.get_license import generate_license_url
31+
from .util.fix_mpd import fix_manifest_url
3132
from StreamingCommunity.Api.Player.mediapolisvod import VideoSource
3233

3334

@@ -67,7 +68,7 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
6768
# HLS
6869
if ".mpd" not in master_playlist:
6970
r_proc = HLS_Downloader(
70-
m3u8_url=master_playlist,
71+
m3u8_url=fix_manifest_url(master_playlist),
7172
output_path=os.path.join(mp4_path, mp4_name)
7273
).start()
7374

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 18.12.25
2+
3+
import re
4+
5+
6+
def fix_manifest_url(manifest_url: str) -> str:
7+
"""
8+
Fixes RaiPlay manifest URLs to include all available quality levels.
9+
10+
Args:
11+
manifest_url (str): Original manifest URL from RaiPlay
12+
"""
13+
STANDARD_QUALITIES = "1200,1800,2400,3600,5000"
14+
pattern = r'(_,[\d,]+)(/playlist\.m3u8)'
15+
16+
# Check if URL contains quality specification
17+
match = re.search(pattern, manifest_url)
18+
19+
if match:
20+
fixed_url = re.sub(
21+
pattern,
22+
f'_,{STANDARD_QUALITIES}\\2',
23+
manifest_url
24+
)
25+
return fixed_url
26+
27+
return manifest_url

StreamingCommunity/Upload/update.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,7 @@ def update():
8787

8888
# Get commit details
8989
latest_commit = response_commits[0] if response_commits else None
90-
if latest_commit:
91-
latest_commit_message = latest_commit.get('commit', {}).get('message', 'No commit message')
92-
else:
93-
latest_commit_message = 'No commit history available'
94-
95-
if str(current_version).replace('v', '') != str(last_version).replace('v', ''):
96-
console.print(f"\n[cyan]New version available: [yellow]{last_version}")
90+
latest_commit_message = latest_commit.get('commit', {}).get('message', 'No commit message')
9791

9892
console.print(
9993
f"\n[red]{__title__} has been downloaded: [yellow]{total_download_count}"
@@ -104,5 +98,8 @@ def update():
10498
f" [magenta]If you'd like to support development and keep the program updated, consider leaving a "
10599
f"[yellow]donation[magenta]. Thank you!"
106100
)
101+
102+
if str(current_version).replace('v', '') != str(last_version).replace('v', ''):
103+
console.print(f"\n[cyan]New version available: [yellow]{last_version}")
107104

108105
time.sleep(1)

StreamingCommunity/Util/config_json.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def _save_domains_to_appropriate_location(self) -> None:
168168

169169
# Check for GitHub structure first
170170
github_domains_path = os.path.join(base_path, '.github', '.domain', 'domains.json')
171+
console.print(f"[cyan]Domain path: [green]{github_domains_path}")
171172

172173
try:
173174
if os.path.exists(github_domains_path):

StreamingCommunity/Util/message.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@
1818
SHOW = config_manager.get_bool('DEFAULT', 'show_message')
1919

2020

21-
def start_message():
21+
def start_message(clean: bool=True):
2222
"""Display a stylized start message in the console."""
23-
2423
msg = r'''
25-
___ ______ _
26-
/ _ | ___________ _ _____ _____ __ __ / __/ /________ ___ ___ _ (_)__ ___ _
27-
/ __ |/ __/ __/ _ \ |/|/ / _ `/ __/ \ \ / _\ \/ __/ __/ -_) _ `/ ' \/ / _ \/ _ `/
28-
/_/ |_/_/ /_/ \___/__,__/\_,_/_/ /_\_\ /___/\__/_/ \__/\_,_/_/_/_/_/_//_/\_, /
29-
/___/
24+
[red]+[cyan]=======================================================================================[red]+[purple]
25+
___ ______ _
26+
/ _ | ___________ _ _____ _____[yellow] __ __[purple] / __/ /________ ___ ___ _ (_)__ ___ _
27+
/ __ |/ __/ __/ _ \ |/|/ / _ `/ __/[yellow] \ \ /[purple] _\ \/ __/ __/ -_) _ `/ ' \/ / _ \/ _ `/
28+
/_/ |_/_/ /_/ \___/__,__/\_,_/_/ [yellow] /_\_\ [purple] /___/\__/_/ \__/\_,_/_/_/_/_/_//_/\_, /
29+
/___/
30+
[red]+[cyan]=======================================================================================[red]+
3031
'''.rstrip()
3132

32-
if CLEAN:
33+
if CLEAN and clean:
3334
os.system("cls" if platform.system() == 'Windows' else "clear")
3435

3536
if SHOW:

StreamingCommunity/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def run_function(func: Callable[..., None], close_console: bool = False, search_
5050

5151
def initialize():
5252
"""Initialize the application with system checks and setup."""
53-
start_message()
53+
start_message(False)
5454

5555
# Windows 7 terminal size fix
5656
if platform.system() == "Windows" and "7" in platform.version():

0 commit comments

Comments
 (0)