From: Jean-Philippe Orsini Date: Sun, 17 Jan 2016 22:25:47 +0000 (+0100) Subject: first real version X-Git-Url: https://git.wpitchoune.net/gitweb/?p=radio.git;a=commitdiff_plain;h=29f33cb3d47103711ef77842932663ee040260b7 first real version --- diff --git a/mp3tohtml.py b/mp3tohtml.py new file mode 100755 index 0000000..d2e4529 --- /dev/null +++ b/mp3tohtml.py @@ -0,0 +1,49 @@ +#!/usr/bin/python + +import glob +import sys +import eyeD3 + +if len(sys.argv) != 2: + exit(1) + +files = glob.glob(sys.argv[1] + "/**/*mp3") + +print "List of songs" +print "

List of songs

" +print "" + +for f in files: + tag = eyeD3.Tag() + + tag.link(f) + + print "\t" + + try: + artist = tag.getArtist().decode('utf-8') + print "\t\t" + except UnicodeEncodeError: + print "\t\t" + + try: + print "\t\t" + except UnicodeEncodeError: + print "\t\t" + + try: + print "\t\t" + except UnicodeEncodeError: + print "\t\t" + + print "\t\t" + + print "\t" + +print "
" + artist + "" + tag.getAlbum() + "" + tag.getTitle() + "" + comments = tag.getComments() + for c in comments: + print comments[0].comment + print "\t\t
" + +print "" diff --git a/mp3tohtml.sh b/mp3tohtml.sh deleted file mode 100755 index 05a7907..0000000 --- a/mp3tohtml.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -