webservice.fanart.tv sending back 0 bytes
webservice.fanart.tv sending back 0 bytes
when I scrape a show on thetvdb it downloads 0 byte artwork files can anyone confirm this ?
it was ok 1 week ago
the log url's check out ok
I have no problem on themoviedb
it was ok 1 week ago
the log url's check out ok
I have no problem on themoviedb
Re: thetvdb artwork problem
if I try "script fn:artwork.tvdb"
I get this:
I get this:
Match Series Name => [Cheers] [Cheers]
Query Series => [Cheers]
D:\_DoWnLoaD\Done\tv\Cheers => Search by Cheers
D:\_DoWnLoaD\Done\tv\Cheers => Cheers
Generate Series NFO: Cheers [77623]
Fetching D:\_DoWnLoaD\Done\tv\Cheers\poster.jpg => [poster/680x1000, en, 10.0, http://thetvdb.com/banners/posters/77623-7.jpg]
Fetching D:\_DoWnLoaD\Done\tv\Cheers\banner.jpg => [series/graphical, en, 10.0, http://thetvdb.com/banners/graphical/77623-g.jpg]
Fetching D:\_DoWnLoaD\Done\tv\Cheers\fanart.jpg => [fanart/graphical/1920x1080, en, 9.5, http://thetvdb.com/banners/fanart/original/77623-10.jpg]
Fetch resource: http://webservice.fanart.tv/v3/tv/77623 ... 2f392c2deb
Received 0 bytes
Fetch failed: http://webservice.fanart.tv/v3/tv/77623 ... 2f392c2deb
java.io.IOException: Response data is null: tv/77623 => http://webservice.fanart.tv/v3/tv/77623 ... 2f392c2deb
at net.filebot.CachedResource.lambda$get$1(CachedResource.java:96)
at net.filebot.Cache.computeIf(Cache.java:90)
at net.filebot.CachedResource.get(CachedResource.java:82)
at net.filebot.web.FanartTVClient.getArtwork(FanartTVClient.java:45)
at net.filebot.web.ArtworkProvider$getArtwork.call(Unknown Source)
at Script2.fetchSeriesFanart(Script2.groovy:112)
at Script2$_fetchSeriesArtworkAndNfo_closure5$_closure23.doCall(Script2.groovy:176)
at Script2$_fetchSeriesArtworkAndNfo_closure5.doCall(Script2.groovy:176)
at Script2$_fetchSeriesArtworkAndNfo_closure5.doCall(Script2.groovy)
at net.filebot.cli.ScriptShellBaseClass.tryLogCatch(ScriptShellBaseClass.java:141)
at Script2.fetchSeriesArtworkAndNfo(Script2.groovy:154)
at Script1$_run_closure1$_closure10.doCall(Script1.groovy:51)
at Script1$_run_closure1$_closure10.doCall(Script1.groovy)
at net.filebot.cli.ScriptShellBaseClass.tryLogCatch(ScriptShellBaseClass.java:141)
at Script1$_run_closure1.doCall(Script1.groovy:50)
at net.filebot.cli.ScriptShellMethods.eachMediaFolder(ScriptShellMethods.java:218)
at Script1.run(Script1.groovy:7)
at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:64)
at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:74)
at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:127)
at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:29)
at net.filebot.Main.main(Main.java:111)
IOException: Response data is null: tv/77623 => http://webservice.fanart.tv/v3/tv/77623 ... 2f392c2deb
Done ヾ(@⌒ー⌒@)ノ
Re: thetvdb artwork problem
Still not working? The resources in the log all seem to work now from my location.
Re: thetvdb artwork problem
no change
Fetch resource: http://webservice.fanart.tv/v3/tv/77623 ... 2f392c2deb
Received 0 bytes
Fetch failed: http://webservice.fanart.tv/v3/tv/77623 ... 2f392c2deb
java.io.IOException: Response data is null: tv/77623 => http://webservice.fanart.tv/v3/tv/77623 ... 2f392c2deb
at net.filebot.CachedResource.lambda$get$1(CachedResource.java:96)
Re: thetvdb artwork problem
can you/I make it so it bypasses fanart.tv ?
there is no need to use it i think... only when
and I do not use this at all
btw: I to can click/use the links from log in the browser and it works, but in the filebot script it fails
there is no need to use it i think... only when
Code: Select all
// fetch fanart
['hdclearart', 'clearart'].findResult{ type -> fetchSeriesFanart(seriesDir.resolve('clearart.png'), seriesId, type, null, override, locale) }
['hdtvlogo', 'clearlogo'].findResult{ type -> fetchSeriesFanart(seriesDir.resolve('logo.png'), seriesId, type, null, override, locale) }
fetchSeriesFanart(seriesDir.resolve('landscape.jpg'), seriesId, 'tvthumb', null, override, locale)
// fetch season fanart
if (seasonDir != seriesDir) {
fetchSeriesFanart(seasonDir.resolve('landscape.jpg'), seriesId, 'seasonthumb', season, override, locale)
}btw: I to can click/use the links from log in the browser and it works, but in the filebot script it fails
Re: thetvdb artwork problem
You could use Fiddler to debug the HTTP requests. Presumably, CloudFlare is more likely to block requests made by tools such as FileBot while allowing requests from browsers when the load on the site is too high.
You can only disable --def artwork=n altogether.
You can only disable --def artwork=n altogether.
Re: thetvdb artwork problem
have you tried "script fn:artwork.tvdb" ?
because it sounds like you say "there is no problem" ?
As you can read it's not just me with the problem and I can't find any info on fanart.tv or thetvdb saying there is a problem..
In my custom scripts I do not use fanart.tv at all and the problem is the same, 0 byte files
I think I found the problem:
on fanart.tv and thetvdb
if you try the links from the log in browser it will change it from http to https...
so can you change it to https ?
EDIT:
YES, I can confirm fanart.tv and thetvdb on https is working
because it sounds like you say "there is no problem" ?
As you can read it's not just me with the problem and I can't find any info on fanart.tv or thetvdb saying there is a problem..
In my custom scripts I do not use fanart.tv at all and the problem is the same, 0 byte files
I think I found the problem:
on fanart.tv and thetvdb
if you try the links from the log in browser it will change it from http to https...
so can you change it to https ?
EDIT:
YES, I can confirm fanart.tv and thetvdb on https is working
Re: thetvdb artwork problem
If it works in the browser, but not from within FileBot, then the most likely explanation is that some requests are blocked while others aren't. This is what CloudFlare does and unfortunately there's not much I can do about that.
To confirm whether or not CloudFlare is indeed the culprit, you can use Fiddler to see the HTTP requests, so you can have a look at the HTTP error response and see what it says.
The other explanation is that fanart.tv is sending back 302 REDIRECT messages and FileBot somehow doesn't follow them. Not sure if that's the case. Again, Fiddler will tell you exactly what's going on.
I am replying with my mobile phone and won't be able to do any testing or debugging on my desktop computer for the next 1-2 days.
To confirm whether or not CloudFlare is indeed the culprit, you can use Fiddler to see the HTTP requests, so you can have a look at the HTTP error response and see what it says.
The other explanation is that fanart.tv is sending back 302 REDIRECT messages and FileBot somehow doesn't follow them. Not sure if that's the case. Again, Fiddler will tell you exactly what's going on.
Re: thetvdb artwork problem
HTTP/1.1 301 Moved Permanently
Re: thetvdb artwork problem
I see. I guess it's not following redirects then. I'll have a look at the code on Sunday.
Re: thetvdb artwork problem
Since webservice.fanart.tv doesn't rewrite HTTP to HTTPS anymore now, I guess this problem has resolved itself. I'll set it to use HTTPS for future revisions.
Re: thetvdb artwork problem
same problem with thetvdb
info:
the get nfo info works and it "looks like" the artwork to, BUT it only writes 0 byte files
(when http, if https = all ok)
info:
the get nfo info works and it "looks like" the artwork to, BUT it only writes 0 byte files
(when http, if https = all ok)
Re: thetvdb artwork problem
Can you give me the URLs please?
Re: thetvdb artwork problem
look above
why don't you just try scraping a show yourself ?
why don't you just try scraping a show yourself ?
HTTP/1.1 301 Moved Permanently
Location: https://www.thetvdb.com/banners/posters/77623-7.jpg
Server: cloudflare-nginx
CF-RAY: 39fe94eae4143ca1-CPH
0
Re: thetvdb artwork problem
I'll need to recreate a test case and reproduce the problem. You already have both. In this case, a good bug report will allow to understand and fix the problem directly, instead of spending time on figuring out what the problem is.
-
SuperDuper
- Posts: 1
- Joined: 18 Sep 2017, 04:08
Re: thetvdb artwork problem
I just wanted to confirm that I'm having this exact same problem as well. At least for the past 3 or 4 days, FileBot has been creating 0-byte files for the artwork.
If it helps, I run the following script from qBittorrent:
If it helps, I run the following script from qBittorrent:
Code: Select all
C:\filebot -script C:\amc.groovy --output "D:\outputFolder" --action copy --conflict auto -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" seriesFormat="TV Shows/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00.lower()} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}" musicFormat="Music/{n}/{album+'/'}{pi.pad(2)+' - '}{t}"
Server returned HTTP response code: 500 for URL: https://assets.fanart.tv/fanart/tv/2817 ... acc213.jpg
java.io.IOException: Server returned HTTP response code: 500 for URL: https://assets.fanart.tv/fanart/tv/2817 ... acc213.jpg
at org.apache.commons.io.FileUtils.copyURLToFile(FileUtils.java:1478)
at net.filebot.cli.ScriptShellMethods.saveAs(ScriptShellMethods.java:345)
at Script2.fetchSeriesFanart(Script2.groovy:118)
at Script2$_fetchSeriesArtworkAndNfo_closure5.doCall(Script2.groovy:177)
at Script2$_fetchSeriesArtworkAndNfo_closure5.doCall(Script2.groovy)
at net.filebot.cli.ScriptShellBaseClass.tryLogCatch(ScriptShellBaseClass.java:127)
at Script2.fetchSeriesArtworkAndNfo(Script2.groovy:153)
at Script1$_run_closure55$_closure135$_closure142.doCall(Script1.groovy:437)
at Script1$_run_closure55$_closure135.doCall(Script1.groovy:435)
at Script1$_run_closure55.doCall(Script1.groovy:432)
at Script1.run(Script1.groovy:412)
at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:62)
at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:72)
at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:114)
at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:29)
at net.filebot.Main.main(Main.java:120)
Done ヾ(@⌒ー⌒@)ノ
Re: thetvdb artwork problem
5xx error codes would indicate an unrelated server-side issue. For 5xx error codes the most likely explanation is an issue at assets.fanart.tv or at the CloudFlare edge cache.
The errors discussed above are about 3xx response codes which is a different class of problem which has been fixed with the latest revision.
-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: thetvdb artwork problem
same issue here, so no fix yet?
Re: thetvdb artwork problem
This thread discusses a variety of unrelated issues. What exactly is the issue in your case? fanart.tv or thetvdb?
-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: thetvdb artwork problem
i used a script to export fanart.jpg, poster.jpg and banner.jpg from thetvdbrednoah wrote: 20 Sep 2017, 02:43 This thread discusses a variety of unrelated issues. What exactly is the issue in your case? fanart.tv or thetvdb?
But all 3 are now returning 0 kb files..
Re: webservice.fanart.tv sending back 0 bytes
I see. TheTVDB issue has been fixed with the latest revision. You can try the latest jar, or wait for the next stable release.
-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
Is Updating the only way to fix this?rednoah wrote: 20 Sep 2017, 04:42 I see. TheTVDB issue has been fixed with the latest revision. You can try the latest jar, or wait for the next stable release.
Updating filebot breaks my script, i have to keep it under specific version (4.75)
Last edited by denywinarto on 22 Sep 2017, 03:42, edited 1 time in total.
Re: webservice.fanart.tv sending back 0 bytes
no, you can make you own LOCAL scripts (amc.groovy and htpc.groovy)... where you change http to https on the 2 sites (in "htpc.groovy" look for "...url.saveAs(outputFile)"
BUT it's better to fix the "breaks my script", you can try to ask for help
BUT it's better to fix the "breaks my script", you can try to ask for help
-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
hmm it's been a while since i made the script.. any idea what makes this script broken in newer versions ?
Code: Select all
def override = _args.conflict == 'override'
import static groovy.json.StringEscapeUtils.*
/**
* XBMC helper functions
*/
def scanVideoLibrary(host, port) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""")
}
}
}
def showNotification(host, port, title, message, image) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"${escapeJavaScript(title)}","message":"${escapeJavaScript(message)}", "image":"${escapeJavaScript(image)}"},"id":1}""")
}
}
}
/**
* Plex helpers
*/
/**
* TheTVDB artwork/nfo helpers
*/
def fetchSeriesBanner(outputFile, seriesId, bannerType, bannerType2, season, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Banner already exists: $outputFile"
return outputFile
}
// select and fetch banner
def artwork = TheTVDB.getArtwork(seriesId, bannerType, locale)
def banner = [locale.language, null].findResult { lang -> artwork.find{ it.matches(bannerType2, season, lang) } }
if (banner == null) {
log.finest "Banner not found: $outputFile / $bannerType:$bannerType2"
return null
}
log.finest "Fetching $outputFile => $banner"
return banner.url.saveAs(outputFile)
}
def fetchSeriesFanart(outputFile, seriesId, type, season, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Fanart already exists: $outputFile"
return outputFile
}
def artwork = FanartTV.getArtwork(seriesId, "tv", locale)
def fanart = [locale.language, null].findResult{ lang -> artwork.find{ it.matches(type, season, lang) } }
if (fanart == null) {
log.finest "Fanart not found: $outputFile / $type"
return null
}
log.finest "Fetching $outputFile => $fanart"
return fanart.url.saveAs(outputFile)
}
def fetchSeriesNfo(outputFile, i, locale) {
log.fine "Generate Series NFO: $i.name [$i.id]"
def xml = XML {
tvshow {
title(i.name)
sorttitle([i.name, i.startDate as String].findAll{ it?.length() > 0 }.findResults{ it.sortName('$2') }.join(' :: '))
year(i.startDate?.year)
rating(i.rating)
votes(i.ratingCount)
plot(i.overview)
runtime(i.runtime)
mpaa(i.certification)
id(i.id)
i.genres.each{
genre(it)
}
thumb(i.bannerUrl)
premiered(i.startDate)
status(i.status)
studio(i.network)
tvdb(id:i.id, "https://www.thetvdb.com/?tab=series&id=${i.id}")
/** Kodi requires an <episodeguide> element with a TheTVDB API (v1) Series Record XML URL **/
episodeguide {
url(cache:"${i.id}.xml", "https://www.thetvdb.com/api/1D62F2F90030C444/series/${i.id}/all/${locale.language}.zip")
}
}
}
xml.saveAs(outputFile)
}
def fetchSeriesArtworkAndNfo(seriesDir, seasonDir, seriesId, season, override = false, locale = Locale.ENGLISH) {
tryLogCatch {
// fetch nfo
def seriesInfo = TheTVDB.getSeriesInfo(seriesId, locale)
fetchSeriesNfo(seriesDir.resolve('tvshow.nfo'), seriesInfo, locale)
// fetch series banner, fanart, posters, etc
['680x1000', null].findResult{ fetchSeriesBanner(seriesDir.resolve('poster.jpg'), seriesId, 'poster', it, null, override, locale) }
['graphical', null].findResult{ fetchSeriesBanner(seriesDir.resolve('banner.jpg'), seriesId, 'series', it, null, override, locale) }
// fetch highest resolution fanart
['1920x1080', '1280x720', null].findResult{ fetchSeriesBanner(seriesDir.resolve('fanart.jpg'), seriesId, 'fanart', it, null, override, locale) }
// fetch season banners
if (seasonDir != seriesDir) {
fetchSeriesBanner(seasonDir.resolve('poster.jpg'), seriesId, 'season', 'season', season, override, locale)
fetchSeriesBanner(seasonDir.resolve('banner.jpg'), seriesId, 'seasonwide', 'seasonwide', season, override, locale)
// folder image (resuse series poster if possible)
copyIfPossible(seasonDir.resolve('poster.jpg'), seasonDir.resolve('folder.jpg'))
}
// fetch fanart
['hdclearart', 'clearart'].findResult{ type -> fetchSeriesFanart(seriesDir.resolve('clearart.png'), seriesId, type, null, override, locale) }
['hdtvlogo', 'clearlogo'].findResult{ type -> fetchSeriesFanart(seriesDir.resolve('logo.png'), seriesId, type, null, override, locale) }
fetchSeriesFanart(seriesDir.resolve('landscape.jpg'), seriesId, 'tvthumb', null, override, locale)
// fetch season fanart
if (seasonDir != seriesDir) {
fetchSeriesFanart(seasonDir.resolve('landscape.jpg'), seriesId, 'seasonthumb', season, override, locale)
}
// folder image (resuse series poster if possible)
copyIfPossible(seriesDir.resolve('poster.jpg'), seriesDir.resolve('folder.jpg'))
}
}
/**
* TheMovieDB artwork/nfo helpers
*/
def copyIfPossible(File src, File dst) {
if (src.exists() && !dst.exists()) {
src.copyAs(dst)
}
}
args.eachMediaFolder{ dir ->
// fetch only missing artwork by default
if (!override && dir.hasFile{it.name == 'banner.jpg'}) {
println "Skipping $dir"
return
}
def videos = dir.listFiles{ it.isVideo() }
def query = _args.query ?: detectSeriesName(videos)
def sxe = videos.findResult{ parseEpisodeNumber(it) }
if (query == null) {
query = dir.dir.hasFile{ it.name =~ /Season/ && it.isDirectory() } ? dir.dir.name : dir.name
}
println "$dir => Search by $query"
def options = TheTVDB.search(query, _args.locale)
if (options.isEmpty()) {
println "TV Series not found: $query"
return
}
// sort by relevance
options = options.sortBySimilarity(query, { it.name })
// auto-select series
def series = options[0]
// maybe require user input
if (options.size() != 1 && !_args.nonStrict && !java.awt.GraphicsEnvironment.headless) {
series = javax.swing.JOptionPane.showInputDialog(null, 'Please select TV Show:', dir.path, 3, null, options.toArray(), series)
if (series == null) return
}
// auto-detect structure
def seriesDir = [dir.dir, dir].sortBySimilarity(series.name, { it.name })[0]
def season = sxe && sxe.season > 0 ? sxe.season : 1
println "$dir => $series"
fetchSeriesArtworkAndNfo(seriesDir, dir, series.id, season, false, _args.locale ?: Locale.ENGLISH)
}
Re: webservice.fanart.tv sending back 0 bytes
I take it you made it yourself ?
it looks a lot like you just combine them to 2in1
https://github.com/filebot/scripts/blob ... vdb.groovy
and
https://github.com/filebot/scripts/blob ... tpc.groovy
... does your script do something different ?
btw: it's more likely that it's your format that "breaks" your script
look in your log for something like"script1" and a number, this is the line number in your script where the problem is at.
it looks a lot like you just combine them to 2in1
https://github.com/filebot/scripts/blob ... vdb.groovy
and
https://github.com/filebot/scripts/blob ... tpc.groovy
... does your script do something different ?
btw: it's more likely that it's your format that "breaks" your script
look in your log for something like"script1" and a number, this is the line number in your script where the problem is at.
-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
Yes i mean a mod to filebot's script,kim wrote: 21 Sep 2017, 04:40 I take it you made it yourself ?
it looks a lot like you just combine them to 2in1
https://github.com/filebot/scripts/blob ... vdb.groovy
and
https://github.com/filebot/scripts/blob ... tpc.groovy
... does your script do something different ?
btw: it's more likely that it's your format that "breaks" your script
look in your log for something like"script1" and a number, this is the line number in your script where the problem is at.
it simply returns thetvdb.nfo along with posters, fanarts and banners
How do i check the log? kinda new at this groovy language
Re: webservice.fanart.tv sending back 0 bytes
It was easier just to fix it for you 
this works with newest update
btw: I disabled e.g. clearart and logo.... just remove the "//" part to enable again
here you go :
remember to put your files like so "Cheers\Season 04\Cheers.S04E10.mkv" to get all the fanart
this works with newest update
btw: I disabled e.g. clearart and logo.... just remove the "//" part to enable again
here you go :
Code: Select all
def override = _args.conflict == 'override'
import static groovy.json.StringEscapeUtils.*
/**
* XBMC helper functions
*/
def scanVideoLibrary(host, port) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""")
}
}
}
def showNotification(host, port, title, message, image) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"${escapeJavaScript(title)}","message":"${escapeJavaScript(message)}", "image":"${escapeJavaScript(image)}"},"id":1}""")
}
}
}
/**
* Plex helpers
*/
/**
* TheTVDB artwork/nfo helpers
*/
def fetchSeriesBanner(outputFile, seriesId, bannerType, bannerType2, season, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Banner already exists: $outputFile"
return outputFile
}
// select and fetch banner
def artwork = TheTVDB.getArtwork(seriesId, bannerType, locale)
def banner = [locale.language, null].findResult { lang -> artwork.find{ it.matches(bannerType2, season, lang) } }
if (banner == null) {
log.finest "Banner not found: $outputFile / $bannerType:$bannerType2"
return null
}
log.finest "Fetching $outputFile => $banner"
return banner.url.saveAs(outputFile)
}
def fetchSeriesFanart(outputFile, seriesId, type, season, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Fanart already exists: $outputFile"
return outputFile
}
def artwork = FanartTV.getArtwork(seriesId, "tv", locale)
def fanart = [locale.language, null].findResult{ lang -> artwork.find{ it.matches(type, season, lang) } }
if (fanart == null) {
log.finest "Fanart not found: $outputFile / $type"
return null
}
log.finest "Fetching $outputFile => $fanart"
return fanart.url.saveAs(outputFile)
}
def fetchSeriesNfo(outputFile, i, locale) {
log.fine "Generate Series NFO: $i.name [$i.id]"
def xml = XML {
tvshow {
title(i.name)
sorttitle([i.name, i.startDate as String].findAll{ it?.length() > 0 }.findResults{ it.sortName('$2') }.join(' :: '))
year(i.startDate?.year)
rating(i.rating)
votes(i.ratingCount)
plot(i.overview)
runtime(i.runtime)
mpaa(i.certification)
id(i.id)
i.genres.each{
genre(it)
}
thumb(i.bannerUrl)
premiered(i.startDate)
status(i.status)
studio(i.network)
tvdb(id:i.id, "https://www.thetvdb.com/?tab=series&id=${i.id}")
/** Kodi requires an <episodeguide> element with a TheTVDB API (v1) Series Record XML URL **/
episodeguide {
url(cache:"${i.id}.xml", "https://www.thetvdb.com/api/1D62F2F90030C444/series/${i.id}/all/${locale.language}.zip")
}
}
}
xml.saveAs(outputFile)
}
def fetchSeriesArtworkAndNfo(seriesDir, seasonDir, seriesId, season, override = false, locale = Locale.ENGLISH) {
tryLogCatch {
// fetch nfo
def seriesInfo = TheTVDB.getSeriesInfo(seriesId, locale)
fetchSeriesNfo(seriesDir.resolve('tvshow.nfo'), seriesInfo, locale)
// fetch series banner, fanart, posters, etc
['680x1000', null].findResult{ fetchSeriesBanner(seriesDir.resolve('poster.jpg'), seriesId, 'poster', it, null, override, locale) }
['graphical', null].findResult{ fetchSeriesBanner(seriesDir.resolve('banner.jpg'), seriesId, 'series', it, null, override, locale) }
// fetch highest resolution fanart
['1920x1080', '1280x720', null].findResult{ fetchSeriesBanner(seriesDir.resolve('fanart.jpg'), seriesId, 'fanart', it, null, override, locale) }
// fetch season banners
if (seasonDir != seriesDir) {
fetchSeriesBanner(seasonDir.resolve('poster.jpg'), seriesId, 'season', 'season', season, override, locale)
fetchSeriesBanner(seasonDir.resolve('banner.jpg'), seriesId, 'seasonwide', 'seasonwide', season, override, locale)
// folder image (resuse series poster if possible)
copyIfPossible(seasonDir.resolve('poster.jpg'), seasonDir.resolve('folder.jpg'))
}
// fetch fanart
// ['hdclearart', 'clearart'].findResult{ type -> fetchSeriesFanart(seriesDir.resolve('clearart.png'), seriesId, type, null, override, locale) }
// ['hdtvlogo', 'clearlogo'].findResult{ type -> fetchSeriesFanart(seriesDir.resolve('logo.png'), seriesId, type, null, override, locale) }
// fetchSeriesFanart(seriesDir.resolve('landscape.jpg'), seriesId, 'tvthumb', null, override, locale)
// fetch season fanart
// if (seasonDir != seriesDir) {
// fetchSeriesFanart(seasonDir.resolve('landscape.jpg'), seriesId, 'seasonthumb', season, override, locale)
// }
// folder image (resuse series poster if possible)
copyIfPossible(seriesDir.resolve('poster.jpg'), seriesDir.resolve('folder.jpg'))
}
}
/**
* TheMovieDB artwork/nfo helpers
*/
def copyIfPossible(File src, File dst) {
if (src.exists() && !dst.exists()) {
src.copyAs(dst)
}
}
args.eachMediaFolder{ dir ->
// fetch only missing artwork by default
if (dir.hasFile{it.name == 'banner.jpg'}) {
log.finest "Skipping $dir"
return
}
def videos = dir.listFiles{ it.isVideo() }
def query = _args.query ?: detectSeriesName(videos)
def sxe = videos.findResult{ parseEpisodeNumber(it) }
def locale = any{ _args.language.locale }{ Locale.ENGLISH }
if (query == null) {
query = dir.dir.hasFile{ it.name =~ /Season/ && it.isDirectory() } ? dir.dir.name : dir.name
}
log.finest "$dir => Search by $query"
def options = TheTVDB.search(query, locale)
if (options.isEmpty()) {
log.warning "TV Series not found: $query"
return
}
// sort by relevance
options = options.sortBySimilarity(query, { it.name })
// auto-select series
def series = options[0]
// maybe require user input
if (options.size() > 1 && _args.strict) {
series = showInputDialog(options, query, 'Select TV Show:')
}
if (series == null) {
return null
}
// auto-detect structure
def seriesDir = [dir.dir, dir].sortBySimilarity(series.name, { it.name })[0]
def season = sxe && sxe.season > 0 ? sxe.season : 1
log.fine "$dir => $series"
tryLogCatch {
fetchSeriesArtworkAndNfo(seriesDir, dir, series.id, season, false, locale)
}
}-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
Thanks for fixing it,kim wrote: 21 Sep 2017, 13:16 It was easier just to fix it for you
this works with newest update
btw: I disabled e.g. clearart and logo.... just remove the "//" part to enable again
here you go :remember to put your files like so "Cheers\Season 04\Cheers.S04E10.mkv" to get all the fanartCode: Select all
def override = _args.conflict == 'override' import static groovy.json.StringEscapeUtils.* /** * XBMC helper functions */ def scanVideoLibrary(host, port) { tryLogCatch { telnet(host, port) { writer, reader -> writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""") } } } def showNotification(host, port, title, message, image) { tryLogCatch { telnet(host, port) { writer, reader -> writer.println("""{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"${escapeJavaScript(title)}","message":"${escapeJavaScript(message)}", "image":"${escapeJavaScript(image)}"},"id":1}""") } } } /** * Plex helpers */ /** * TheTVDB artwork/nfo helpers */ def fetchSeriesBanner(outputFile, seriesId, bannerType, bannerType2, season, override, locale) { if (outputFile.exists() && !override) { log.finest "Banner already exists: $outputFile" return outputFile } // select and fetch banner def artwork = TheTVDB.getArtwork(seriesId, bannerType, locale) def banner = [locale.language, null].findResult { lang -> artwork.find{ it.matches(bannerType2, season, lang) } } if (banner == null) { log.finest "Banner not found: $outputFile / $bannerType:$bannerType2" return null } log.finest "Fetching $outputFile => $banner" return banner.url.saveAs(outputFile) } def fetchSeriesFanart(outputFile, seriesId, type, season, override, locale) { if (outputFile.exists() && !override) { log.finest "Fanart already exists: $outputFile" return outputFile } def artwork = FanartTV.getArtwork(seriesId, "tv", locale) def fanart = [locale.language, null].findResult{ lang -> artwork.find{ it.matches(type, season, lang) } } if (fanart == null) { log.finest "Fanart not found: $outputFile / $type" return null } log.finest "Fetching $outputFile => $fanart" return fanart.url.saveAs(outputFile) } def fetchSeriesNfo(outputFile, i, locale) { log.fine "Generate Series NFO: $i.name [$i.id]" def xml = XML { tvshow { title(i.name) sorttitle([i.name, i.startDate as String].findAll{ it?.length() > 0 }.findResults{ it.sortName('$2') }.join(' :: ')) year(i.startDate?.year) rating(i.rating) votes(i.ratingCount) plot(i.overview) runtime(i.runtime) mpaa(i.certification) id(i.id) i.genres.each{ genre(it) } thumb(i.bannerUrl) premiered(i.startDate) status(i.status) studio(i.network) tvdb(id:i.id, "https://www.thetvdb.com/?tab=series&id=${i.id}") /** Kodi requires an <episodeguide> element with a TheTVDB API (v1) Series Record XML URL **/ episodeguide { url(cache:"${i.id}.xml", "https://www.thetvdb.com/api/1D62F2F90030C444/series/${i.id}/all/${locale.language}.zip") } } } xml.saveAs(outputFile) } def fetchSeriesArtworkAndNfo(seriesDir, seasonDir, seriesId, season, override = false, locale = Locale.ENGLISH) { tryLogCatch { // fetch nfo def seriesInfo = TheTVDB.getSeriesInfo(seriesId, locale) fetchSeriesNfo(seriesDir.resolve('tvshow.nfo'), seriesInfo, locale) // fetch series banner, fanart, posters, etc ['680x1000', null].findResult{ fetchSeriesBanner(seriesDir.resolve('poster.jpg'), seriesId, 'poster', it, null, override, locale) } ['graphical', null].findResult{ fetchSeriesBanner(seriesDir.resolve('banner.jpg'), seriesId, 'series', it, null, override, locale) } // fetch highest resolution fanart ['1920x1080', '1280x720', null].findResult{ fetchSeriesBanner(seriesDir.resolve('fanart.jpg'), seriesId, 'fanart', it, null, override, locale) } // fetch season banners if (seasonDir != seriesDir) { fetchSeriesBanner(seasonDir.resolve('poster.jpg'), seriesId, 'season', 'season', season, override, locale) fetchSeriesBanner(seasonDir.resolve('banner.jpg'), seriesId, 'seasonwide', 'seasonwide', season, override, locale) // folder image (resuse series poster if possible) copyIfPossible(seasonDir.resolve('poster.jpg'), seasonDir.resolve('folder.jpg')) } // fetch fanart // ['hdclearart', 'clearart'].findResult{ type -> fetchSeriesFanart(seriesDir.resolve('clearart.png'), seriesId, type, null, override, locale) } // ['hdtvlogo', 'clearlogo'].findResult{ type -> fetchSeriesFanart(seriesDir.resolve('logo.png'), seriesId, type, null, override, locale) } // fetchSeriesFanart(seriesDir.resolve('landscape.jpg'), seriesId, 'tvthumb', null, override, locale) // fetch season fanart // if (seasonDir != seriesDir) { // fetchSeriesFanart(seasonDir.resolve('landscape.jpg'), seriesId, 'seasonthumb', season, override, locale) // } // folder image (resuse series poster if possible) copyIfPossible(seriesDir.resolve('poster.jpg'), seriesDir.resolve('folder.jpg')) } } /** * TheMovieDB artwork/nfo helpers */ def copyIfPossible(File src, File dst) { if (src.exists() && !dst.exists()) { src.copyAs(dst) } } args.eachMediaFolder{ dir -> // fetch only missing artwork by default if (dir.hasFile{it.name == 'banner.jpg'}) { log.finest "Skipping $dir" return } def videos = dir.listFiles{ it.isVideo() } def query = _args.query ?: detectSeriesName(videos) def sxe = videos.findResult{ parseEpisodeNumber(it) } def locale = any{ _args.language.locale }{ Locale.ENGLISH } if (query == null) { query = dir.dir.hasFile{ it.name =~ /Season/ && it.isDirectory() } ? dir.dir.name : dir.name } log.finest "$dir => Search by $query" def options = TheTVDB.search(query, locale) if (options.isEmpty()) { log.warning "TV Series not found: $query" return } // sort by relevance options = options.sortBySimilarity(query, { it.name }) // auto-select series def series = options[0] // maybe require user input if (options.size() > 1 && _args.strict) { series = showInputDialog(options, query, 'Select TV Show:') } if (series == null) { return null } // auto-detect structure def seriesDir = [dir.dir, dir].sortBySimilarity(series.name, { it.name })[0] def season = sxe && sxe.season > 0 ? sxe.season : 1 log.fine "$dir => $series" tryLogCatch { fetchSeriesArtworkAndNfo(seriesDir, dir, series.id, season, false, locale) } }
Unfortunately it still returns 0 kb files...
I'm already using the latest filebot.. any idea why?
Re: webservice.fanart.tv sending back 0 bytes
it most be at least version FileBot 4.7.13 (r5203) to work proper
try
try
filebot.cmd -clear-cache
FileBot.cmd -script fn:sysinfo
-
fireheart2008
- Posts: 37
- Joined: 29 Jul 2014, 05:39
Re: webservice.fanart.tv sending back 0 bytes
i have downloaded thisrednoah wrote: 20 Sep 2017, 04:42 I see. TheTVDB issue has been fixed with the latest revision. You can try the latest jar, or wait for the next stable release.

from https://get.filebot.net/filebot/latest/ ... jar.xz.gpg
but the issue still the same
viewtopic.php?f=6&t=5347
and when i renamed FileBot.jar.xz.gpg to replace FileBot.jar => not working
i seem to be unable to know how to get that beta FileBot 4.7.12 or .13 , there is no download link other than whatever i downloaded
not even here [ https://sourceforge.net/projects/filebot/files/filebot/]
Re: webservice.fanart.tv sending back 0 bytes
yes it's not made easy 
look here viewtopic.php?f=8&t=4960
in the meantime you can use this (it replaces the "http" with "https" on the artwork url's) :
save to e.g. TMP.groovy and it with filebot.cmd -script TMP.groovy
remember to put your files like so "Cheers\Season 04\Cheers.S04E10.mkv" to get all the fanart
look here viewtopic.php?f=8&t=4960
in the meantime you can use this (it replaces the "http" with "https" on the artwork url's) :
Code: Select all
def override = _args.conflict == 'override'
import static groovy.json.StringEscapeUtils.*
/**
* XBMC helper functions
*/
def scanVideoLibrary(host, port) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""")
}
}
}
def showNotification(host, port, title, message, image) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"${escapeJavaScript(title)}","message":"${escapeJavaScript(message)}", "image":"${escapeJavaScript(image)}"},"id":1}""")
}
}
}
/**
* Plex helpers
*/
/**
* TheTVDB artwork/nfo helpers
*/
def fetchSeriesBanner(outputFile, seriesId, bannerType, bannerType2, season, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Banner already exists: $outputFile"
return outputFile
}
// select and fetch banner
def artwork = TheTVDB.getArtwork(seriesId, bannerType, locale)
def banner = [locale.language, null].findResult { lang -> artwork.find{ it.matches(bannerType2, season, lang) } }
if (banner == null) {
log.finest "Banner not found: $outputFile / $bannerType:$bannerType2"
return null
}
log.finest "Fetching $outputFile => $banner"
log.fine "fetchSeriesBanner - banner.url: [$banner.url]"
def URL tmp = new URL(banner.url.toString().replaceAll(/http/, 'https'))
log.fine "fetchSeriesBanner - banner.url NEW: [$tmp]"
return tmp.saveAs(outputFile)
}
def fetchSeriesFanart(outputFile, seriesId, type, season, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Fanart already exists: $outputFile"
return outputFile
}
def artwork = FanartTV.getArtwork(seriesId, "tv", locale)
def fanart = [locale.language, null].findResult{ lang -> artwork.find{ it.matches(type, season, lang) } }
if (fanart == null) {
log.finest "Fanart not found: $outputFile / $type"
return null
}
log.finest "Fetching $outputFile => $fanart"
log.fine "fetchSeriesFanart - fanart.url OLD: [$banner.url]"
def URL tmp = new URL(fanart.url.toString().replaceAll(/http/, 'https'))
log.fine "fetchSeriesFanart - fanart.url NEW: [$tmp]"
return tmp.saveAs(outputFile)
}
def fetchSeriesNfo(outputFile, i, locale) {
log.fine "Generate Series NFO: $i.name [$i.id]"
def xml = XML {
tvshow {
title(i.name)
sorttitle([i.name, i.startDate as String].findAll{ it?.length() > 0 }.findResults{ it.sortName('$2') }.join(' :: '))
year(i.startDate?.year)
rating(i.rating)
votes(i.ratingCount)
plot(i.overview)
runtime(i.runtime)
mpaa(i.certification)
id(i.id)
i.genres.each{
genre(it)
}
thumb(i.bannerUrl)
premiered(i.startDate)
status(i.status)
studio(i.network)
tvdb(id:i.id, "https://www.thetvdb.com/?tab=series&id=${i.id}")
/** Kodi requires an <episodeguide> element with a TheTVDB API (v1) Series Record XML URL **/
episodeguide {
url(cache:"${i.id}.xml", "https://www.thetvdb.com/api/1D62F2F90030C444/series/${i.id}/all/${locale.language}.zip")
}
}
}
xml.saveAs(outputFile)
}
def fetchSeriesArtworkAndNfo(seriesDir, seasonDir, seriesId, season, override = false, locale = Locale.ENGLISH) {
tryLogCatch {
// fetch nfo
def seriesInfo = TheTVDB.getSeriesInfo(seriesId, locale)
fetchSeriesNfo(seriesDir.resolve('tvshow.nfo'), seriesInfo, locale)
// fetch series banner, fanart, posters, etc
['680x1000', null].findResult{ fetchSeriesBanner(seriesDir.resolve('poster.jpg'), seriesId, 'poster', it, null, override, locale) }
['graphical', null].findResult{ fetchSeriesBanner(seriesDir.resolve('banner.jpg'), seriesId, 'series', it, null, override, locale) }
// fetch highest resolution fanart
['1920x1080', '1280x720', null].findResult{ fetchSeriesBanner(seriesDir.resolve('fanart.jpg'), seriesId, 'fanart', it, null, override, locale) }
// fetch season banners
if (seasonDir != seriesDir) {
fetchSeriesBanner(seasonDir.resolve('poster.jpg'), seriesId, 'season', 'season', season, override, locale)
fetchSeriesBanner(seasonDir.resolve('banner.jpg'), seriesId, 'seasonwide', 'seasonwide', season, override, locale)
// folder image (resuse series poster if possible)
copyIfPossible(seasonDir.resolve('poster.jpg'), seasonDir.resolve('folder.jpg'))
}
// fetch fanart
// ['hdclearart', 'clearart'].findResult{ type -> fetchSeriesFanart(seriesDir.resolve('clearart.png'), seriesId, type, null, override, locale) }
// ['hdtvlogo', 'clearlogo'].findResult{ type -> fetchSeriesFanart(seriesDir.resolve('logo.png'), seriesId, type, null, override, locale) }
// fetchSeriesFanart(seriesDir.resolve('landscape.jpg'), seriesId, 'tvthumb', null, override, locale)
// fetch season fanart
// if (seasonDir != seriesDir) {
// fetchSeriesFanart(seasonDir.resolve('landscape.jpg'), seriesId, 'seasonthumb', season, override, locale)
// }
// folder image (resuse series poster if possible)
copyIfPossible(seriesDir.resolve('poster.jpg'), seriesDir.resolve('folder.jpg'))
}
}
/**
* TheMovieDB artwork/nfo helpers
*/
def copyIfPossible(File src, File dst) {
if (src.exists() && !dst.exists()) {
src.copyAs(dst)
}
}
args.eachMediaFolder{ dir ->
// fetch only missing artwork by default
if (dir.hasFile{it.name == 'banner.jpg'}) {
log.finest "Skipping $dir"
return
}
def videos = dir.listFiles{ it.isVideo() }
def query = _args.query ?: detectSeriesName(videos)
def sxe = videos.findResult{ parseEpisodeNumber(it) }
def locale = any{ _args.language.locale }{ Locale.ENGLISH }
if (query == null) {
query = dir.dir.hasFile{ it.name =~ /Season/ && it.isDirectory() } ? dir.dir.name : dir.name
}
log.finest "$dir => Search by $query"
def options = TheTVDB.search(query, locale)
if (options.isEmpty()) {
log.warning "TV Series not found: $query"
return
}
// sort by relevance
options = options.sortBySimilarity(query, { it.name })
// auto-select series
def series = options[0]
// maybe require user input
if (options.size() > 1 && _args.strict) {
series = showInputDialog(options, query, 'Select TV Show:')
}
if (series == null) {
return null
}
// auto-detect structure
def seriesDir = [dir.dir, dir].sortBySimilarity(series.name, { it.name })[0]
def season = sxe && sxe.season > 0 ? sxe.season : 1
log.fine "$dir => $series"
tryLogCatch {
fetchSeriesArtworkAndNfo(seriesDir, dir, series.id, season, false, locale)
}
}remember to put your files like so "Cheers\Season 04\Cheers.S04E10.mkv" to get all the fanart
-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
I see, gonna wait for stable release then...fireheart2008 wrote: 22 Sep 2017, 13:47i have downloaded thisrednoah wrote: 20 Sep 2017, 04:42 I see. TheTVDB issue has been fixed with the latest revision. You can try the latest jar, or wait for the next stable release.
from https://get.filebot.net/filebot/latest/ ... jar.xz.gpg
but the issue still the same
viewtopic.php?f=6&t=5347
and when i renamed FileBot.jar.xz.gpg to replace FileBot.jar => not working
i seem to be unable to know how to get that beta FileBot 4.7.12 or .13 , there is no download link other than whatever i downloaded
not even here [ https://sourceforge.net/projects/filebot/files/filebot/]
btw i'm trying to do the same mod to my movie artwork downloader,
but i cant get it to work, any idea why?
Code: Select all
def override = _args.conflict == 'override'
import static groovy.json.StringEscapeUtils.*
/**
* XBMC helper functions
*/
def scanVideoLibrary(host, port) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""")
}
}
}
def showNotification(host, port, title, message, image) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"${escapeJavaScript(title)}","message":"${escapeJavaScript(message)}", "image":"${escapeJavaScript(image)}"},"id":1}""")
}
}
}
/**
/**
* TheMovieDB artwork/nfo helpers
*/
def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Artwork already exists: $outputFile"
return outputFile
}
// select and fetch artwork
def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale)
def selection = [locale.language, 'en', null].findResult{ lang -> artwork.find{ it.matches(lang) } }
if (selection == null) {
log.finest "Artwork not found: $outputFile"
return null
}
log.finest "Fetching $outputFile => $selection"
return selection.url.saveAs(outputFile)
}
def fetchAllMovieArtwork(outputFolder, prefix, movieInfo, category, override, locale) {
// select and fetch artwork
def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale)
def selection = [locale.language, 'en', null].findResults{ lang -> artwork.findAll{ it.matches(lang) } }.flatten().unique()
if (selection == null) {
log.finest "Artwork not found: $outputFolder"
return null
}
selection.eachWithIndex{ s, i ->
def outputFile = new File(outputFolder, "${prefix}${i+1}.jpg")
if (outputFile.exists() && !override) {
log.finest "Artwork already exists: $outputFile"
} else {
log.finest "Fetching $outputFile => $s"
s.url.saveAs(outputFile)
}
}
}
def fetchMovieFanart(outputFile, movieInfo, type, diskType, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Fanart already exists: $outputFile"
return outputFile
}
def artwork = FanartTV.getArtwork(movieInfo.id, "movies", locale)
def fanart = [locale, null].findResult{ lang -> artwork.find{ it.matches(type, diskType, lang) } }
if (fanart == null) {
log.finest "Fanart not found: $outputFile / $type"
return null
}
log.finest "Fetching $outputFile => $fanart"
return fanart.url.saveAs(outputFile)
}
def fetchMovieNfo(outputFile, movieInfo, movieFile, override) {
def i = movieInfo
"http://www.imdb.com/title/tt${(i.imdbId ?: 0).pad(7)}"
.saveAs(outputFile)
}
def fetchMovieArtworkAndNfo(movieDir, movie, movieFile = null, extras = false, override = false, locale = Locale.ENGLISH) {
tryLogCatch {
def movieInfo = TheMovieDB.getMovieInfo(movie, locale, true)
// fetch nfo
fetchMovieNfo(movieDir.resolve('movie.nfo'), movieInfo, movieFile, override)
// fetch series banner, fanart, posters, etc
fetchMovieArtwork(movieDir.resolve('poster.jpg'), movieInfo, 'posters', override, locale)
fetchMovieArtwork(movieDir.resolve('fanart.jpg'), movieInfo, 'backdrops', override, locale)
}
}
def copyIfPossible(File src, File dst) {
if (src.exists() && !dst.exists()) {
src.copyAs(dst)
}
}
args.eachMediaFolder{ dir ->
// fetch only missing artwork by default
if (dir.hasFile{it.name == 'movie.nfo'} && dir.hasFile{it.name == 'poster.jpg'} && dir.hasFile{it.name == 'fanart.jpg'}) {
log.finest "Skipping $dir"
return
}
def videos = dir.listFiles{ it.isVideo() } as List
def query = _args.query
def options = []
def locale = any{ _args.language.locale }{ Locale.ENGLISH }
if (query) {
// manual search & sort by relevance
options = TheMovieDB.searchMovie(query, locale).sortBySimilarity(query, { it.name })
} else if (videos?.size() > 0) {
// run movie auto-detection for video files
options = MediaDetection.detectMovie(videos[0], TheMovieDB, locale, true)
}
if (options.isEmpty()) {
log.finest "$dir => movie not found"
return
}
// auto-select movie
def movie = options[0]
// maybe require user input
if (options.size() > 1 && !_args.Strict) {
movie = showInputDialog(options, query, 'Please select Movie:')
}
if (movie == null)
{return null
}
log.fine "$dir => $movie"
tryLogCatch {
fetchMovieArtworkAndNfo(dir, movie, false, override, locale)
}
}C:\>filebot -script movieartwork.groovy "N:\temp\complete\movie\"
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <"> at index
22: N:\temp\complete\movie" (N:\temp\complete\movie")
Bad script source: movieartwork.groovy
Failure (°_°)
Re: webservice.fanart.tv sending back 0 bytes
I just replaced the main part from here:
https://raw.githubusercontent.com/fileb ... mdb.groovy
https://raw.githubusercontent.com/fileb ... mdb.groovy
Code: Select all
def override = _args.conflict == 'override'
import static groovy.json.StringEscapeUtils.*
/**
* XBMC helper functions
*/
def scanVideoLibrary(host, port) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""")
}
}
}
def showNotification(host, port, title, message, image) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"${escapeJavaScript(title)}","message":"${escapeJavaScript(message)}", "image":"${escapeJavaScript(image)}"},"id":1}""")
}
}
}
/**
/**
* TheMovieDB artwork/nfo helpers
*/
def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Artwork already exists: $outputFile"
return outputFile
}
// select and fetch artwork
def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale)
def selection = [locale.language, 'en', null].findResult{ lang -> artwork.find{ it.matches(lang) } }
if (selection == null) {
log.finest "Artwork not found: $outputFile"
return null
}
log.finest "Fetching $outputFile => $selection"
return selection.url.saveAs(outputFile)
}
def fetchAllMovieArtwork(outputFolder, prefix, movieInfo, category, override, locale) {
// select and fetch artwork
def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale)
def selection = [locale.language, 'en', null].findResults{ lang -> artwork.findAll{ it.matches(lang) } }.flatten().unique()
if (selection == null) {
log.finest "Artwork not found: $outputFolder"
return null
}
selection.eachWithIndex{ s, i ->
def outputFile = new File(outputFolder, "${prefix}${i+1}.jpg")
if (outputFile.exists() && !override) {
log.finest "Artwork already exists: $outputFile"
} else {
log.finest "Fetching $outputFile => $s"
s.url.saveAs(outputFile)
}
}
}
def fetchMovieFanart(outputFile, movieInfo, type, diskType, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Fanart already exists: $outputFile"
return outputFile
}
def artwork = FanartTV.getArtwork(movieInfo.id, "movies", locale)
def fanart = [locale, null].findResult{ lang -> artwork.find{ it.matches(type, diskType, lang) } }
if (fanart == null) {
log.finest "Fanart not found: $outputFile / $type"
return null
}
log.finest "Fetching $outputFile => $fanart"
return fanart.url.saveAs(outputFile)
}
def fetchMovieNfo(outputFile, movieInfo, movieFile, override) {
def i = movieInfo
"http://www.imdb.com/title/tt${(i.imdbId ?: 0).pad(7)}"
.saveAs(outputFile)
}
def fetchMovieArtworkAndNfo(movieDir, movie, movieFile = null, extras = false, override = false, locale = Locale.ENGLISH) {
tryLogCatch {
def movieInfo = TheMovieDB.getMovieInfo(movie, locale, true)
// fetch nfo
fetchMovieNfo(movieDir.resolve('movie.nfo'), movieInfo, movieFile, override)
// fetch series banner, fanart, posters, etc
fetchMovieArtwork(movieDir.resolve('poster.jpg'), movieInfo, 'posters', override, locale)
fetchMovieArtwork(movieDir.resolve('fanart.jpg'), movieInfo, 'backdrops', override, locale)
}
}
def copyIfPossible(File src, File dst) {
if (src.exists() && !dst.exists()) {
src.copyAs(dst)
}
}
args.eachMediaFolder{ dir ->
// fetch only missing artwork by default
if (dir.hasFile{it.name == 'movie.nfo'} && dir.hasFile{it.name == 'poster.jpg'} && dir.hasFile{it.name == 'fanart.jpg'}) {
log.finest "Skipping $dir"
return
}
def videos = dir.listFiles{ it.isVideo() }
def query = _args.query
def locale = any{ _args.language.locale }{ Locale.ENGLISH }
def options = []
if (query) {
// manual search & sort by relevance
options = TheMovieDB.searchMovie(query, locale).sortBySimilarity(query, { it.name })
} else if (videos.size() > 0) {
// run movie auto-detection for video files
options = MediaDetection.detectMovie(videos[0], TheMovieDB, locale, true)
}
if (options.isEmpty()) {
log.warning "$dir ${videos.name} => movie not found"
return
}
// auto-select movie
def movie = options[0]
// maybe require user input
if (options.size() > 1 && _args.strict) {
movie = showInputDialog(options, dir.name, 'Select Movie:')
}
if (movie == null) {
return null
}
log.fine "$dir => $movie"
tryLogCatch {
fetchMovieArtworkAndNfo(dir, movie, dir.getFiles{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }, extras, false, locale)
}
}-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
Sorry for the late reply.kim wrote: 23 Sep 2017, 15:15 I just replaced the main part from here:
https://raw.githubusercontent.com/fileb ... mdb.groovy
Code: Select all
def override = _args.conflict == 'override' import static groovy.json.StringEscapeUtils.* /** * XBMC helper functions */ def scanVideoLibrary(host, port) { tryLogCatch { telnet(host, port) { writer, reader -> writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""") } } } def showNotification(host, port, title, message, image) { tryLogCatch { telnet(host, port) { writer, reader -> writer.println("""{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"${escapeJavaScript(title)}","message":"${escapeJavaScript(message)}", "image":"${escapeJavaScript(image)}"},"id":1}""") } } } /** /** * TheMovieDB artwork/nfo helpers */ def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) { if (outputFile.exists() && !override) { log.finest "Artwork already exists: $outputFile" return outputFile } // select and fetch artwork def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale) def selection = [locale.language, 'en', null].findResult{ lang -> artwork.find{ it.matches(lang) } } if (selection == null) { log.finest "Artwork not found: $outputFile" return null } log.finest "Fetching $outputFile => $selection" return selection.url.saveAs(outputFile) } def fetchAllMovieArtwork(outputFolder, prefix, movieInfo, category, override, locale) { // select and fetch artwork def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale) def selection = [locale.language, 'en', null].findResults{ lang -> artwork.findAll{ it.matches(lang) } }.flatten().unique() if (selection == null) { log.finest "Artwork not found: $outputFolder" return null } selection.eachWithIndex{ s, i -> def outputFile = new File(outputFolder, "${prefix}${i+1}.jpg") if (outputFile.exists() && !override) { log.finest "Artwork already exists: $outputFile" } else { log.finest "Fetching $outputFile => $s" s.url.saveAs(outputFile) } } } def fetchMovieFanart(outputFile, movieInfo, type, diskType, override, locale) { if (outputFile.exists() && !override) { log.finest "Fanart already exists: $outputFile" return outputFile } def artwork = FanartTV.getArtwork(movieInfo.id, "movies", locale) def fanart = [locale, null].findResult{ lang -> artwork.find{ it.matches(type, diskType, lang) } } if (fanart == null) { log.finest "Fanart not found: $outputFile / $type" return null } log.finest "Fetching $outputFile => $fanart" return fanart.url.saveAs(outputFile) } def fetchMovieNfo(outputFile, movieInfo, movieFile, override) { def i = movieInfo "http://www.imdb.com/title/tt${(i.imdbId ?: 0).pad(7)}" .saveAs(outputFile) } def fetchMovieArtworkAndNfo(movieDir, movie, movieFile = null, extras = false, override = false, locale = Locale.ENGLISH) { tryLogCatch { def movieInfo = TheMovieDB.getMovieInfo(movie, locale, true) // fetch nfo fetchMovieNfo(movieDir.resolve('movie.nfo'), movieInfo, movieFile, override) // fetch series banner, fanart, posters, etc fetchMovieArtwork(movieDir.resolve('poster.jpg'), movieInfo, 'posters', override, locale) fetchMovieArtwork(movieDir.resolve('fanart.jpg'), movieInfo, 'backdrops', override, locale) } } def copyIfPossible(File src, File dst) { if (src.exists() && !dst.exists()) { src.copyAs(dst) } } args.eachMediaFolder{ dir -> // fetch only missing artwork by default if (dir.hasFile{it.name == 'movie.nfo'} && dir.hasFile{it.name == 'poster.jpg'} && dir.hasFile{it.name == 'fanart.jpg'}) { log.finest "Skipping $dir" return } def videos = dir.listFiles{ it.isVideo() } def query = _args.query def locale = any{ _args.language.locale }{ Locale.ENGLISH } def options = [] if (query) { // manual search & sort by relevance options = TheMovieDB.searchMovie(query, locale).sortBySimilarity(query, { it.name }) } else if (videos.size() > 0) { // run movie auto-detection for video files options = MediaDetection.detectMovie(videos[0], TheMovieDB, locale, true) } if (options.isEmpty()) { log.warning "$dir ${videos.name} => movie not found" return } // auto-select movie def movie = options[0] // maybe require user input if (options.size() > 1 && _args.strict) { movie = showInputDialog(options, dir.name, 'Select Movie:') } if (movie == null) { return null } log.fine "$dir => $movie" tryLogCatch { fetchMovieArtworkAndNfo(dir, movie, dir.getFiles{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }, extras, false, locale) } }
i decided to downgrade to 4.7.5 with my existing script, it used to work
but now imdb wont return posters for movie type,
So i tried your script with 4.7.9
but it returns
Code: Select all
N:\temp>filebot -script movieartwork.groovy N:\temp\complete\movie\
N:\temp\complete\movie\Mom (2017) 720p HDTV => Mom (2017)
MissingPropertyException: No such property: extras for class: Script1
N:\temp\complete\movie\Nobody Knows (2004) 1080p BDRip => Nobody Knows (2004)
MissingPropertyException: No such property: extras for class: Script1
Skipping N:\temp\complete\movie\radarr\Be.Afraid.2017.DVDRip.x264-SPOOKS[rarbg]
Skipping N:\temp\complete\movie\radarr\Critters.2.1988.1080p.AMZN.WEBRip.DDP2.0.
x264-monkee
Skipping N:\temp\complete\movie\radarr\My.Pet.Dinosaur.2017.720p.BluRay.x264-PFa
[rarbg]
Skipping N:\temp\complete\movie\radarr\Pressure.2015.720p.BluRay.x264-VETO[rarbg
]
Skipping N:\temp\complete\movie\radarr\Sniper.Ultimate.Kill.2017.720p.BluRay.x26
4.DTS-HDC
N:\temp\complete\movie\radarr\Stick.It.2006.1080p.AMZN.WEBRip.DDP5.1.x264-SiGMA
=> Stick It (2006)
MissingPropertyException: No such property: extras for class: Script1is there another alternative for fetching metadata from imdb and thetvdb?
Re: webservice.fanart.tv sending back 0 bytes
this was missing:
add to the top
imdb = NO API = NO filebot support aka YOU need to make/program it
btw: "extras" is from viewtopic.php?f=4&t=215 aka AMC... "--def extras=y Generate *.url files and fetch all available backdrops", but you deleted that part so you can just remove "extras" (fetchAllMovieArtwork and fetchMovieFanart is part of it) and if you don't use filebot to update Kodi/XBMC:
add to the top
Code: Select all
extras = tryQuietly{ extras.toBoolean() }Code: Select all
def override = _args.conflict == 'override'
import static groovy.json.StringEscapeUtils.*
extras = tryQuietly{ extras.toBoolean() }
/**
* XBMC helper functions
*/
def scanVideoLibrary(host, port) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""")
}
}
}
def showNotification(host, port, title, message, image) {
tryLogCatch {
telnet(host, port) { writer, reader ->
writer.println("""{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"${escapeJavaScript(title)}","message":"${escapeJavaScript(message)}", "image":"${escapeJavaScript(image)}"},"id":1}""")
}
}
}
/**
/**
* TheMovieDB artwork/nfo helpers
*/
def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Artwork already exists: $outputFile"
return outputFile
}
// select and fetch artwork
def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale)
def selection = [locale.language, 'en', null].findResult{ lang -> artwork.find{ it.matches(lang) } }
if (selection == null) {
log.finest "Artwork not found: $outputFile"
return null
}
log.finest "Fetching $outputFile => $selection"
return selection.url.saveAs(outputFile)
}
def fetchAllMovieArtwork(outputFolder, prefix, movieInfo, category, override, locale) {
// select and fetch artwork
def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale)
def selection = [locale.language, 'en', null].findResults{ lang -> artwork.findAll{ it.matches(lang) } }.flatten().unique()
if (selection == null) {
log.finest "Artwork not found: $outputFolder"
return null
}
selection.eachWithIndex{ s, i ->
def outputFile = new File(outputFolder, "${prefix}${i+1}.jpg")
if (outputFile.exists() && !override) {
log.finest "Artwork already exists: $outputFile"
} else {
log.finest "Fetching $outputFile => $s"
s.url.saveAs(outputFile)
}
}
}
def fetchMovieFanart(outputFile, movieInfo, type, diskType, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Fanart already exists: $outputFile"
return outputFile
}
def artwork = FanartTV.getArtwork(movieInfo.id, "movies", locale)
def fanart = [locale, null].findResult{ lang -> artwork.find{ it.matches(type, diskType, lang) } }
if (fanart == null) {
log.finest "Fanart not found: $outputFile / $type"
return null
}
log.finest "Fetching $outputFile => $fanart"
return fanart.url.saveAs(outputFile)
}
def fetchMovieNfo(outputFile, movieInfo, movieFile, override) {
def i = movieInfo
"http://www.imdb.com/title/tt${(i.imdbId ?: 0).pad(7)}"
.saveAs(outputFile)
}
def fetchMovieArtworkAndNfo(movieDir, movie, movieFile = null, extras = false, override = false, locale = Locale.ENGLISH) {
tryLogCatch {
def movieInfo = TheMovieDB.getMovieInfo(movie, locale, true)
// fetch nfo
fetchMovieNfo(movieDir.resolve('movie.nfo'), movieInfo, movieFile, override)
// fetch series banner, fanart, posters, etc
fetchMovieArtwork(movieDir.resolve('poster.jpg'), movieInfo, 'posters', override, locale)
fetchMovieArtwork(movieDir.resolve('fanart.jpg'), movieInfo, 'backdrops', override, locale)
}
}
def copyIfPossible(File src, File dst) {
if (src.exists() && !dst.exists()) {
src.copyAs(dst)
}
}
args.eachMediaFolder{ dir ->
// fetch only missing artwork by default
if (dir.hasFile{it.name == 'movie.nfo'} && dir.hasFile{it.name == 'poster.jpg'} && dir.hasFile{it.name == 'fanart.jpg'}) {
log.finest "Skipping $dir"
return
}
def videos = dir.listFiles{ it.isVideo() }
def query = _args.query
def locale = any{ _args.language.locale }{ Locale.ENGLISH }
def options = []
if (query) {
// manual search & sort by relevance
options = TheMovieDB.searchMovie(query, locale).sortBySimilarity(query, { it.name })
} else if (videos.size() > 0) {
// run movie auto-detection for video files
options = MediaDetection.detectMovie(videos[0], TheMovieDB, locale, true)
}
if (options.isEmpty()) {
log.warning "$dir ${videos.name} => movie not found"
return
}
// auto-select movie
def movie = options[0]
// maybe require user input
if (options.size() > 1 && _args.strict) {
movie = showInputDialog(options, dir.name, 'Select Movie:')
}
if (movie == null) {
return null
}
log.fine "$dir => $movie"
tryLogCatch {
fetchMovieArtworkAndNfo(dir, movie, dir.getFiles{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }, extras, false, locale)
}
}thetvdb = ONLY TV stuffis there another alternative for fetching metadata from imdb and thetvdb?
imdb = NO API = NO filebot support aka YOU need to make/program it
btw: "extras" is from viewtopic.php?f=4&t=215 aka AMC... "--def extras=y Generate *.url files and fetch all available backdrops", but you deleted that part so you can just remove "extras" (fetchAllMovieArtwork and fetchMovieFanart is part of it) and if you don't use filebot to update Kodi/XBMC:
Code: Select all
def override = _args.conflict == 'override'
import static groovy.json.StringEscapeUtils.*
/**
* TheMovieDB artwork/nfo helpers
*/
def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Artwork already exists: $outputFile"
return outputFile
}
// select and fetch artwork
def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale)
def selection = [locale.language, 'en', null].findResult{ lang -> artwork.find{ it.matches(lang) } }
if (selection == null) {
log.finest "Artwork not found: $outputFile"
return null
}
log.finest "Fetching $outputFile => $selection"
return selection.url.saveAs(outputFile)
}
def fetchMovieNfo(outputFile, movieInfo, movieFile, override) {
def i = movieInfo
"http://www.imdb.com/title/tt${(i.imdbId ?: 0).pad(7)}"
.saveAs(outputFile)
}
def fetchMovieArtworkAndNfo(movieDir, movie, movieFile = null, override = false, locale = Locale.ENGLISH) {
tryLogCatch {
def movieInfo = TheMovieDB.getMovieInfo(movie, locale, true)
// fetch nfo
fetchMovieNfo(movieDir.resolve('movie.nfo'), movieInfo, movieFile, override)
// fetch series banner, fanart, posters, etc
fetchMovieArtwork(movieDir.resolve('poster.jpg'), movieInfo, 'posters', override, locale)
fetchMovieArtwork(movieDir.resolve('fanart.jpg'), movieInfo, 'backdrops', override, locale)
}
}
def copyIfPossible(File src, File dst) {
if (src.exists() && !dst.exists()) {
src.copyAs(dst)
}
}
args.eachMediaFolder{ dir ->
// fetch only missing artwork by default
if (dir.hasFile{it.name == 'movie.nfo'} && dir.hasFile{it.name == 'poster.jpg'} && dir.hasFile{it.name == 'fanart.jpg'}) {
log.finest "Skipping $dir"
return
}
def videos = dir.listFiles{ it.isVideo() }
def query = _args.query
def locale = any{ _args.language.locale }{ Locale.ENGLISH }
def options = []
if (query) {
// manual search & sort by relevance
options = TheMovieDB.searchMovie(query, locale).sortBySimilarity(query, { it.name })
} else if (videos.size() > 0) {
// run movie auto-detection for video files
options = MediaDetection.detectMovie(videos[0], TheMovieDB, locale, true)
}
if (options.isEmpty()) {
log.warning "$dir ${videos.name} => movie not found"
return
}
// auto-select movie
def movie = options[0]
// maybe require user input
if (options.size() > 1 && _args.strict) {
movie = showInputDialog(options, dir.name, 'Select Movie:')
}
if (movie == null) {
return null
}
log.fine "$dir => $movie"
tryLogCatch {
fetchMovieArtworkAndNfo(dir, movie, dir.getFiles{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }, false, locale)
}
}
Last edited by kim on 17 Oct 2017, 16:46, edited 1 time in total.
Re: webservice.fanart.tv sending back 0 bytes
If you want more "metadata", you can add (put back) this part:
https://github.com/filebot/scripts/blob ... roovy#L247
remember to remove ", override" from here:
but put it all together:
https://github.com/filebot/scripts/blob ... roovy#L247
Code: Select all
def fetchMovieNfo(outputFile, i, movieFile) {
log.finest "Generate Movie NFO: $i.name [$i.id]"
def mi = tryLogCatch{ movieFile ? MediaInfo.snapshot(movieFile) : null }
def xml = XML {
movie {
title(i.name)
originaltitle(i.originalName)
sorttitle([i.collection, i.name, i.released as String].findAll{ it?.length() > 0 }.findResults{ it.sortName('$2') }.join(' :: '))
set(i.collection)
year(i.released?.year)
rating(i.rating)
votes(i.votes)
mpaa(i.certification)
id('tt' + (i.imdbId ?: 0).pad(7))
plot(i.overview)
tagline(i.tagline)
runtime(i.runtime)
i.genres.each{
genre(it)
}
i.productionCountries.each{
country(it)
}
i.productionCompanies.each{
studio(it)
}
i.people.each{ p ->
if (p.director) {
director(p.name)
} else if (p.writer) {
credits(p.name)
} else if (p.actor) {
actor {
name(p.name)
role(p.character)
}
} else if (p.department == 'Writing') {
credits("$p.name ($p.job)")
}
}
fileinfo {
streamdetails {
mi?.each { kind, streams ->
def section = kind.toString().toLowerCase()
streams.each { s ->
if (section == 'video') {
video {
codec((s.'Encoded_Library/Name' ?: s.'CodecID/Hint' ?: s.'Format').replaceAll(/[ ].+/, '').trim())
aspect(s.'DisplayAspectRatio')
width(s.'Width')
height(s.'Height')
}
}
if (section == 'audio') {
audio {
codec((s.'CodecID/Hint' ?: s.'Format').replaceAll(/\p{Punct}/, '').trim())
language(s.'Language/String3')
channels(s.'Channel(s)_Original' ?: s.'Channel(s)')
}
}
if (section == 'text') {
subtitle { language(s.'Language/String3') }
}
}
}
}
}
imdb(id:"tt" + (i.imdbId ?: 0).pad(7), "http://www.imdb.com/title/tt" + (i.imdbId ?: 0).pad(7))
tmdb(id:i.id, "http://www.themoviedb.org/movie/${i.id}")
/** <trailer> element not supported due to lack of specification on acceptable values for both Plex and Kodi **/
}
}
xml.saveAs(outputFile)
}Code: Select all
// fetch nfo
fetchMovieNfo(movieDir.resolve('movie.nfo'), movieInfo, movieFile, override)Code: Select all
def override = _args.conflict == 'override'
import static groovy.json.StringEscapeUtils.*
/**
* TheMovieDB artwork/nfo helpers
*/
def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) {
if (outputFile.exists() && !override) {
log.finest "Artwork already exists: $outputFile"
return outputFile
}
// select and fetch artwork
def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale)
def selection = [locale.language, 'en', null].findResult{ lang -> artwork.find{ it.matches(lang) } }
if (selection == null) {
log.finest "Artwork not found: $outputFile"
return null
}
log.finest "Fetching $outputFile => $selection"
return selection.url.saveAs(outputFile)
}
def fetchMovieNfo(outputFile, i, movieFile) {
log.finest "Generate Movie NFO: $i.name [$i.id]"
def mi = tryLogCatch{ movieFile ? MediaInfo.snapshot(movieFile) : null }
def xml = XML {
movie {
title(i.name)
originaltitle(i.originalName)
sorttitle([i.collection, i.name, i.released as String].findAll{ it?.length() > 0 }.findResults{ it.sortName('$2') }.join(' :: '))
set(i.collection)
year(i.released?.year)
rating(i.rating)
votes(i.votes)
mpaa(i.certification)
id('tt' + (i.imdbId ?: 0).pad(7))
plot(i.overview)
tagline(i.tagline)
runtime(i.runtime)
i.genres.each{
genre(it)
}
i.productionCountries.each{
country(it)
}
i.productionCompanies.each{
studio(it)
}
i.people.each{ p ->
if (p.director) {
director(p.name)
} else if (p.writer) {
credits(p.name)
} else if (p.actor) {
actor {
name(p.name)
role(p.character)
}
} else if (p.department == 'Writing') {
credits("$p.name ($p.job)")
}
}
fileinfo {
streamdetails {
mi?.each { kind, streams ->
def section = kind.toString().toLowerCase()
streams.each { s ->
if (section == 'video') {
video {
codec((s.'Encoded_Library/Name' ?: s.'CodecID/Hint' ?: s.'Format').replaceAll(/[ ].+/, '').trim())
aspect(s.'DisplayAspectRatio')
width(s.'Width')
height(s.'Height')
}
}
if (section == 'audio') {
audio {
codec((s.'CodecID/Hint' ?: s.'Format').replaceAll(/\p{Punct}/, '').trim())
language(s.'Language/String3')
channels(s.'Channel(s)_Original' ?: s.'Channel(s)')
}
}
if (section == 'text') {
subtitle { language(s.'Language/String3') }
}
}
}
}
}
imdb(id:"tt" + (i.imdbId ?: 0).pad(7), "http://www.imdb.com/title/tt" + (i.imdbId ?: 0).pad(7))
tmdb(id:i.id, "http://www.themoviedb.org/movie/${i.id}")
}
}
xml.saveAs(outputFile)
}
def fetchMovieArtworkAndNfo(movieDir, movie, movieFile = null, override = false, locale = Locale.ENGLISH) {
log.finest "movieFile: ${movieFile?.isFile()}"
tryLogCatch {
def movieInfo = TheMovieDB.getMovieInfo(movie, locale, true)
// fetch nfo
fetchMovieNfo(movieDir.resolve('movie.nfo'), movieInfo, movieFile)
// fetch series banner, fanart, posters, etc
fetchMovieArtwork(movieDir.resolve('poster.jpg'), movieInfo, 'posters', override, locale)
fetchMovieArtwork(movieDir.resolve('fanart.jpg'), movieInfo, 'backdrops', override, locale)
}
}
def copyIfPossible(File src, File dst) {
if (src.exists() && !dst.exists()) {
src.copyAs(dst)
}
}
args.eachMediaFolder{ dir ->
// fetch only missing artwork by default
if (dir.hasFile{it.name == 'movie.nfo'} && dir.hasFile{it.name == 'poster.jpg'} && dir.hasFile{it.name == 'fanart.jpg'}) {
log.finest "Skipping $dir"
return
}
def videos = dir.listFiles{ it.isVideo() }
def query = _args.query
def locale = any{ _args.language.locale }{ Locale.ENGLISH }
def options = []
if (query) {
// manual search & sort by relevance
options = TheMovieDB.searchMovie(query, locale).sortBySimilarity(query, { it.name })
} else if (videos.size() > 0) {
// run movie auto-detection for video files
options = MediaDetection.detectMovie(videos[0], TheMovieDB, locale, true)
}
if (options.isEmpty()) {
log.warning "$dir ${videos.name} => movie not found"
return
}
// auto-select movie
def movie = options[0]
// maybe require user input
if (options.size() > 1 && _args.strict) {
movie = showInputDialog(options, dir.name, 'Select Movie:')
}
if (movie == null) {
return null
}
log.fine "$dir => $movie"
tryLogCatch {
fetchMovieArtworkAndNfo(dir, movie, dir.getFiles{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }, false, locale)
}
}
Last edited by kim on 17 Oct 2017, 17:51, edited 1 time in total.
Re: webservice.fanart.tv sending back 0 bytes
I'm lost here. What exactly is needed to fix these issues with 4.7.11 and amc.groovy? I'm tired of getting zero byte image files. I'd used 4.7.13, except it errors out with a JNA dependency not being met.
Re: webservice.fanart.tv sending back 0 bytes
@zang if you have 4.7.13 then use it
the JNA problem, try downloading the files from here:
https://github.com/filebot/filebot/tree ... lib/native
"FileBot -script fn:sysinfo"
what is your output ?
the JNA problem, try downloading the files from here:
https://github.com/filebot/filebot/tree ... lib/native
"FileBot -script fn:sysinfo"
what is your output ?
-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
when will filebot get updated @rednoah?
the latest stable (r4984) now wont fetch images for movie as well..
the latest stable (r4984) now wont fetch images for movie as well..
Re: webservice.fanart.tv sending back 0 bytes
"the latest stable (r4984) now wont fetch images for movie as well.."
No problem here, so... ?
No problem here, so... ?
Re: webservice.fanart.tv sending back 0 bytes
Please keep me posted on the movie poster issue, and make sure I include logs, so this can be fixed as part of the next release as well.
-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
So is this a connection issue?
Code: Select all
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\Administrator>N:\temp\complete\movie\movie.bat
C:\Users\Administrator>filebot -script fn:artwork.tmdb N:\temp\complete\movie
^CTerminate batch job (Y/N)? y
C:\Users\Administrator>N:\temp\complete\movie\movie.bat
C:\Users\Administrator>filebot -script fn:artwork.tmdb N:\temp\complete\movie
N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRip.x264.AAC.-.Hon3y
=> Bareilly Ki Barfi (2017)
Generate Movie NFO: Bareilly Ki Barfi [467106]
Fetching N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRip.x264.AA
C.-.Hon3y\poster.jpg => [posters/1000x1500, http://image.tmdb.org/t/p/original/3
gGkq074z56JfXRBIQv5M043em2.jpg]
SocketTimeoutException: connect timed out
N:\temp\complete\movie\Jagga.Jasoos.2017.Hindi.720p.DvDRip.x264.AAC.-.Hon3y => J
agga Jasoos (2017)
Generate Movie NFO: Jagga Jasoos [401285]
Fetching N:\temp\complete\movie\Jagga.Jasoos.2017.Hindi.720p.DvDRip.x264.AAC.-.H
on3y\poster.jpg => [posters/1000x1500, hi, http://image.tmdb.org/t/p/original/aA
vF8e5w4xETbx8TUesCnVFJqSF.jpg]
Fetching N:\temp\complete\movie\Jagga.Jasoos.2017.Hindi.720p.DvDRip.x264.AAC.-.H
on3y\fanart.jpg => [backdrops/1280x720, en, http://image.tmdb.org/t/p/original/1
jc8XbdhHVP9E2QuRDSSrj2IoTc.jpg]
Resource not found: http://webservice.fanart.tv/v3/movies/401285?api_key=780b986
b22c35e6f7a134a2f392c2deb
Fanart not found: N:\temp\complete\movie\Jagga.Jasoos.2017.Hindi.720p.DvDRip.x26
4.AAC.-.Hon3y\clearart.png / hdmovieclearart
Fanart not found: N:\temp\complete\movie\Jagga.Jasoos.2017.Hindi.720p.DvDRip.x26
4.AAC.-.Hon3y\clearart.png / movieart
Fanart not found: N:\temp\complete\movie\Jagga.Jasoos.2017.Hindi.720p.DvDRip.x26
4.AAC.-.Hon3y\logo.png / hdmovielogo
Fanart not found: N:\temp\complete\movie\Jagga.Jasoos.2017.Hindi.720p.DvDRip.x26
4.AAC.-.Hon3y\logo.png / movielogo
Fanart not found: N:\temp\complete\movie\Jagga.Jasoos.2017.Hindi.720p.DvDRip.x26
4.AAC.-.Hon3y\disc.png / moviedisc
Fanart not found: N:\temp\complete\movie\Jagga.Jasoos.2017.Hindi.720p.DvDRip.x26
4.AAC.-.Hon3y\disc.png / moviedisc
Fanart not found: N:\temp\complete\movie\Jagga.Jasoos.2017.Hindi.720p.DvDRip.x26
4.AAC.-.Hon3y\disc.png / moviedisc
N:\temp\complete\movie\radarr\Hayride.2.2015.1080p.NF.WEBRip.DD5.1.x264-QOQ => H
ayride 2 (2015)
Generate Movie NFO: Hayride 2 [322163]
Fetching N:\temp\complete\movie\radarr\Hayride.2.2015.1080p.NF.WEBRip.DD5.1.x264
-QOQ\poster.jpg => [posters/2000x3000, en, http://image.tmdb.org/t/p/original/rf
jdK4JijwMHew3Jtac3ARKJlho.jpg]
Fetching N:\temp\complete\movie\radarr\Hayride.2.2015.1080p.NF.WEBRip.DD5.1.x264
-QOQ\fanart.jpg => [backdrops/1280x720, http://image.tmdb.org/t/p/original/xg6VY
4g56k3BMFEdTkFkmRM8Auy.jpg]
Resource not found: http://webservice.fanart.tv/v3/movies/322163?api_key=780b986
b22c35e6f7a134a2f392c2deb
Fanart not found: N:\temp\complete\movie\radarr\Hayride.2.2015.1080p.NF.WEBRip.D
D5.1.x264-QOQ\clearart.png / hdmovieclearart
Fanart not found: N:\temp\complete\movie\radarr\Hayride.2.2015.1080p.NF.WEBRip.D
D5.1.x264-QOQ\clearart.png / movieart
Fanart not found: N:\temp\complete\movie\radarr\Hayride.2.2015.1080p.NF.WEBRip.D
D5.1.x264-QOQ\logo.png / hdmovielogo
Fanart not found: N:\temp\complete\movie\radarr\Hayride.2.2015.1080p.NF.WEBRip.D
D5.1.x264-QOQ\logo.png / movielogo
Fanart not found: N:\temp\complete\movie\radarr\Hayride.2.2015.1080p.NF.WEBRip.D
D5.1.x264-QOQ\disc.png / moviedisc
Fanart not found: N:\temp\complete\movie\radarr\Hayride.2.2015.1080p.NF.WEBRip.D
D5.1.x264-QOQ\disc.png / moviedisc
Fanart not found: N:\temp\complete\movie\radarr\Hayride.2.2015.1080p.NF.WEBRip.D
D5.1.x264-QOQ\disc.png / moviedisc
N:\temp\complete\movie\tv-sonarr => The Exorcist (1973)
Generate Movie NFO: The Exorcist [9552]
Fetching N:\temp\complete\movie\tv-sonarr\poster.jpg => [posters/667x1000, en, h
ttp://image.tmdb.org/t/p/original/mBLSuXTAJExUFdqYFgZro7Y9ZDG.jpg]
Fetching N:\temp\complete\movie\tv-sonarr\fanart.jpg => [backdrops/1920x1080, en
, http://image.tmdb.org/t/p/original/9yatuqrO7f1gy1an6H3gOV3lJf6.jpg]
Fanart not found: N:\temp\complete\movie\tv-sonarr\clearart.png / hdmovieclearar
t
Fetching N:\temp\complete\movie\tv-sonarr\clearart.png => [movieart, en, 6.0, ht
tps://assets.fanart.tv/fanart/movies/9552/movieart/the-exorcist-4f0ac12e07e9c.pn
g]
Fetching N:\temp\complete\movie\tv-sonarr\logo.png => [hdmovielogo, en, 10.0, ht
tps://assets.fanart.tv/fanart/movies/9552/hdmovielogo/the-exorcist-5561fb4aa016a
.png]
Fetching N:\temp\complete\movie\tv-sonarr\disc.png => [moviedisc/bluray, en, 9.0
, https://assets.fanart.tv/fanart/movies/9552/moviedisc/the-exorcist-512bf653b4e
60.png]
Done ?(?????)?
C:\Users\Administrator>Re: webservice.fanart.tv sending back 0 bytes
If you are referring to this, then yes, that's a network issue where the server was not reachable for some reason at the time:
Code: Select all
SocketTimeoutException: connect timed out-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
Tested it again, now im getting this "resource not found"rednoah wrote: 24 Oct 2017, 00:31 If you are referring to this, then yes, that's a network issue where the server was not reachable for some reason at the time:Code: Select all
SocketTimeoutException: connect timed out
Also, i was able to open the image links from my browser just fine
Code: Select all
N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRip.x264.AAC.-.Hon3y
=> Bareilly Ki Barfi (2017)
Generate Movie NFO: Bareilly Ki Barfi [467106]
Fetching N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRip.x264.AA
C.-.Hon3y\poster.jpg => [posters/1000x1500, http://image.tmdb.org/t/p/original/3
gGkq074z56JfXRBIQv5M043em2.jpg]
Fetching N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRip.x264.AA
C.-.Hon3y\fanart.jpg => [backdrops/1600x900, http://image.tmdb.org/t/p/original/
tgROuWt06yveuTHpTYUhSCAbqK1.jpg]
[b]Resource not found: http://webservice.fanart.tv/v3/movies/467106?api_key=780b986
b22c35e6f7a134a2f392c1deb[/b]
Fanart not found: N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRi
p.x264.AAC.-.Hon3y\clearart.png / hdmovieclearart
Fanart not found: N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRi
p.x264.AAC.-.Hon3y\clearart.png / movieart
Fanart not found: N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRi
p.x264.AAC.-.Hon3y\logo.png / hdmovielogo
Fanart not found: N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRi
p.x264.AAC.-.Hon3y\logo.png / movielogo
Fanart not found: N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRi
p.x264.AAC.-.Hon3y\disc.png / moviedisc
Fanart not found: N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRi
p.x264.AAC.-.Hon3y\disc.png / moviedisc
Fanart not found: N:\temp\complete\movie\Bareilly.Ki.Barfi.2017.Hindi.720p.DvDRi
p.x264.AAC.-.Hon3y\disc.png / moviedisc-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
Sorry forgot to update, seems like the last time was a connection issue, would be great if we could add custom delay or something to keep retrying.
Anyways, only tvshow remains non functional now, please update it rednoah ..
thanks.
Anyways, only tvshow remains non functional now, please update it rednoah ..
thanks.
Re: webservice.fanart.tv sending back 0 bytes
FileBot 4.7.14 has been released and includes a fix for the 0 byte artwork issue among other things.
Re: webservice.fanart.tv sending back 0 bytes
it still say:
btw: will this ever get updated again ?
https://chocolatey.org/packages/filebot/
https://www.microsoft.com/en-us/store/p ... blggh52t9xVersion notes
Version number: 4.7.13.0
• Lots of minor optimizations and bug fixes
btw: will this ever get updated again ?
https://chocolatey.org/packages/filebot/
Re: webservice.fanart.tv sending back 0 bytes
1.
You might need to check for updates manually in the Microsoft Store app, otherwise you might not get updates immediately.
2.
Not planned. I see no advantage that chocolatey might have over the Microsoft Store (other than support for Windows 7/8).
You might need to check for updates manually in the Microsoft Store app, otherwise you might not get updates immediately.
2.
Not planned. I see no advantage that chocolatey might have over the Microsoft Store (other than support for Windows 7/8).
-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
Thanks! But the sourceforge is still older version, where do i get the newest one?
Re: webservice.fanart.tv sending back 0 bytes
It's an easy way (and free) way to get updates on any Windows (that has powershell installed)rednoah wrote: 31 Oct 2017, 21:59 2.
Not planned. I see no advantage that chocolatey might have over the Microsoft Store (other than support for Windows 7/8).
you can also install and get updates to java https://chocolatey.org/packages?q=java
"Chocolatey is a package manager for Windows (like apt-get or yum but for Windows)"
... but I get you wanna make money and do less work to update another site
the FAQ say something about "Linux/OSX" , so maybe it works there also ?
https://chocolatey.org/faqIs there a PowerShell Module for Chocolatey?
Not yet, but when/if there is it will be provided as a binary DLL.
Chocolatey itself is now a binary with 0.9.9+. This provides the ability to run it on Linux/OSX, which is why it is not by default a PowerShell module (*nix still doesn't really have PowerShell support).
-
denywinarto
- Donor
- Posts: 28
- Joined: 30 Jul 2013, 01:15
Re: webservice.fanart.tv sending back 0 bytes
Is there any classic version of this version?
Can't use windows apps on my win server..
Can't use windows apps on my win server..
Re: webservice.fanart.tv sending back 0 bytes
Unfortunately, if you can't use the Store, you're stuck with the legacy versions from SF for now.
Re: webservice.fanart.tv sending back 0 bytes
But introduces the issues as to why I could not run 4.7.13 on my Raspbian Raspberry Pi:rednoah wrote: 31 Oct 2017, 12:02 FileBot 4.7.14 has been released and includes a fix for the 0 byte artwork issue among other things.
Code: Select all
There is an incompatible JNA native library installed on this system
Expected: 5.2.0
Found: 5.1.0
/usr/share/filebot:/usr/share/filebot/lib/armv7l:/usr/java/packages/lib/arm:/lib:/usr/lib.
To resolve this issue you may do one of the following:
- remove or uninstall the offending library
- set the system property jna.nosys=true
- set jna.boot.library.path to include the path to the version of the
jnidispatch library included with the JNA jar file you are using
java.lang.Error:
There is an incompatible JNA native library installed on this system
Expected: 5.2.0
Found: 5.1.0
/usr/share/filebot:/usr/share/filebot/lib/armv7l:/usr/java/packages/lib/arm:/lib:/usr/lib.
To resolve this issue you may do one of the following:
- remove or uninstall the offending library
- set the system property jna.nosys=true
- set jna.boot.library.path to include the path to the version of the
jnidispatch library included with the JNA jar file you are using
at com.sun.jna.Native.<clinit>(Native.java:199)
at net.filebot.mediainfo.MediaInfoLibrary.<clinit>(MediaInfoLibrary.java:19)
at net.filebot.mediainfo.MediaInfo.<init>(MediaInfo.java:29)
at net.filebot.format.MediaBindingBean.lambda$getMediaInfo$31(MediaBindingBean.java:1181)
at net.filebot.format.MediaBindingBean.getMediaInfo(MediaBindingBean.java:1179)
at net.filebot.format.MediaBindingBean.lambda$null$7(MediaBindingBean.java:447)
at net.filebot.format.MediaBindingBean.lambda$getDimension$9(MediaBindingBean.java:447)
at net.filebot.format.MediaBindingBean.getDimension(MediaBindingBean.java:448)
at net.filebot.media.VideoQuality.getResolution(VideoQuality.java:42)
at net.filebot.media.VideoQuality.compare(VideoQuality.java:27)
at net.filebot.media.VideoQuality.compare(VideoQuality.java:15)
at net.filebot.media.VideoQuality.isBetter(VideoQuality.java:20)
at net.filebot.cli.CmdlineOperations.renameAll(CmdlineOperations.java:605)
at net.filebot.cli.CmdlineOperations.renameSeries(CmdlineOperations.java:246)
at net.filebot.cli.CmdlineOperations.rename(CmdlineOperations.java:96)
at net.filebot.cli.ScriptShellBaseClass.rename(ScriptShellBaseClass.java:346)
at Script1$_run_closure55.doCall(Script1.groovy:426)
at Script1.run(Script1.groovy:412)
at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:64)
at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:74)
at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:127)
at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:29)
at net.filebot.Main.main(Main.java:111)
Code: Select all
FileBot 4.7.14 (r5233)
JNA Native: java.lang.Error:
There is an incompatible JNA native library installed on this system
Expected: 5.2.0
Found: 5.1.0
/usr/share/filebot:/usr/share/filebot/lib/armv7l:/usr/java/packages/lib/arm:/lib:/usr/lib.
To resolve this issue you may do one of the following:
- remove or uninstall the offending library
- set the system property jna.nosys=true
- set jna.boot.library.path to include the path to the version of the
jnidispatch library included with the JNA jar file you are using
MediaInfo: net.filebot.mediainfo.MediaInfoException: Unable to load arm (32-bit) native library libmediainfo.so: Could not initialize class com.sun.jna.Native
Apache Commons VFS: [zip, rar]
Chromaprint: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-10-30 (r508)
Groovy: 2.4.12
JRE: Java(TM) SE Runtime Environment 1.8.0_144
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 4 Core / 235 MB Max Memory / 9 MB Used Memory
OS: Linux (arm)
Package: PORTABLE
uname: Linux cronpi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux