fn:artwork.tvdb stopped working

Running FileBot from the console, Groovy scripting, shell scripts, etc
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

fn:artwork.tvdb stopped working

Post by plittlefield »

I am getting an error on the artwork.tvdb script.

Code: Select all

$ filebot -script fn:artwork.tvdb /home/paully/Videos/TV/Penny\ Dreadful/

/home/paully/Videos/TV/Penny Dreadful => Search by Penny Dreadful
/home/paully/Videos/TV/Penny Dreadful => Penny Dreadful
Generate Series NFO: Penny Dreadful [265766]
No signature of method: net.filebot.WebServices$TheTVDBClientWithLocalSearch.getArtwork() is applicable for argument types: (net.filebot.web.SearchResult, java.lang.String, java.util.Locale) values: [Penny Dreadful, poster, en]
Possible solutions: getArtwork(int, java.lang.String, java.util.Locale), iterator()
groovy.lang.MissingMethodException: No signature of method: net.filebot.WebServices$TheTVDBClientWithLocalSearch.getArtwork() is applicable for argument types: (net.filebot.web.SearchResult, java.lang.String, java.util.Locale) values: [Penny Dreadful, poster, en]
Possible solutions: getArtwork(int, java.lang.String, java.util.Locale), iterator()
	at Script2.fetchSeriesBanner(Script2.groovy:72)
	at Script2$_fetchSeriesArtworkAndNfo_closure8$_closure24.doCall(Script2.groovy:131)
	at Script2$_fetchSeriesArtworkAndNfo_closure8.doCall(Script2.groovy:131)
	at Script2$_fetchSeriesArtworkAndNfo_closure8.doCall(Script2.groovy)
	at net.filebot.cli.ScriptShellBaseClass.tryLogCatch(ScriptShellBaseClass.java:127)
	at Script2.fetchSeriesArtworkAndNfo(Script2.groovy:125)
	at Script1$_run_closure1.doCall(Script1.groovy:46)
	at net.filebot.cli.ScriptShellMethods.eachMediaFolder(ScriptShellMethods.java:199)
	at Script1.run(Script1.groovy:7)
	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 ヾ(@⌒ー⌒@)ノ
I have also updated all my groovy scripts to the latest version from github.

Thanks in advance for your help.

Regards,

Paully

FileBot 4.7 (r3923)
JNA Native: 4.0.1
MediaInfo: MediaInfoLib - v0.7.69
7-Zip-JBinding: 9.20
Chromaprint: fpcalc version 1.1.0 (/usr/share/filebot/fpcalc)
Extended Attributes: OK
Groovy Engine: 2.4.6
JRE: Java(TM) SE Runtime Environment 1.8.0_91
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 4 Core / 3 GB Max Memory / 13 MB Used Memory
OS: Linux (amd64)
Package: DEB
Data: /home/paully/.filebot
uname: Linux mythbuntu-server3 3.13.0-86-generic #131-Ubuntu SMP Thu May 12 23:33:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: 4.7 ERROR: No signature of method: net.filebot.WebServic

Post by rednoah »

Fixed.

Please try dev:artwork.tvdb and see if it works.
:idea: Please read the FAQ and How to Request Help.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: fn:artwork.tvdb stopped working

Post by plittlefield »

You absolute star.

Code: Select all

$ filebot -script dev:artwork.tvdb --q "Penny Dreadful" /home/paully/Videos/TV/Penny\ Dreadful/
/home/paully/Videos/TV/Penny Dreadful => Search by Penny Dreadful
/home/paully/Videos/TV/Penny Dreadful => Penny Dreadful
Generate Series NFO: Penny Dreadful [265766]
Fetching /home/paully/Videos/TV/Penny Dreadful/poster.jpg => [poster/680x1000, en, 6.69, http://thetvdb.com/banners/posters/265766-11.jpg]
Fetching /home/paully/Videos/TV/Penny Dreadful/banner.jpg => [series/graphical, en, 9, http://thetvdb.com/banners/graphical/265766-g8.jpg]
Fetching /home/paully/Videos/TV/Penny Dreadful/fanart.jpg => [fanart/1920x1080, en, 8, http://thetvdb.com/banners/fanart/original/265766-25.jpg]
Fetching /home/paully/Videos/TV/Penny Dreadful/clearart.png => [hdclearart, en, 3, http://assets.fanart.tv/fanart/tv/265766/hdclearart/penny-dreadful-546a52c04edb5.png]
Fetching /home/paully/Videos/TV/Penny Dreadful/logo.png => [hdtvlogo, en, 9, http://assets.fanart.tv/fanart/tv/265766/hdtvlogo/penny-dreadful-52506451707a9.png]
Fetching /home/paully/Videos/TV/Penny Dreadful/landscape.jpg => [tvthumb, en, 3, http://assets.fanart.tv/fanart/tv/265766/tvthumb/penny-dreadful-53a746bc7601e.jpg]
Done ヾ(@⌒ー⌒@)ノ
OK, where do I donate?

Also, where can I get someone to code in the ability to a separate .nfo file for each episode, so that Serviio displays the folder properly?

Fantastic,

Paully
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: fn:artwork.tvdb stopped working

Post by rednoah »

People have asked for that from time to time. But I'm not inclined to implement (and maintain) support for per-episode nfo/artwork files.

Serviio probably has a way of fetching metadata itself somehow.
:idea: Please read the FAQ and How to Request Help.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: fn:artwork.tvdb stopped working

Post by plittlefield »

Yes, Serviio does have a few options, including Online Sources and XBMC .nfo Files.

Alas, I now have another problem where those TV shows without specific episode .nfo files... do not show up in the Serviio Library.

Movies are fine ofcourse, because they only have 1 movie.nfo for the 1 file.

TV Shows have the tvshow.nfo file, and can have episode.nfo files.

Hence, my offer of money for writing something for this... how long do you think it would take you? Do yo want to PM me?

Ho hum.

Paully
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

"But I'm not inclined to implement (and maintain) support for per-episode nfo/artwork files."
I can help with that


htpc:

Code: Select all

def fetchSeriesNfo(outputFile, i, override, locale, nfotype, tvshowFile, newSxE, SameNameAsTVshowThumb, EpisodeOrder, nSeason) {

	def ActorsJson = TheTVDB.requestJson("series/${i.id}/actors", locale, Cache.ONE_MONTH)

	def xml = XML {
		if (nfotype == 'tvshow') {
		log.fine "FROM htpc fetchSeriesNfo tvshow - Generate Series NFO: $i.name [$i.id]"
			tvshow {
				//ALL(i.dump()) // {localize.english.SeriesInfo.dump()}
				title(i.name) // {localize.english.SeriesInfo.name}
				sorttitle([i.name, i.startDate as String].findAll{ it?.length() > 0 }.findResults{ it.sortName('$2') }.join('::'))
				rating(i.rating) // {localize.english.SeriesInfo.rating}
				votes(i.ratingCount) // {localize.english.SeriesInfo.ratingCount}
				year(i.startDate?.year)
				airsday(i.airsDayOfWeek)
				airstime(i.airsTime)
				plot(i.overview)
				runtime(i.runtime)
				thumb(aspect:"banner", i.bannerUrl)
				// thumb(aspect:"poster", i.posterUrl)
				// thumb(aspect:"fanart", i.fanartUrl)
				mpaa(i.certification)
				episodeguide {
					url(cache:"${i.id}.xml", "http://www.thetvdb.com/api/1D62F2F90030C444/series/${i.id}/all/${locale.language}.zip")
				}
				id(i.id) // {localize.english.SeriesInfo.id}
				i.genres.each{ // {localize.english.SeriesInfo.genres}
					genre(it)
				}
				premiered(i.startDate)
				status(i.status) // {localize.english.SeriesInfo.status}
				studio(i.network) // {localize.english.SeriesInfo.network}
				ActorsJson.data.each{ a ->
					actor {
						name((a.name).toString().trim())
						role(a.role)
						order(a.sortOrder)
						if (a.image != '') {
							thumb("https://www.thetvdb.com/banners/${a.image}")
						}
					}
				}
				imdb(id:i.imdbId, "http://www.imdb.com/title/" + i.imdbId)
				tvdb(id:i.id, "http://www.thetvdb.com/?tab=series&id=${i.id}")
			}
		}
		if (nfotype == 'SameNameAsTVshow') {
			def mi = tryLogCatch{ tvshowFile ? MediaInfo.snapshot(tvshowFile) : null }

			log.fine "FROM htpc fetchSeriesNfo SameNameAsTVshow - EpisodeOrder: ${EpisodeOrder}"

			def eInfo = ''
			def EpisodesJson = []

			// --order [Airdate, Absolute, DVD] : Episode order
			if (newSxE =~ 'Special'){
				log.fine "FROM htpc fetchSeriesNfo Special - episodeID: $newSxE"
				eInfo = net.filebot.WebServices.TheTVDB.getEpisodeList(i.id, SortOrder.Airdate, locale).find{it =~ newSxE}
				log.fine "FROM htpc fetchSeriesNfo SameNameAsTVshow - eInfo: $eInfo"
				EpisodesJson = TheTVDB.requestJson("series/${i.id}/episodes/query?airedSeason=${nSeason}&airedEpisode=${eInfo.special}", locale, Cache.ONE_WEEK)
			}
			else if (EpisodeOrder == 'DVD'){
				eInfo = net.filebot.WebServices.TheTVDB.getEpisodeList(i.id, SortOrder.DVD, locale).find{it =~ newSxE}
				log.fine "FROM htpc fetchSeriesNfo SameNameAsTVshow - eInfo: $eInfo"
				if (eInfo.season != '' && eInfo.episode != ''){
					EpisodesJson = TheTVDB.requestJson("series/${i.id}/episodes/query?dvdSeason=${eInfo.season}&dvdEpisode=${eInfo.episode}", locale, Cache.ONE_WEEK)
				}
			}
			else {
				eInfo = net.filebot.WebServices.TheTVDB.getEpisodeList(i.id, SortOrder.Airdate, locale).find{it =~ newSxE}
				log.fine "FROM htpc fetchSeriesNfo SameNameAsTVshow - eInfo: $eInfo"
				EpisodesJson = TheTVDB.requestJson("series/${i.id}/episodes/query?airedSeason=${eInfo.season}&airedEpisode=${eInfo.episode}", locale, Cache.ONE_WEEK)
			}
			// log.fine "FROM htpc fetchSeriesNfo - EpisodesJson: $EpisodesJson"

			def nyeID = EpisodesJson.data.id.join('')
			log.fine "FROM htpc fetchSeriesNfo - EpisodeID: $nyeID"

			def EpisodeJson = TheTVDB.requestJson("episodes/${nyeID}", locale, Cache.ONE_WEEK)
			log.fine "FROM htpc fetchSeriesNfo SameNameAsTVshow - Generate Series NFO: $i.name [$newSxE]"

			def EpisodePicUrl = ''
			def data = EpisodeJson.data
			if (data.filename != ''){
				EpisodePicUrl = new URL ("https://www.thetvdb.com/banners/${data.filename}")
				EpisodePicUrl.saveAs(SameNameAsTVshowThumb)
				log.fine "FROM htpc fetchSeriesNfo - EpisodePicUrl: $EpisodePicUrl"
			}

			episodedetails {
				title(data.episodeName)
				showtitle(i.name)
				rating(data.siteRating)
				season(data.airedSeason)
				episode(data.airedEpisodeNumber)
				if (data.dvdSeason != null && data.dvdEpisodeNumber != null){
					seasondvd(data.dvdSeason)
					episodedvd(data.dvdEpisodeNumber)
				}
				uniqueid(data.id)
				votes(data.siteRatingCount)
				if (data.overview != '' && data.overview != null) {
					plot((data.overview).trim())
				}
				runtime(i.runtime)
				// yo(mi.values()[0]['Duration'].join(''))
				// thumb("https://www.thetvdb.com/banners/${data.filename}")
				if (EpisodePicUrl != ''){
					thumb(EpisodePicUrl)
				}
				mpaa(i.certification)
				i.genres.each{
					genre(it)
				}
				if (data.writers != '') {
					(data.writers).each{
						credits(it)
					}
				}
				if (data.director != '') {
					(data.director).tokenize('|').each{ d ->
						director(d)
					}
				}
				premiered(i.startDate)
				aired(data.firstAired)
				studio(i.network)
				(data.guestStars).each{ g ->
					actor {
						name(g)
						role("Guest star")
					}
				}
				ActorsJson.data.each{ a ->
					actor {
						name((a.name).toString().trim())
						role(a.role)
						order(a.sortOrder)
						if (a.image != '') {
							thumb("https://www.thetvdb.com/banners/${a.image}")
						}
					}
				}
				fileinfo {
					streamdetails {
						mi?.each { kind, streams ->
							def section = kind.toString().toLowerCase()
							streams.each { s ->
								if (section == 'general') {
									general {
										if (s.'FileName' != null) {
											filename((s.'FileName').trim())
										}
										if (s.'FileExtension' != null) {
											fileextension((s.'FileExtension').trim())
										}
										if (s.'FileSize' != null) {
											filesize((s.'FileSize').trim())
										}
										if (s.'Encoded_Date' != null) {
											encoded((s.'Encoded_Date').trim())
										}
										if (s.'Duration/String3' != null) {
											durationinhmsms((s.'Duration/String3').trim())
										}
										if (s.'OverallBitRate/String' != null) {
											overallbitrate((s.'OverallBitRate/String').replaceAll(/ /, '').replaceAll(/Kbps/, '').trim())
										}
									}
								}

								if (section == 'video') {
									video {
										def CodecList = [s.'CodecID/Hint' != null ? s.'CodecID/Hint' : null, s.'CodecID' != null ? (s.'CodecID'.contains('avc1') ? s.'CodecID' : null) : null, s.'InternetMediaType' != null ? (s.'InternetMediaType'.contains('video/H264') ? 'h264' : null) : null, s.'Encoded_Library_Name' != null ? s.'Encoded_Library_Name' : null, s.'Format'].findResult{it}
										codec((CodecList).replaceAll(/\s\w{3,}/).space('').trim())
										if (s.'Duration' != null) {
											BigDecimal durationinMS = new BigDecimal(s.'Duration')
											durationinseconds(Math.round((durationinMS)/1000))
											durationinminutes(Math.round((durationinMS)/60000))
										}
										if (s.'DisplayAspectRatio' != null) {
											aspect((s.'DisplayAspectRatio').trim())
										}
										if (s.'Width' != null) {
											width((s.'Width').trim())
										}
										if (s.'Height' != null) {
											height((s.'Height').trim())
										}
										if (s.'ScanType' != null) {
											scantype((s.'ScanType').trim())
										}
										if (s.'BitRate/String' != null) {
											bitrate((s.'BitRate/String').replaceAll(/ /, '').replaceAll(/Kbps/, '').trim())
										}
										if (s.'FrameRate' != null) {
											framerate((s.'FrameRate').trim())
										}
									}
								}

								if (section == 'audio') {
									audio {
										if (s.'CodecID/Hint' ?: s.'Format' != null) {
											codec((s.'CodecID/Hint' ?: s.'Codec'.contains('DTS-HD') ? s.'Codec' : s.'Format').replaceAll(/\p{Punct}/, '').trim())
											if (s.'Format_Profile' != null){
												codecformatprofile((s.'Format_Profile').replaceAll(/\/ Core/, '').replaceAll(/ /, '_').trim())
											}
										}
										if (s.'Language/String3' != null) {
											language((s.'Language/String3').trim())
										}
										if (s.'Language/String' != null) {
											longlanguage((s.'Language/String').trim())
										}
										if (s.'Channel(s)' != null) {
											if (s.'Channel(s)_Original' != null){
												channels((s.'Channel(s)_Original').trim())
											}
											else {channels((s.'Channel(s)')*.split(' / ')*.max().max())}
										}
										if (s.'BitRate/String' != null) {
											bitrate((s.'BitRate/String').replaceAll(/\s|Unknown \/|\/ Unknown|[A-Z]\w+/, '').split('/')*.toBigDecimal().max())
										}
									}
								}

								if (section == 'text') {
									subtitle {
										language(s.'Language/String3')
										if (s.'Language/String' != null) {
											longlanguage((s.'Language/String').replaceAll(/ /, '').trim())
										}
										if (s.'Format' != null) {
											format((s.'Format').trim())
										}
									}
								}
							}
						}
					}
				}
				if (data.imdbId != ''){
					imdb(id:data.imdbId, "https://www.imdb.com/title/${data.imdbId}")
				}
				tvdb(id:data.id, "https://www.thetvdb.com/?tab=episode&id=${data.id}")
			}


		}
	}
	xml.saveAs(outputFile)
}
htpc:

Code: Select all

def fetchSeriesArtworkAndNfo(seriesDir, seasonDir, seriesId, season, override = false, locale = _args.locale, tvshowFile = null, episodeNumber, sxe, EpisodeOrder = _args.order) {
	log.fine "FROM htpc fetchSeriesArtworkAndNfo - seasonDir: [$seasonDir]"
	log.fine "FROM htpc fetchSeriesArtworkAndNfo - season: [$season] / episodeNumber: [$episodeNumber] / sxe: [$sxe]"
	log.fine "FROM htpc fetchSeriesArtworkAndNfo - tvshowFile: [$tvshowFile]"
	tryLogCatch {
		// fetch nfo
		def seriesInfo = TheTVDB.getSeriesInfo(seriesId, locale)
		// log.fine "FROM htpc fetchSeriesArtworkAndNfo - seriesInfo: [$seriesInfo]"

			if (season == 0){
				sxe = episodeNumber
			}

			def String fname = tvshowFile.name

			def String SameNameAsTVshow = fname.nameWithoutExtension+'.nfo'
			log.fine "FROM htpc fetchSeriesArtworkAndNfo - SameNameAsTVshow: [$SameNameAsTVshow]"

			def EpisodePicExt = '-thumb.jpg'
			def String SameNameAsTVshowT = tvshowFile.nameWithoutExtension+EpisodePicExt
			def SameNameAsTVshowThumb = seasonDir.resolve(SameNameAsTVshowT)
			// log.fine "FROM htpc fetchSeriesArtworkAndNfo - SameNameAsTVshowThumb: [$SameNameAsTVshowThumb]"

			// fetchSeriesNfo(seasonDir.resolve(SameNameAsTVshow), seriesInfo, override, locale, 'SameNameAsTVshow', f, e, SameNameAsTVshowThumb, EpisodeOrder)
			fetchSeriesNfo(seasonDir.resolve(SameNameAsTVshow), seriesInfo, override, locale, 'SameNameAsTVshow', tvshowFile,  sxe, SameNameAsTVshowThumb, EpisodeOrder, season)
		// };

		 // e.g season13-poster.jpg
		def String seasonnumber = season.pad(2)
		def seasonposter = "season$seasonnumber-poster.jpg"

		// fetch season banners
		if (seasonDir != seriesDir) {
			fetchSeriesBanner(seasonDir.resolve('folder.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('folder.jpg'), seriesDir.resolve(seasonposter))
		}

		fetchSeriesNfo(seriesDir.resolve('tvshow.nfo'), seriesInfo, override, locale, 'tvshow', tvshowFile, sxe, null, EpisodeOrder, season)

		// fetch series banner, fanart, posters, etc
		['680x1000', null].findResult{ fetchSeriesBanner(seriesDir.resolve('folder.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 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('folder.jpg'), seriesDir.resolve('season-all-poster.jpg'))
	}
}
amc:

Code: Select all

	// EPISODE MODE
	if ((group.tvs || group.anime) && !group.mov) {
		// choose series / anime config
		def config = group.tvs ? [name:group.tvs, format:format.tvs, db:'TheTVDB'] : [name:group.anime, format:format.anime, db:'AniDB']
		def dest = rename(file: files, format: config.format, db: config.db)

		if (dest != null) {
			if (artwork) {
				dest.mapByFolder().each{ dir, fs ->
					def hasSeasonFolder = any{ dir =~ /Specials|Season.\d+/ || dir.parentFile.structurePathTail.listPath().size() > 0 }{ false }	// MAY NOT WORK FOR CERTAIN FORMATS
					fs.findResults{ it }.findAll{ it.metadata.seriesInfo.database == 'TheTVDB' }.collect{ [metadata: it.metadata, name: it.metadata.seriesName, season: it.metadata.special ? 0 : it.metadata.season, id: it.metadata.seriesInfo.id, episode: it.metadata.special ? 'Special '+it.metadata.special : it.metadata.episode, sxe:  it.metadata.special ?  0 + 'x' + it.metadata.special.pad(2) : it.metadata.season + 'x' + it.metadata.episode.pad(2), tvshowFile: it]}.unique().each{
						log.fine "Fetching series artwork for [$it.name / Season $it.season] to [$dir]"
						fetchSeriesArtworkAndNfo(hasSeasonFolder ? dir.parentFile : dir, dir, it.id, it.season, override, _args.locale, it.tvshowFile, it.episode, it.sxe, _args.order)
					}
				}
			}
		} else if (failOnError) {
			fail("Failed to rename series: $config.name")
		} else {
			unsortedFiles += files
		}
	}
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

Have you changed the function in "def ActorsJson = TheTVDB.requestJson("series/${i.id}/actors", locale, Cache.ONE_MONTH)" ?

What is the new way to do it ?


using FileBot 4.7 (r4044) all OK

but FileBot 4.7.2:
"No signature of method: net.filebot.WebServices$TheTVDBClientWithLocalSearch.requestJson() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, java.util.Locale, java.time.Duration) values: [series/248682/actors, en, PT576H]"
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: fn:artwork.tvdb stopped working

Post by rednoah »

The requestJson method is part of the new TheTVDB API so I doubt that it'll work with any stable release, because those use the old stable XML API.

You could try creating a new TheTVDBClient instance in your code and use that directly instead of the singleton provided by the script context.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

"The requestJson method is part of the new TheTVDB API so I doubt that it'll work with any stable release, because those use the old stable XML API."
because you went back to the old way, yes...
it should work in the future when you use new way again, yes ?

"You could try creating a new TheTVDBClient instance in your code and use that directly instead of the singleton provided by the script context."
can you give me an example, pls ?
(I have no idea how to do it)
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: fn:artwork.tvdb stopped working

Post by rednoah »

This should work:

Code: Select all

def TheTVDBv2 = new TheTVDBClient(/APIKEY/)
println TheTVDBv2.requestJson("series/78874/actors", Locale.ENGLISH, Cache.ONE_MONTH)
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

thx, looks like its working ok.

On 1st look, I can only see 1 problem: airsTime
test in GUI:
{def seriesInfo = net.filebot.WebServices.TheTVDB.getSeriesInfo(series.id, Locale.ENGLISH).airsDayOfWeek} = OK

{def seriesInfo = net.filebot.WebServices.TheTVDB.getSeriesInfo(series.id, Locale.ENGLISH).airsTime} = Empty ?


data from xml
"<Airs_DayOfWeek>Tuesday</Airs_DayOfWeek><Airs_Time>8:30 PM</Airs_Time>"
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: fn:artwork.tvdb stopped working

Post by rednoah »

:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

from amc:
Why does this work:

Code: Select all

fs.findResults{ it.metadata }.findAll{ it.seriesInfo.database == 'TheTVDB' }.collect{ [season: it.special ? 0 : it.season, id: it.seriesInfo.id] }
and this work

Code: Select all

sxe: it.metadata.special ?  0 + 'x' + it.metadata.special.pad(2) : it.metadata.season + 'x' + it.metadata.episode.pad(2)
when this does not:

Code: Select all

fs.findResults{ it.metadata }.findAll{ it.seriesInfo.database == 'TheTVDB' }.collect{ [episodesId: it.metadata.episodes ? it.metadata.episodes.id : it.metadata.id] }
from log:

Code: Select all

"No such property: episodes for class: net.filebot.web.Episode
Possible solutions: episode

Code: Select all

groovy.lang.MissingPropertyException: No such property: episodes for class: net.filebot.web.Episode
Possible solutions: episode"
also I was thinking if there is a way to get/read this part ?

Code: Select all

net.filebot.metadata: {"@type":"MultiEpisode"
and

Code: Select all

net.filebot.metadata: {"@type":"Episode"
btw: I'm trying to add multi-part episode support to my custom scripts and need help

bonus info:

Code: Select all

"For multi-part episodes, simply add multiple <episodedetails> XML blocks in succession. "
http://kodi.wiki/view/NFO_files/TV_episodes

http://kodi.wiki/view/naming_video_file ... ti-episode
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: fn:artwork.tvdb stopped working

Post by rednoah »

1.
I'm not a debugger. Decompose the code into individual statements and then add lots of println statements so you can see what's going on and what's different. ;)

2.
You're referring to filesystem xattr. You can read them with any program. The metadata property will give you the deserialized Java object, not the JSON string.

3.
The MultiEpisode type has a episodes property and the Episode type. You can easily tell them apart based on that.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

the problem is as you say
"The MultiEpisode type has a episodes property and the Episode type. You can easily tell them apart based on that."

"episodes" property is only present if "@type":"MultiEpisode"

using (episodesId: it.metadata.episodes ? it.metadata.episodes.id : it.metadata.id):
when I process a "normal" episode it fails
but works ok for MultiEpisode

using (sxe: it.metadata.special ? 0 + 'x' + it.metadata.special.pad(2) : ...)
does not fail even if there is NO value = [null]
there must be something in the filebot code that does this ?

how can I make "it.metadata.episodes" NOT fail if = not there = blank, but return [null] like special
do I need to define it somehow, if yes how ?

type: it.@type = fail
so I don't know how to get @type ?

"2.
You're referring to filesystem xattr. You can read them with any program. The metadata property will give you the deserialized Java object, not the JSON string."
I have no idea what you are saying, sry
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: fn:artwork.tvdb stopped working

Post by rednoah »

I guess you want to do something like this:

Code: Select all

if (episode instanceof MultiEpisode)
    // do something
else
    // do something else
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

if I use {episodes.id} in the GUI, I get no fail

this is what I need, but how to do it in the amc script ?

EDIT:
Or maybe how do I get {episodes.id} directly in the htpc script ?
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: fn:artwork.tvdb stopped working

Post by rednoah »

{episodes} is a format binding. You seem to be confused about the differences between a FileBot format code and generic Groovy code.


Here's a snippet that shows how to apply a FileBot format from your Groovy code:

Code: Select all

def result = getMediaInfo(file, '{episodes.id}')
This is of course much slower than just accessing the properties directly and I would never write code like that.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

I can get this to work in the GUI / Groovy Pad

Code: Select all

def fs = new File (" * ")
if (fs.metadata instanceof net.filebot.web.MultiEpisode) {'MultiEpisode'} 
else {'episode'}
but can't get it working in the amc script
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

need help...
I have tried a lot, but no luck... I have no idea how to get it working or even why it don't work in amc ?
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: fn:artwork.tvdb stopped working

Post by rednoah »

1.
What is this supposed to do? Makes no sense to me.

Code: Select all

def fs = new File (" * ")

2.
What exactly is not working? Which line? What are the values of all variables? What is the result of that line? How is this result not what you'd expect?

You need to ask specific questions. I'm not a debugger. I won't be able to answer questions that only a compiler or debugger can tell you.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

the * is where I put the filename ONLY to test in the GUI / Groovy Pad
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

in the AMC

if (fs.metadata instanceof net.filebot.web.Episode)
and
if (fs.metadata instanceof net.filebot.web.MultiEpisode)
is ALLWAYS failing
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: fn:artwork.tvdb stopped working

Post by rednoah »

What is the value of fs?
What is the value of fs.metadata?
Is fs a File object?
Does this File object refer to a file that has xattr metadata?
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: fn:artwork.tvdb stopped working

Post by kim »

AMC.groovy = your code, you know this better then I do
under:
// EPISODE MODE
https://github.com/filebot/scripts/blob ... roovy#L432

after this part I have put "if (fs.metadata instanceof net.filebot.web.MultiEpisode)"


What is the value of fs? = [filepath+ filename]
What is the value of fs.metadata? = ["SeriesName" - 1x01 & 1x02 - "Episodename"]

Is fs a File object? = yes
Does this File object refer to a file that has xattr metadata? = yes
Post Reply