Last active
December 6, 2022 12:27
-
-
Save utgwkk/8366805 to your computer and use it in GitHub Desktop.
Making m3u playlist automatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Execute it in the directory which includes music files | |
rem It requires one argument which will become created m3u playlist file's name | |
for %%i in (*.mp3,*.mp4,*.m4a,*.wma,*.wav) do echo %cd%\%%i >> %1.m3u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
# Execute it in the directory which includes music files | |
import os.path, glob | |
exts = ('mp3','mp4','m4a','wma','wav') | |
files = [] | |
for e in exts: files.extend(glob.glob('*.%s'%e)) | |
output = os.path.basename(os.path.dirname(os.path.abspath(__file__))) | |
with open(output+'.m3u','w') as f: | |
for fname in files: | |
f.write('%s\n'%os.path.abspath(fname)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment