diff --git a/Src/Api/tv.py b/Src/Api/tv.py index cf047e2..6393af0 100644 --- a/Src/Api/tv.py +++ b/Src/Api/tv.py @@ -107,9 +107,10 @@ def get_m3u8_playlist(json_win_video, json_win_param, tv_name, n_stagione, n_ep, if req.ok: m3u8_cont = req.text.split() + for row in m3u8_cont: if "audio" in str(row) and "ita" in str(row): - return row.split(",")[-1].split('"')[-2], req.text + return row.split(",")[-1].split('"')[-2] else: console.log(f"[red]Error: {req.status_code}") sys.exit(0) @@ -132,12 +133,12 @@ def dw_single_ep(tv_id, eps, index_ep_select, domain, token, tv_name, season_sel mp4_format = mp4_name + ".mp4" mp4_path = os.path.join("videos", mp4_format) - m3u8_url_audio, m3u8_playlist_content = get_m3u8_playlist(json_win_video, json_win_param, tv_name, season_select, index_ep_select+1, eps[index_ep_select]['name'], token_render) + m3u8_url_audio = get_m3u8_playlist(json_win_video, json_win_param, tv_name, season_select, index_ep_select+1, eps[index_ep_select]['name'], token_render) if m3u8_url_audio != None: console.print("[blue]Use m3u8 audio => [red]True") - download_m3u8(m3u8_playlist=m3u8_playlist_content, m3u8_index=m3u8_url, m3u8_audio=m3u8_url_audio, m3u8_subtitle=m3u8_url, key=m3u8_key, output_filename=mp4_path) + download_m3u8(m3u8_index=m3u8_url, m3u8_audio=m3u8_url_audio, m3u8_subtitle=m3u8_url, key=m3u8_key, output_filename=mp4_path) def main_dw_tv(tv_id, tv_name, version, domain):