Add-on:Artwork Downloader

Website: http://xbmctech.com

= Summary = This add-ons searches through your library for all your currently added Movies, TV Shows and Musicvideos and then searches for avaiable artwork. This then is downloaded to the folder location where that media is stored.

= Bug and issue reports =


 * If anyone finds any bugs or has any suggestions please add them to issues on github or let us know here. DO NOT post parts of you debug log directly. ONLY use http://paste.ubuntu.com/ or http://pastebin.com/ and post the link together with a description of the problem in the forum thread.
 * If you fail to follow this you WONT get help!
 * Incorrect (language) Artwork downloaded? Check one of the source sites and see why. Usually it 's because some-one set it wrong.

= Github =

Here you can get the latest code and .zip install for testing purpose.

Remember these are BETA version and can break.

Stable version is available in XBMC repo.


 * Project: https://github.com/XBMC-Addons/script.artwork.downloader

= Current Features =

Download artwork
 * Movies
 * TV Shows
 * Musicvideos

Limit artwork


 * Maximum extrafanart
 * Minimum rating
 * Preferred language (fall-back is always English)
 * Exclude fanart that has text (only available on thetvdb.com)
 * Minimum fanart size Movies (also for Musicvideos)
 * Minimum fanart size TV Shows

Note: Extrafanart will be automaticly deleted when it is found below the limit settings

Overwrite all


 * This will overwrite all current files with the ones that fit the limiter. This option will automatic reset after a download run.

Interface translated in
 * Dutch
 * English
 * French
 * German (needs updating)
 * Greek
 * Polish (needs updating)
 * Portuguese (Brazil)
 * Spanish

= Artwork sources: =
 * www.fanart.tv
 * www.thetvdb.com
 * www.themoviedb.org

Please show your support to these sites by donating or contributing new artwork!

= Naming conventions =

Filenaming
Movies:
 * Poster (poster.jpg)
 * FanArt (fanart.jpg)
 * Extra fanart (.jpg)
 * Extrathumbs (thumb1.jpg to thumb4.jpg)
 * Clearart (clearart.png)
 * Logo (logo.png)
 * Discart (disc.png)
 * Wide Banner Icons (banner.jpg)
 * Thumb 16:9 (landscape.jpg)

TV Shows:
 * Poster (poster.jpg)
 * Season Posters (seasonx.jpg)
 * FanArt (fanart.jpg)
 * Extra fanart (.jpg)
 * Clearart (clearart.png)
 * Characterart (character.png)
 * Logo (logo.png)
 * Wide Banner Icons (banner.jpg)
 * Season Banners (seasonbannerx.jpg)
 * Thumb 16:9 (landscape.jpg)
 * Season Thumb 16:9 (seasonx-landscape.jpg | seasonall-landscape.jpg)

Musicvideos:
 * Poster (poster.jpg)
 * FanArt (fanart.jpg)
 * Extra fanart (.jpg)
 * Extrathumbs (thumb1.jpg to thumb4.jpg)
 * Clearart (clearart.png)
 * Logo (logo.png)
 * Discart (disc.png)

Movies
| ---/Movie 1/ |   ---/extrafanart/ ---/extrathumbs/

TV Shows
| ---/TV Show 1/ |   ---/extrafanart ---/Season 1/ ---/Season 2/ ---/Season ./

Discart
The script uses several rules to check what discart to download.

Language
It uses the set language in add-on settings and if not found it will fall back to the English one available.

Filenames
If the filename contains any of the following that disctype will be downloaded. The uses check are case insensitive.

DVD:
 * dvd
 * extension .ifo
 * extension .vob

BluRay:
 * bluray
 * blu-ray
 * brrip
 * bdrip
 * extension .m2ts
 * extension .bdmv

3D movies:
 * 3d (so even when 3d-bluray or 3dbluray or 3dbd)

Streamdetails
When none of these are found in the filename the disctype will be determined by the streamdetails.

Streamdetails height:
 * <720 downloads DVD
 * =>720 downloads BluRay

= Skin integration for running the script = This add-on support different kind of skin integration methods. This allows skins to use buttons to download different kinds of artwork for a single media item or in bulk mode.

' All commands are case sensitive! '

Solo mode: Eden
This downloads for a single media item depending from what section of XBMC this is gonna be used from.

Run script for single media item

This downloads all available artwork that has been enable in the add-on settings.

Script command: XBMC.RunScript(script.artwork.downloader, mediatype=?, medianame=?)

Skin example: Get Artwork $LOCALIZE[31316] XBMC.RunScript(script.artwork.downloader, mediatype=tvshow, medianame=$ESCINFO[ListItem.TVShowTitle]) XBMC.RunScript(script.artwork.downloader, mediatype=movie, medianame=$ESCINFO[ListItem.Title],mediapath=$ESCINFO[ListItem.Path]) XBMC.RunScript(script.artwork.downloader, mediatype=musicvideos, medianame=$ESCINFO[ListItem.Title],mediapath=$ESCINFO[ListItem.Path]) [Container.Content(tvshows)|Container.Content(movies)|Container.Content(musicvideos)]+system.hasaddon(script.artwork.downloader)

Runs script in GUI dialog mode

A menu is displayed with available artwork type. When a artwork type is selected the image list with available images will be displayed. This won't take the add-on settings into account.

The selected image will automaticly overwrite the current one when present.

Script command: XBMC.RunScript(script.artwork.downloader, mode=gui, mediatype=?, medianame=?)

Skin example: Get Artwork $LOCALIZE[31316] XBMC.RunScript(script.artwork.downloader, mode=gui, mediatype=tvshow, medianame=$ESCINFO[ListItem.TVShowTitle]) XBMC.RunScript(script.artwork.downloader, mode=gui, mediatype=movie, medianame=$ESCINFO[ListItem.Title],mediapath=$ESCINFO[ListItem.Path]) XBMC.RunScript(script.artwork.downloader, mode=gui, mediatype=musicvideo, medianame=$ESCINFO[ListItem.Title],mediapath=$ESCINFO[ListItem.Path]) [Container.Content(tvshows)|Container.Content(movies)|Container.Content(musicvideos)]+system.hasaddon(script.artwork.downloader)

Runs script in custom mode

In this mode you can specify an artwork type that you want to download for a specific media item. When only one image is found it will be just downloaded. When multiple images are found the image selection dialog will be shown for user selection. You can specify multiple artwork types for downloading however this won't show the image selection dialog. The image dialog is also disabled for extrathumbs and extrafanart.

This won't take the add-on settings into account except for extrafanart/extrathumbs.

Script command: XBMC.runscript(script.artwork.downloader, mode=custom, mediatype=?,medianame=?, )

XBMC.runscript(script.artwork.downloader, mode=custom, mediatype=?,medianame=?, , , )

Skin example: Get Artwork $LOCALIZE[31316] XBMC.RunScript(script.artwork.downloader, mode=custom, mediatype=tvshow, medianame=$ESCINFO[ListItem.TVShowTitle], extrafanart) XBMC.RunScript(script.artwork.downloader, mode=custom, mediatype=movie, medianame=$ESCINFO[ListItem.Title],mediapath=$ESCINFO[ListItem.Path], extrafanart) XBMC.RunScript(script.artwork.downloader, mode=custom, mediatype=musicvideo, medianame=$ESCINFO[ListItem.Title],mediapath=$ESCINFO[ListItem.Path], extrafanart) [Container.Content(tvshows)|Container.Content(movies)|Container.Content(musicvideos)]+system.hasaddon(script.artwork.downloader)

Solo mode: Frodo
As of XBMC v12 Frodo:

This downloads for a single media item depending from what section of XBMC this is gonna be used from.

Run script for single media item

This downloads all available artwork that has been enable in the add-on settings.

Script command: XBMC.RunScript(script.artwork.downloader, mediatype=?, dbid=?)

Skin example: Get Artwork $LOCALIZE[31316] <onclick condition="Container.Content(tvshows)">XBMC.RunScript(script.artwork.downloader, mediatype=tvshow, dbid=$INFO[ListItem.DBID]) <onclick condition="Container.Content(movies)">XBMC.RunScript(script.artwork.downloader, mediatype=movie, dbid=$INFO[ListItem.DBID]) <onclick condition="Container.Content(musicvideos)">XBMC.RunScript(script.artwork.downloader, mediatype=musicvideos, dbid=$INFO[ListItem.DBID]) [Container.Content(tvshows)|Container.Content(movies)|Container.Content(musicvideos)]+system.hasaddon(script.artwork.downloader)

Runs script in GUI dialog mode

A menu is displayed with available artwork type. When a artwork type is selected the image list with available images will be displayed. This won't take the add-on settings into account.

The selected image will automaticly overwrite the current one when present.

Script command: XBMC.RunScript(script.artwork.downloader, mode=gui, mediatype=?, dbid=?)

Skin example: Get Artwork $LOCALIZE[31316] <onclick condition="Container.Content(tvshows)">XBMC.RunScript(script.artwork.downloader, mode=gui, mediatype=tvshow, dbid=$INFO[ListItem.DBID]) <onclick condition="Container.Content(movies)">XBMC.RunScript(script.artwork.downloader, mode=gui, mediatype=movie, dbid=$INFO[ListItem.DBID]) <onclick condition="Container.Content(musicvideos)">XBMC.RunScript(script.artwork.downloader, mode=gui, mediatype=musicvideo, dbid=$INFO[ListItem.DBID]) [Container.Content(tvshows)|Container.Content(movies)|Container.Content(musicvideos)]+system.hasaddon(script.artwork.downloader)

Runs script in custom mode

In this mode you can specify an artwork type that you want to download for a specific media item. When only one image is found it will be just downloaded. When multiple images are found the image selection dialog will be shown for user selection. You can specify multiple artwork types for downloading however this won't show the image selection dialog. The image dialog is also disabled for extrathumbs and extrafanart.

This won't take the add-on settings into account except for extrafanart/extrathumbs.

Script command: XBMC.runscript(script.artwork.downloader, mode=custom, mediatype=?,dbid=?, <art_type>)

XBMC.runscript(script.artwork.downloader, mode=custom, mediatype=?,dbid=?, <art_type>, <art_type>, <art_type>)

Skin example: Get Artwork $LOCALIZE[31316] <onclick condition="Container.Content(tvshows)">XBMC.RunScript(script.artwork.downloader, mode=custom, mediatype=tvshow, dbid=$INFO[ListItem.DBID], extrafanart) <onclick condition="Container.Content(movies)">XBMC.RunScript(script.artwork.downloader, mode=custom, mediatype=movie, dbid=$INFO[ListItem.DBID], extrafanart) <onclick condition="Container.Content(musicvideos)">XBMC.RunScript(script.artwork.downloader, mode=custom, dbid=$INFO[ListItem.DBID], extrafanart) [Container.Content(tvshows)|Container.Content(movies)|Container.Content(musicvideos)]+system.hasaddon(script.artwork.downloader)

Bulk mode
Run script for multiple media items

This downloads all available artwork that has been enable in the add-on settings.

Script command: XBMC.RunScript(script.artwork.downloader, mediatype=?)

This downloads all available artwork that has been specified in the script command.

Script command: XBMC.RunScript(script.artwork.downloader, mode=custom, <art_type>,<art_type>,<art_type>) XBMC.RunScript(script.artwork.downloader, mode=custom, mediatype=?,<art_type>,<art_type>,<art_type>)

Skin example: Get Artwork $LOCALIZE[31316] <onclick condition="Container.Content(tvshows)">XBMC.RunScript(script.artwork.downloader, mediatype=tvshow) <onclick condition="Container.Content(movies)">XBMC.RunScript(script.artwork.downloader, mediatype=movie) <onclick condition="Container.Content(musicvideos)">XBMC.RunScript(script.artwork.downloader, mediatype=musicvideos) [Container.Content(tvshows)|Container.Content(movies)|Container.Content(musicvideos)]+system.hasaddon(script.artwork.downloader)

Script options
Modes

These are the available mode like they where explained before
 * mode=gui
 * mode=custom
 * silent=true

Script example: XBMC.runscript(script.artwork.downloader, mode=custom, extrafanart)

XBMC.runscript(script.artwork.downloader, mode=custom, mediatype=movie, extrafanart)

Silent mode:

This will run the script in background mode. It will only display the starting and finish notification dialog. Only useful when used for bulk mode.

Script bool: silent=true

Script example: XBMC.runscript(script.artwork.downloader, mode=custom, silent=true, extrafanart)

XBMC.runscript(script.artwork.downloader, mode=custom, mediatype=movie, silent=true, extrafanart)

Mediatypes

Available media types to used in the script command:
 * mediatype=movie
 * mediatype=tvshow
 * mediatype=musicvideo

Medianames

Available medianame usage for skins:
 * Movies:
 * medianame=$ESCINFO[ListItem.Title]
 * medianame=$ESCINFO[ListItem.Title], mediapath=$ESCINFO[ListItem.Path] (This prevents using the wrong library item when multiple versions are found of this movie)
 * medianame=Avatar
 * TV Shows:
 * medianame=$ESCINFO[ListItem.TVShowTitle]
 * medianame=House
 * Musicvideos:
 * medianame=$ESCINFO[ListItem.Title]
 * medianame=$ESCINFO[ListItem.Title], mediapath=$ESCINFO[ListItem.Path] (This prevents using the wrong library item when multiple versions are found of this musicvideo)
 * medianame=Adele - Live At The Royal Albert Hall (2011)

The use of medianames is removed and replaced by: dbid=$INFO[ListItem.DBID]

Art types

This are the available art types that can be used in the scrip command.


 * Movies:
 * poster
 * fanart
 * extrafanart
 * extrathumbs
 * clearlogo
 * clearart
 * discart
 * thumb
 * banner


 * TV Show:
 * poster
 * seasonposter
 * fanart
 * extrafanart
 * extrathumbs
 * clearlogo
 * clearart
 * tvthumb
 * seasonthumb
 * banner
 * seasonbanner
 * characterart


 * Musicvideos:
 * poster
 * fanart
 * extrafanart
 * extrathumbs
 * clearlogo
 * clearart
 * discart

= Skin integration for using the images =

These are some code examples on how to use some different kind of artwork. All artwork is downloaded to the TV Show main folder or the Movie folder which contains the media files.

These examples are made with the assumption that all TV Show episodes are in season folders. If not you will have to make the necessary adjustments to the code.

General
Replace the fanart.jpg with the filename found in the filenaming conventions section.

Skin code examples

$INFO[ListItem.FilenameAndPath,,/fanart.jpg]
 * TV Show and season level:

$INFO[ListItem.FilenameAndPath,,../fanart.jpg]
 * TV Show episode level:

$INFO[ListItem.Path,,fanart.jpg]
 * Movie:

$INFO[ListItem.Path,,fanart.jpg]
 * Musicvideo:

Frodo-only infolabels, supported from Artwork Downloader 12.0.2 onwards

$INFO[ListItem.Art(clearlogo)] $INFO[ListItem.Art(clearart)] $INFO[ListItem.Art(banner)] $INFO[ListItem.Art(landscape)] $INFO[ListItem.Art(discart)]
 * Movies:

$INFO[ListItem.Art(clearlogo)] $INFO[ListItem.Art(clearart)] $INFO[ListItem.Art(banner)] $INFO[ListItem.Art(landscape)] $INFO[ListItem.Art(characterart)]
 * TV shows (at TV show and season level)

$INFO[ListItem.Art(tvshow.clearlogo)] $INFO[ListItem.Art(tvshow.clearart)] $INFO[ListItem.Art(tvshow.banner)] $INFO[ListItem.Art(tvshow.landscape)] $INFO[ListItem.Art(tvshow.characterart)]
 * TV shows (at episode level)

Season artwork
Season artwork is downloaded in the main TV Show folder. The skin must call them from there. Below are some examples given on how to use season posters. Just replace the filename with the one you want to use.

This method applies to:
 * poster (seasonx-poster.jpg)
 * banner (seasonx-banner.jpg)
 * thumb 16:9 (seasonx-landscape.jpg)
 * thumb 16:9 (seasonall-landscape.jpg)

x = single digit seasonnumber

Skin code examples

$INFO[ListItem.Path]$INFO[ListItem.Season,season,-poster.jpg]
 * Season level in library:

$INFO[Player.Folderpath]$INFO[VideoPlayer.Season,../season,-poster.jpg]
 * Episode level in library:

$INFO[Player.Folderpath]$INFO[VideoPlayer.Season,../season,-poster.jpg]
 * While playing episode: