Skip to content

Commit f6a36d6

Browse files
committed
crunchy premium fix
1 parent 01b908b commit f6a36d6

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

StreamingCommunity/Api/Service/crunchyroll/util/ScrapeSerie.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ def _get_episode_id_for_preferred_language(self, base_episode_id: str) -> str:
188188
if isinstance(version, dict):
189189
audio_locale = version.get("audio_locale")
190190
guid = version.get("guid")
191-
#print(f"Version {i}: audio_locale={audio_locale}, guid={guid}")
192191

193192
if audio_locale == preferred_locale:
193+
print(f"Found matching locale! Selected: {audio_locale} -> {guid}")
194194
return version.get("guid", base_episode_id)
195195

196196
# Fallback: try to find any available version if preferred not found
@@ -205,7 +205,7 @@ def _get_episode_id_for_preferred_language(self, base_episode_id: str) -> str:
205205
except Exception as e:
206206
logging.error(f"Error getting episode ID for preferred language: {e}")
207207

208-
print(f"[DEBUG] Returning original episode ID: {base_episode_id}")
208+
print(f"[DEBUG] No suitable version found, returning original episode ID: {base_episode_id}")
209209
return base_episode_id
210210

211211
# ------------- FOR GUI -------------

StreamingCommunity/Api/Service/crunchyroll/util/get_license.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -284,20 +284,26 @@ def get_playback_session(client: CrunchyrollClient, url_id: str) -> Optional[Tup
284284
Tuple with (mpd_url, headers, subtitles, token, audio_locale) or None if access denied
285285
"""
286286
data = client.get_streams(url_id)
287-
url = data.get('url')
288-
audio_locale_current = data.get('audio_locale') or data.get('audio', {}).get('locale')
289-
290-
# Collect subtitles with metadata
291-
subtitles = []
292-
subtitles_data = data.get('subtitles', {})
293-
for lang_code, sub_info in subtitles_data.items():
294-
if sub_info.get('url'):
295-
subtitles.append({
296-
'language': sub_info.get('language'),
297-
'format': sub_info.get('format'),
298-
'url': sub_info.get('url'),
299-
})
287+
288+
try:
289+
url = data.get('url')
290+
audio_locale_current = data.get('audio_locale') or data.get('audio', {}).get('locale')
291+
292+
# Collect subtitles with metadata
293+
subtitles = []
294+
subtitles_data = data.get('subtitles', {})
295+
for lang_code, sub_info in subtitles_data.items():
296+
if sub_info.get('url'):
297+
subtitles.append({
298+
'language': sub_info.get('language'),
299+
'format': sub_info.get('format'),
300+
'url': sub_info.get('url'),
301+
})
302+
303+
token = _find_token_anywhere(data)
304+
headers = client._get_headers()
305+
return url, headers, subtitles, token, audio_locale_current
300306

301-
token = _find_token_anywhere(data)
302-
headers = client._get_headers()
303-
return url, headers, subtitles, token, audio_locale_current
307+
except Exception as e:
308+
logging.error(f"Failed to parse playback session: {e}, Premium subscription may be required.")
309+
return None

StreamingCommunity/Lib/DASH/downloader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def download_subtitles(self) -> bool:
170170
fmt = sub.get('format')
171171

172172
# Download subtitle
173-
console.log(f"[cyan]Downloading subtitle:[white] {language} ({fmt})")
173+
console.log(f"[cyan]Downloading subtitle[white]: [red]{language} ({fmt})")
174174
response = client.get(sub.get('url'))
175175
response.raise_for_status()
176176

@@ -269,7 +269,7 @@ def download_and_decrypt(self, custom_headers=None, query_params=None, key=None)
269269
for i, key_info in enumerate(keys):
270270
KID = key_info['kid']
271271
KEY = key_info['key']
272-
console.log(f"[cyan]Trying video decryption with key: {KID}")
272+
console.log(f"[cyan]Trying video decryption with key: [red]{KID}")
273273
result_path = decrypt_with_mp4decrypt("Video", encrypted_path, KID, KEY, output_path=decrypted_path)
274274

275275
if result_path:

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"merge_subs": true,
2424
"specific_list_subtitles": [
2525
"ita",
26-
"eng"
26+
"it-IT"
2727
],
2828
"limit_segment": 0,
2929
"cleanup_tmp_folder": true,

0 commit comments

Comments
 (0)