#!/usr/bin/env python
# Full tag list for any given file.
import os
import sys
from optparse import OptionParser
def main(argv):
from mutagen import File
parser = OptionParser()
(options, args) = parser.parse_args(argv[1:])
if not args:
raise SystemExit(parser.print_help() or 1)
for filename in args:
print "--", filename
try: audio = File(filename, easy=True)
except AttributeError: print "Unknown file type"
except KeyboardInterrupt: raise
except Exception, err: print str(err)
try: print "Title = ", audio["title"][0]
except Exception: print
try: print "Description = ", audio["artist"][0]
except Exception: print
try: print "Album = ", audio["album"][0]
except Exception: print
try: print "Playtime = ", audio.info.length
except Exception: print
try: print "Bitrate = ", audio.info.bitrate
except Exception: print
try: print "Filetype = ", os.path.splitext(filename)[1][1:]
except Exception: print
try: print "Mimetype = ", audio.mime[0]
except Exception: print
try: print "Tracknum = ", audio["tracknumber"][0]
except Exception: print
try: print "Release Date = ", audio["date"][0]
except Exception: print
if __name__ == "__main__":
try: import mutagen
except ImportError:
# Run out of tools/
sys.path.append(os.path.abspath("../"))
import mutagen
main(sys.argv)
-- C:\Documents and Settings\bis63083\My Documents\My Music\iTunes\iTunes Media\Music\ADELE\21\01 Rolling In the Deep.m4a
Title = Rolling In the Deep
Description = ADELE
Album = 21
Playtime = 228.345034014
Bitrate = 256000
Filetype = m4a
Mimetype = audio/mp4
Tracknum = 1/12
Release Date = 2011-02-22T08:00:00Z
-- C:\Documents and Settings\bis63083\My Documents\My Music\iTunes\iTunes Media\Music\Air Supply\Greatest Hits Live Now & Forever\01 Making Love Out of Nothing at All.mp3
Title = Making Love Out of Nothing at All
Description = Air Supply
Album = Greatest Hits Live Now & Forever
Playtime = 346.446854799
Bitrate = 128000
Filetype = mp3
Mimetype = audio/mp3
Tracknum = 1
Release Date =
"jimcampbell100" wrote:
Interesting. I point to that URL, and it just says "None".
I see the images directory and file you reference when I browse the client directory on the NAS.
"jimcampbell100" wrote:
Let me ask in case I'm doing something wrong - to install I just copied the entire contents of you zip to a directory on my NAS. From the command line I then execute the mymedia.py in the server directory. Anything else I need to do?
"jimcampbell100" wrote:
To answer your question, my directories are setup as one top level Videos directory, with about 40 sub-directories, each with one movie each. There are a few images in each, front and back cover of the DVD case, for example.
"jimcampbell100" wrote:
Thanks again for the help!
"jimcampbell100" wrote:
Yes, I tried it again, and the url is correct.
When I use that url, I get the following in the console window where I run mymedia.py on the server:
192.168.1.190:58657 - - [22/Dec/2011 12:43:08] "HTTP/1.1 GET /media" - 200 OK
192.168.1.190:58657 - - [22/Dec/2011 12:43:09] "HTTP/1.1 GET /favicon.ico" - 404 Not Found
Nothing is added to the my_media_log.txt file when I enter that url.
Note that when I try to enter the url, the browser returns a page that actually says "None". It's not a typical 404 error.
Thanks!
CHUNK_SIZE = 10 * 1024;
CHUNK_SIZE = 16 * 1024;
"jimcampbell100" wrote:
I was actually using the name of my NAS vs the direct IP address as you told me (btw this works for loading the configuration page). When I switched to the IP address, I did see the image, and it did resize when I added that to the end of the url.
"umbighouse" wrote:
Jim-
Looks like you've been the proud owner of this project for the past year or so. I wanted to see how tough you think the following feature might be.
"umbighouse" wrote:
For video artwork, I've used other programs which will show a thumbnail of the video which appears to be an image of the first frame. Is this possible with MyMedia? If not out of the box, how tough would it be to autocreate a jpg in the video file's folder, naming it the same as the video with a .jpg extension?
"umbighouse" wrote:
OK, I'm getting greedy here, but here's another one...
How about we create a Movies folder (this would be different from Videos, which would be primarily private content). The Movies folder would be actual movies. How tough would it be to setup a "scraper" to reference a site like IMDB.com to pull down poster artwork?
"umbighouse" wrote:
The gears in my head heave been spinning! Hope all is well.
-umbighouse
"jambalaya" wrote:
I don't know if anyone else has this problem, but my handbrake-encoded videos randomly exit after about half an hour or so. I can resume playing and the videos continue on normally until the next unexpected exit. There is nothing in the logs to indicate a problem. My videos are encoded with constant quality = 20 rather than constant bitrate, so on a hunch I edited the chunk size in mymedia.py from:CHUNK_SIZE = 10 * 1024;
to:CHUNK_SIZE = 16 * 1024;
So far, this appears to have fixed the early exit problem! Videos that previously exited early now play all the way through. Just offering this up in case someone else has similar symptoms.
JB