[RELEASE] Texture Cache Maintenance utility
(2014-05-13, 16:23)Milhouse Wrote:
Code:
usage: mklocal.py [-h] [-l DIRECTORY] [-p PATH] [-A PATH] [-i [FILENAME]] [-o [FILENAME]]
                  [--dryrun] [-r] [--ignorebadprefix] [-a TYPE [TYPE ...]]
                  [-c TYPE [TYPE ...]] [-s [TYPE [TYPE ...]]] [-e [TYPE [TYPE ...]]] [-1]
                  [-nk] [--info] [-q | -v]

Downloads specific artwork types (default: clearart, clearlogo) based on urls in media
library (ie. original source) creating local versions. Avoids retrieving artwork from XBMC
Texture Cache as this is often resized, resampled and of lower quality. Optionally output
data that can be used to update the media library to use new local versions of artwork,
replacing any current remote versions. The same data will also remove invalid remote
artwork from the library.

optional arguments:
  -h, --help             show this help message and exit
  -l DIRECTORY, --local DIRECTORY
                         Local DIRECTORY into which artwork will be WRITTEN, eg.
                         /freenas/media/
  -p PATH, --prefix PATH
                         XBMC PATH prefix (eg. nfs://192.168.0.3/mnt/share/media/) that
                         will be substituted by --local DIRECTORY when traversing media
                         files. This is typically the root of the media source as defined
                         in sources.xml
  -A PATH, --altlocal PATH
                         Alternate local directory which may contain artwork that can be
                         READ and copied to --local, could be the original source folder
  -i [FILENAME], --input [FILENAME]
                         Optional FILENAME containing JSON movie/tvshow data for
                         processing. Read from stdin if FILENAME is - or not specified
  -o [FILENAME], --output [FILENAME]
                         Output a data structure suitable for consumption by
                         texturecache.py [test]set, used to update an XBMC media library
                         converting remote urls into local urls. Written to stdout if
                         FILENAME is - or not specified
  --dryrun               Don't create anything (although downloads will be attempted)
  -r, --readonly         Don't download (or, if specified, copy from --altlocal) new
                         artwork, only use existing --local artwork
  --ignorebadprefix      Don't display a warning for media files with a path that does not
                         match that set by --prefix
  -a TYPE [TYPE ...], --artwork TYPE [TYPE ...]
                         Artwork TYPE(s) for download, eg. "--artwork discart banner"
                         Specify TYPE:SUFFIX if SUFFIX differs from TYPE, eg. "--artwork
                         thumb:poster" would create "thumb" library items with a "-poster"
                         filename suffix
  -c TYPE [TYPE ...], --check TYPE [TYPE ...]
                         Check the named artwork TYPE(s) - or "all" - and warn if any
                         internet (http) URLs are detected
  -s [TYPE [TYPE ...]], --season [TYPE [TYPE ...]]
                         For TV Shows, process season items (default: poster banner
                         landscape)
  -e [TYPE [TYPE ...]], --episode [TYPE [TYPE ...]]
                         For TV Shows, process episode items (default: thumb)
  -1, --singlefolders    Movies are in individual folders so don't use the movie-name as a
                         prefix
  -nk, --nokeep          Don't keep artwork if not able to match with pre-existing local
                         artwork
  --info                 Display informational output to stdout
  -q, --quiet            Silence warnings about missing artwork (NEEDED etc.)
  -v, --verbose          Display diagnostic output

Minimum required arguments are --local, --prefix, --artwork (and --input, which if not specified is read from stdin).

For example, the following would download any remote artwork of the poster/fanart/clearart/clearlogo variety to a movie library rooted at /freenas/media, then associate any already existing or any just downloaded artwork with each movie, outputting changes to newartwork.dat:

Code:
./texturecache.py jd movies zombieland | ./mklocal.py --local /freenas/media --prefix nfs://192.168.0.3/mnt/share/media --artwork poster fanart clearlogo clearart --output newartwork.dat"

I just got this:

Code:
mklocal.py: error: unrecognized arguments: --artwork poster fanart

after trying this:

Code:
./texturecache.py jd tvshows | ./mklocal.py --local /media/drobofs/ --prefix smb://DROBOFS/public/tv/ --artwork poster fanart  --output newartwork.dat

Has that --artwork argument been removed?

It appears the texturecache.py part is still proceeding but will it parse on it's results to mklocal.py?

Eventually I got this: Sad

Code:
Traceback (most recent call last):
  File "./texturecache.py", line 7437, in <module>
    main(sys.argv[1:])
  File "./texturecache.py", line 7261, in main
    extraFields=_extraFields, query=_query)
  File "./texturecache.py", line 4012, in jsonQuery
    jcomms.dumpJSON(data, decode, ensure_ascii)
  File "./texturecache.py", line 2375, in dumpJSON
    self.logger.out(json.dumps(data, indent=2, ensure_ascii=ensure_ascii, sort_keys=True), newLine=True)
  File "./texturecache.py", line 833, in out
    sys.stdout.write("%-s%s" % (udata, NL))
  File "/usr/lib/python2.7/codecs.py", line 352, in write
    self.stream.write(data)
IOError: [Errno 32] Broken pipe
Reply


Messages In This Thread
RE: [RELEASE] Texture Cache Maintenance utility - by raspberry_pd - 2014-09-20, 18:34
Crash on Gotham on OS X - by desepticon - 2014-05-29, 17:57
Cleaning - by AleisterHH - 2018-05-28, 22:03
RE: Cleaning - by Milhouse - 2018-05-28, 22:16
qax genre not updated - by Just-Me_A-User - 2018-06-12, 22:06
RE: qax genre not updated - by Milhouse - 2018-06-12, 23:40
Logout Mark Read Team Forum Stats Members Help
[RELEASE] Texture Cache Maintenance utility17