Skip to content

Commit 7b8dbe3

Browse files
committed
Try ass sub
1 parent 6c1aac3 commit 7b8dbe3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,15 @@ def _find_token_anywhere(obj) -> Optional[str]:
277277
def get_playback_session(client: CrunchyrollClient, url_id: str) -> Optional[Tuple[str, Dict, List[Dict], Optional[str], Optional[str]]]:
278278
"""
279279
Return the playback session details.
280-
280+
281281
Returns:
282282
Tuple with (mpd_url, headers, subtitles, token, audio_locale) or None if access denied
283283
"""
284284
data = client.get_streams(url_id)
285-
286285
try:
287286
url = data.get('url')
288287
audio_locale_current = data.get('audio_locale') or data.get('audio', {}).get('locale')
289-
288+
290289
# Collect subtitles with metadata
291290
subtitles = []
292291
subtitles_data = data.get('subtitles', {})
@@ -297,11 +296,11 @@ def get_playback_session(client: CrunchyrollClient, url_id: str) -> Optional[Tup
297296
'format': sub_info.get('format'),
298297
'url': sub_info.get('url'),
299298
})
300-
299+
301300
token = _find_token_anywhere(data)
302301
headers = client._get_headers()
303302
return url, headers, subtitles, token, audio_locale_current
304-
303+
305304
except Exception as e:
306305
logging.error(f"Failed to parse playback session: {e}, Premium subscription may be required.")
307306
return None

StreamingCommunity/Lib/HLS/downloader.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ def download_subtitle(self, sub: Dict) -> bool:
398398
try:
399399
raw_content = self.client.request(sub['uri'])
400400
if raw_content:
401+
402+
console.log(f"[cyan]Downloading subtitle[white]: [red]{sub['language']} (vtt)")
401403
sub_path = os.path.join(self.temp_dir, 'subs', f"{sub['language']}.vtt")
402404

403405
subtitle_parser = M3U8_Parser()

0 commit comments

Comments
 (0)