From 29f33cb3d47103711ef77842932663ee040260b7 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Sun, 17 Jan 2016 23:25:47 +0100 Subject: [PATCH] first real version --- mp3tohtml.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ mp3tohtml.sh | 2 -- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100755 mp3tohtml.py delete mode 100755 mp3tohtml.sh 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 - -- 2.7.4