generate functionWed, 15 Feb 2023

создания плейлиста m3u со вложенных файлов в папке linux формат файлов mp4

import os import sys def get_filenames(path): filenames = [] for root, dirs, files in os.walk(path): for file in files: filenames.append(os.path.join(root, file)) return filenames def save_to_m3u(filenames, path): with open(path, 'w') as f: for filename in filenames: f.write(filename + '\n') return path if __name__ == '__main__': path = sys.argv[1] filenames = get_filenames(path) save_to_m3u(filenames, 'playlist.m3u')

Questions about programming?Chat with your personal AI assistant