first real version
authorJean-Philippe Orsini <jeanfi@gmail.com>
Sun, 17 Jan 2016 22:25:47 +0000 (23:25 +0100)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Sun, 17 Jan 2016 22:25:47 +0000 (23:25 +0100)
mp3tohtml.py [new file with mode: 0755]
mp3tohtml.sh [deleted file]

diff --git a/mp3tohtml.py b/mp3tohtml.py
new file mode 100755 (executable)
index 0000000..d2e4529
--- /dev/null
@@ -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 "<html><head><title>List of songs</title></head>"
+print "<body><h1>List of songs</h1>"
+print "<table>"
+
+for f in files:
+    tag = eyeD3.Tag()
+
+    tag.link(f)
+
+    print "\t<tr>"
+
+    try: 
+        artist = tag.getArtist().decode('utf-8')
+        print "\t\t<td>" + artist + "</td>"       
+    except UnicodeEncodeError:
+        print "\t\t<td></td>"
+
+    try:        
+        print "\t\t<td>" + tag.getAlbum() + "</td>"
+    except UnicodeEncodeError:
+        print "\t\t<td></td>"
+
+    try:
+        print "\t\t<td>" + tag.getTitle() + "</td>"
+    except UnicodeEncodeError:
+        print "\t\t<td></td>"
+
+    print "\t\t<td>"
+    comments = tag.getComments()
+    for c in comments:
+        print comments[0].comment
+    print "\t\t</td>"
+
+    print "\t</tr>"
+
+print "</table>"
+    
+print "</body></html>"
diff --git a/mp3tohtml.sh b/mp3tohtml.sh
deleted file mode 100755 (executable)
index 05a7907..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-