Last active
October 29, 2019 14:36
-
-
Save X-88/6dc664164287a4570c4289c7351f6910 to your computer and use it in GitHub Desktop.
Playlist Generator M3U
This file contains hidden or 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
#################################### | |
## App Name: Z-PlayList Generator ## | |
## Language : Python 3xx. ## | |
## Coded by: Zephio ## | |
## Date : 16-Nop-2018 ## | |
## Target : M3U. ## | |
#################################### | |
import os | |
x = 0 | |
h = '#EXTM3U' | |
i = '#EXTInf' | |
ifn = "/storage/emulated/0/List.txt" #Input Path | |
ofn = "/storage/emulated/0/ZPlayList.m3u" #Output Path | |
if os.path.isfile(ifn) and os.access(ifn, os.R_OK): | |
print ('\n ##############################\n App Name: Z-Playlist Generator\n Coded by: Zephio\n Date: 16-11-2018\n ##############################\n Info: File Exists\n Process Done!...') | |
else: | |
print ('info: file not found') | |
with open(ifn, 'r') as f: | |
l = list(f) | |
with open(ofn, 'w') as s: | |
s.writelines(h + '\n') | |
while x < len(l): | |
a = os.path.basename(l[x]) | |
b = format('%s: %d, %s' % (i, x + 1, a)) | |
s.write(b) | |
s.write(l[x]) | |
x += 1 | |
f.close() | |
s.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment