X-Git-Url: http://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=mp3tohtml.py;h=7a030ac9fee4601209043885d74c88b07f05bf11;hb=079ac950630d42c5ad523c55c161fe476d11bea2;hp=d2e452900a5716295ed089fa30e129dba268ea59;hpb=29f33cb3d47103711ef77842932663ee040260b7;p=radio.git diff --git a/mp3tohtml.py b/mp3tohtml.py index d2e4529..7a030ac 100755 --- a/mp3tohtml.py +++ b/mp3tohtml.py @@ -1,5 +1,15 @@ #!/usr/bin/python +# Generate an HTML page containing information about MP3s in a +# directory. +# +# Usage: mp3tohtml.py +# +# Last version of this tool can be get from the GIT repository: +# http://git.wpitchoune.net/radio.git +# +# (c) 2015 Jean-Philippe Orsini + import glob import sys import eyeD3 @@ -9,10 +19,22 @@ if len(sys.argv) != 2: files = glob.glob(sys.argv[1] + "/**/*mp3") -print "List of songs" +print "" +print "" +print "All songs" + +print " " +print "" +print " " +print "" +print "" + print "

List of songs

" -print "" +print "
" +print "" for f in files: tag = eyeD3.Tag() @@ -20,13 +42,13 @@ for f in files: print "\t" - try: - artist = tag.getArtist().decode('utf-8') - print "\t\t" + try: + artist = tag.getArtist() + print "\t\t" except UnicodeEncodeError: print "\t\t" - try: + try: print "\t\t" except UnicodeEncodeError: print "\t\t" @@ -45,5 +67,9 @@ for f in files: print "\t" print "
ArtistAlbumTitleComments
" + artist + "" + artist + "" + tag.getAlbum() + "
" - +print "" print ""