# M3U to Samsung SMPL Playlist Converter # Written by ChatGPT # This script converts an M3U playlist file to the Samsung SMPL format. It reads an M3U file, extracts file paths, # and generates a Samsung SMPL JSON file with a "members" array, where each item represents a file from the M3U playlist. # Samsung SMPL format is old but used in the samsung music app here: https://github.com/AyraHikari/SamsungMusicPort import json import json def convert_m3u_to_smpl(m3u_file, smpl_file_name): members = [] with open(m3u_file, "r") as m3u: order = 0 for line in m3u: line = line.strip() if not line or line.startswith("#EXTM3U"): continue elif line.startswith("#EXTINF"): title = line.split(",", 1)[1] if "," in line else "" else: file_path = line members.append({ "artist": "", "info": file_path, "order": order, "title": "", # Samsung music doesn't care for some reason "type": 65537 }) order += 1 smpl_data = { "members": members, "name": "Favorite", "recentlyPlayedDate": 0, "sortBy": 4, "version": 1 } with open(smpl_file_name, "w") as smpl_file: json.dump(smpl_data, smpl_file, indent=4) if __name__ == "__main__": m3u_file = "out.m3u" # Replace with your M3U file name smpl_file = "converted_playlist.smpl" # Replace with the desired SMPL file name convert_m3u_to_smpl(m3u_file, smpl_file)