OS X Commandline scraper and tagger
#1
Hi everyone,

i have written a small command line tool, which is able to
  • read embedded tags in m4v-files
  • read xbmc nfo files
  • get information from the itunes store with poster
  • create nfo files
  • tag the file
There are many scenarios possible:
  • read tags and create nfo files for xbmc
  • tag m4v-files with data from the itunes store
  • read nfo file and tag the movie according to the information
  • etc

You can use this tool on files or directories. if you choose a directory it scans recursively and looks for m4v-files.
nfo-Files must be named "<movie>.nfo" or "movie.nfo".
it uses the parent folder name as title for lookups if there is no title tagged or found in the nfo file.
if you want to use it on directories, you should use the -unattended argument.
the -remove argument is not working! you can delete your files using finder and search for "nfo" as a workaround.

Tags:
to list all tags use: -listmetadata
for tagging the movie use: -tag
to ignore embedded tags use: -ignoretags
to extract the embedded artwork use: -extractdefault
the extracted artwork will be named either <movie>-poster.png, <movie>-fanart.jpg, or <movie>-banner.png. it depends on the image sizes and aspect ratios and will be named automatically.
<movie>-poster.png, <movie>-fanart.jpg, or <movie>-banner.png - files in the movie's directory will be tagged automatically in this order. so there are at most 3 artworks embedded and the first one will be the poster, which is also shown in iTunes.

Scraping iTunes Store:
the required arguments for a lookup are: -country de -limit 1
you can get a list of supported country codes with: -listcc
a optional parameter is: -title "Matrix"
if you don't want to lookup, you have to use: -nolookup

Creating nfo files:
if you wish to overwrite an existing nfo file, you have to use: -w -O
the created nfo file is named <movie>.nfo and in a xbmc compatible format

Code:
scraper usage:

     -i, -input <file>        URL of source file                    

nfo Options:
     -n, -nfo <nfo file>      URL of nfo file    to read                
     -w, -writenfo            Create nfo file                        
     -O, -overwritenfo        Overwrite nfo file                    
     -I, -ignorenfo           Don't read nfo file                    

Metadata Options:
     -lm, -listmetadata        List metadata                                
     -it, -ignoretags          Ignore tags                                
     -t,  -tag                 Tag file with data from nfo or scraper        
     -e,  -extract <png file>     Extract artwork to <png file>                
     -ed, -extractdefault      Extract artwork to <movie>-poster.png        

Scraper Options:
     -T, -title <title>       Title for lookup                    
     -c, -country <cc>        Country Code for lookup e.g. de        
     -C, -listcc              List available country codes        
     -L, -limit               Limit search results (default: 1)    
     -N, -nolookup            Don't lookup, just read nfo            

Mode Options:
     -u, -unattended          No user interactions, skip            
     -r, -remove              Remove nfo and artwork from disk    

Misc Options:
     -h, -help                Show help                            
     -V, -version             Show version                        
     -v, -verbose             Verbose output                        
     -W, -workflow            Show workflow                        


Recommended Directory Structure:

<All Movies>
[----<Matrix>
        [----<Matrix>.m4v
                [----<Matrix>.nfo
                [----<Matrix>-poster.png
                [----<Matrix>-fanart.jpg
                [----<Matrix>-banner.png
[----<Prestige>
        [----<foobar>.m4v

The title for lookups is the name of parent directory of the m4v file or the title given via tag/nfo or via commandline argument.    

Examples:
Lookup for the title <Matrix> (show max 10 results) and tag the file but ignore embedded tags:
scraper -input "/path/to/file.m4v" -country de -limit 10 -tag    -title "Matrix"    
scraper -i "/path/to/file.m4v" -c de -L 10 -t    -T "Matrix"                        

Read tags from a file and create a nfo file for xbmc with embedded artwork as <movie>-poster.png
scraper -i "/path/to/file.m4v" -nolookup -writenfo -extractdefault    

Tag all m4v files from the infos of the nfo files                                
scraper -i "/Users/username/iTunes/Movies/" -it -t                                

Lookup, create new nfo, tag, save Artwork for all movies in this directory without user interaction:            
scraper -i "/Users/username/iTunes/Movies/" -it -t    -c de -u -w -O -ed -I                        

list metadata:                                
scraper -i "/Users/username/iTunes/Movies/Matrix/Matrix.m4v" -lm


Here (Dropbox Link) you can download a compiled binary for Yosemite.

Only Movies in m4v format are supported right now. It is not (yet) the final version, but it should work...
i don't know yet if i am continuing on this command line version, but i want to share what i have already done... It is not heavily tested and if you have any problems or are interested in supporting me, please feel free to contact me. the source code will be released, once i have time to overlook and rewrite some parts. There are some bugs i know of, but feel free to post them here in this thread. Thank you and have fun with it.
This utility is based on SublerCLI! Thank you for this great tool!

Oh, and Mac only!

An00bIS

Edit: Updated link for download: HERE AGAIN
Reply
#2
Hi

I would like to try your cli scraper for OSX, unfortunately the download link does not work.
Could you please provide me the program?
BTW: only have Mavericks.

Kindly
Felix
Reply
#3
Hi!
Great tool!

Will you add support for tv shows? At the moment the .nfo is generated as movie and therefore won't work with Kodi.

And just one info. The scraper won't work if the filenames contain an umlaut, such as ß,ö,...
In this case the exported -nfo and cover just contain the information from the last successfull export in folder mode or an error (cannot access m4v) is given in single file mode
Reply

Logout Mark Read Team Forum Stats Members Help
Commandline scraper and tagger0