From eebe76b6f6fffc854a50bbcab1591ad5f0f88fe8 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Fri, 24 Feb 2023 23:10:51 +0000 Subject: [PATCH] Fix segment download merging on Linux machines It seems on Windows the pathlib.iterdir() function is always in order. However, on Linux or at least some machines this is not the case. This change fixes the order. If you think you were affected, check your previous downloads that used DASH or HLS segmentation and make sure they dont randomly change scenes out of order. --- devine/commands/dl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devine/commands/dl.py b/devine/commands/dl.py index 99a20b4..f8ab44e 100644 --- a/devine/commands/dl.py +++ b/devine/commands/dl.py @@ -648,7 +648,7 @@ class dl: track.OnDecrypted(track) else: with open(save_path, "wb") as f: - for file in save_dir.iterdir(): + for file in sorted(save_dir.iterdir()): f.write(file.read_bytes()) file.unlink() save_dir.rmdir()