From 53ba8beeee1f52ce7d5177586d2a53b0829f5d02 Mon Sep 17 00:00:00 2001 From: VerstreuteSeele Date: Thu, 12 Jan 2023 22:25:53 +0100 Subject: [PATCH] Create FlipperPlaylist.py --- scripts/FlipperPlaylist.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 scripts/FlipperPlaylist.py diff --git a/scripts/FlipperPlaylist.py b/scripts/FlipperPlaylist.py new file mode 100644 index 000000000..b77fcbb8b --- /dev/null +++ b/scripts/FlipperPlaylist.py @@ -0,0 +1,21 @@ +# Flipper Zero SUB-GHZ Playlist Generator +import os + + +def windows(): + folder_path = str(input("Enter the path for the folder: ")) + playlist_name = str(input("Enter a name for the playlist: ")) + playlist_file = open((r"C:\Users\\fisch\\Downloads\\" + playlist_name.lower() + ".txt"), "w") + playlist_file.write("# " + playlist_name + "\n") + for root, dirs, files in os.walk(folder_path, topdown=True): + for file in files: + if file.endswith(".sub"): + file_path = os.path.join(root, file) + file_path = file_path.replace("\\", "/") + file_path = file_path.replace("E:", "ext") + playlist_file.write(f"sub: {file_path}\n") + playlist_file.close() + print("Done!") + + +windows() \ No newline at end of file