diff --git a/vinetrimmer/utils/io.py b/vinetrimmer/utils/io.py index 329fc64..a83ee97 100644 --- a/vinetrimmer/utils/io.py +++ b/vinetrimmer/utils/io.py @@ -260,7 +260,8 @@ async def m3u8dl(uri, out, track, headers=None, proxy=None): "--thread-count", "96", "--download-retry-count", "20", "--ffmpeg-binary-path", f'"{ffmpeg_binary}"', - "--binary-merge" + "--binary-merge", + "-M", "format=mp4" ] if headers and track.source == "HS": arguments.extend(["--header", f'"Cookie:{headers["cookie"].replace(" ", "")}"']) @@ -275,15 +276,13 @@ async def m3u8dl(uri, out, track, headers=None, proxy=None): if not ("linux" in platform): arguments.extend(["--http-request-timeout", "8"]) if track.__class__.__name__ == "VideoTrack": - from vinetrimmer.objects.tracks import Track - if track.height and not (track.descriptor == Track.Descriptor.M3U): + if track.height: arguments.extend([ - "-sv", f"res='{track.height}*':codec='{track.codec}':for=best" + "-sv", f"res='{track.height}*':codec='{track.codec}':for=best", ]) else: arguments.extend([ "-sv", "best", - "-M", "format=mp4" ]) arguments.extend([ @@ -317,4 +316,11 @@ async def m3u8dl(uri, out, track, headers=None, proxy=None): else: p = subprocess.run(shlex.split(arg_str), check=True) except subprocess.CalledProcessError: - raise ValueError("N_m3u8DL-RE failed too many times, aborting") \ No newline at end of file + arg_str.replace(f"res='{track.height}*':codec='{track.codec}':for=", "") + try: + if "win" in platform: + p = subprocess.run(arg_str, check=True) + else: + p = subprocess.run(shlex.split(arg_str), check=True) + except: + raise ValueError("N_m3u8DL-RE failed too many times, aborting") \ No newline at end of file