3 # Generate an HTML page containing information about MP3s in a
6 # Usage: mp3tohtml.py <mp3_dir>
8 # Last version of this tool can be get from the GIT repository:
9 # http://git.wpitchoune.net/radio.git
11 # (c) 2015 Jean-Philippe Orsini <jeanfi@gmail.com>
18 if len(sys.argv) != 2:
21 header_path = os.path.dirname(sys.argv[0]) + "/header.tpl"
22 header = open(header_path, "r")
24 sys.stdout.write(line)
26 files = glob.glob(sys.argv[1] + "/**/*mp3")
36 artist = tag.getArtist()
37 print "\t\t<td>" + artist + "</td>"
38 except UnicodeEncodeError:
42 print "\t\t<td>" + tag.getAlbum() + "</td>"
43 except UnicodeEncodeError:
47 print "\t\t<td>" + tag.getTitle() + "</td>"
48 except UnicodeEncodeError:
52 comments = tag.getComments()
54 print comments[0].comment
62 print " <li><a href=\"mailto:proxyradio@wpitchoune.net\">Contact</a></li>"
65 print "</body></html>"