remove audio
This commit is contained in:
parent
9690bfa3b1
commit
7e33b51819
14
publish.py
14
publish.py
|
|
@ -96,20 +96,6 @@ for folderinfo in index['folders']:
|
||||||
htmlhome += "<li><a href=\"{}\">{}</a> [<a href=\"{}\">epub</a>]</li>".format(outfilename.replace('.md', '.html'),filetitle,outfilename.replace('.md', '.epub'))
|
htmlhome += "<li><a href=\"{}\">{}</a> [<a href=\"{}\">epub</a>]</li>".format(outfilename.replace('.md', '.html'),filetitle,outfilename.replace('.md', '.epub'))
|
||||||
gmihome += "\n=> {} {}".format(outfilename.replace('.md', '.gmi').replace(' ', '%20'), filetitle)
|
gmihome += "\n=> {} {}".format(outfilename.replace('.md', '.gmi').replace(' ', '%20'), filetitle)
|
||||||
|
|
||||||
elif fileextension == ".wav" or fileextension == ".3gp":
|
|
||||||
|
|
||||||
# todo use builtin python library
|
|
||||||
outfilename = unidecode.unidecode(fileroot) + ".mp3"
|
|
||||||
subprocess.run(["ffmpeg",
|
|
||||||
"-i",
|
|
||||||
os.path.join(folderinfo['folder'], filename),
|
|
||||||
os.path.join('out/html', outfilename)])
|
|
||||||
htmlhome += "<li>{}</li><audio controls><source src=\"{}\"></audio>".format(filetitle, outfilename)
|
|
||||||
|
|
||||||
elif fileextension == ".mp3":
|
|
||||||
shutil.copy(os.path.join(folderinfo['folder'], filename), os.path.join('out/html', outfilename))
|
|
||||||
htmlhome += "<li>{}</li><audio controls><source src=\"{}\"></audio>".format(filetitle, outfilename)
|
|
||||||
|
|
||||||
htmlhome += "\n</ul>"
|
htmlhome += "\n</ul>"
|
||||||
|
|
||||||
with open("out/html/index.html", "w", encoding="utf-8") as htmlindex:
|
with open("out/html/index.html", "w", encoding="utf-8") as htmlindex:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue