FileBot 4.7 - New TV api problems

All your suggestions, requests and ideas for future development
Post Reply
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

FileBot 4.7 - New TV api problems

Post by kim »

FileBot 4.7 (r3947) - No Actors:

No Actors in tvshow.nfo
and
net.filebot.metadata: "actors":null,

Code: Select all

def fetchSeriesNfo(outputFile, seriesInfo, locale) {
	log.fine "Generate Series NFO: $seriesInfo.name [$seriesInfo.id]"
	def i = seriesInfo
	def xml = XML {
		tvshow {
...
			i.actors?.each{ n ->
				actor {
					name(n)
				}
			}
https://github.com/filebot/scripts/blob ... tpc.groovy
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: FileBot 4.7 - New TV api problems

Post by rednoah »

Actors is no longer in the base series record. That's broken for now, because making additional requests for the actors json data by default would be wasteful.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: FileBot 4.7 - New TV api problems

Post by kim »

I'm sorry to hear that.
Who says it's "wasteful"?

I'm 100% sure Kodi and all other media scrapers (that whats to be compatible with Kodi)
Will make that "additional requests for the actors" because it's a big part of the "tvshow.nfo"

Already Filebot don't support "<episodedetails>" aka tvepisodes, now actors to...
making e.g. Kodi scrape it... and if Kodi only has part of the e.g. tvshow.nfo, either it will only show what is in the tvshow.nfo or Kodi needs to scrape it all (not using the tvshow.nfo)
... this makes the current TV scraping part of Filebot only useful for the banner, fanart and poster artwork.

"Kodi also contains a Local-NFO-only mode" I use this on Movies now and it works great, but this don't work on TV shows without a full "tvshow.nfo" AND SameNameAsVideoFile.nfo
http://kodi.wiki/view/NFO_files#.NFO_exists
http://kodi.wiki/view/NFO_files/tvshows
http://kodi.wiki/view/NFO_files/tvepisodes


If you are more worried about being "wasteful" then what people what,
then make it so the user can chose if he/she wants:
artwork = y (banner, fanart and poster ) and maybe the tvshow.nfo to?
seriesNFO = y (tvshow.nfo only)
complete = y (tvshow.nfo AND tv episodes nfo AND artwork)

Now if we need the "complete" we need to use 3rd party program, I think that is very sad because I can customize the naming format and NFO's to what I need/want... I don't know of any other program that can do this.

EDIT: Also you can make it so people need to use there own apikey and data if they what to use/get the "extra" info/data... this way your apikey is safe if someone abuse it... great compromise I think ;)
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: FileBot 4.7 - New TV api problems

Post by rednoah »

1.
Well, getting everything but actors takes one request (genres, certification, etc) and just getting actors would be one more request for data nobody ever uses (not useful matching, not useful for auto-detection, not useful in the format, etc).


2.
Making extra requests in the htpc.groovy script on demand is not an issue of course. Doing it preemptively for everyone all the time (e.g. GUI users, non-amc-script-with-artwork users, etc) when it's not used most of the time, that's not nice.

e.g.

Code: Select all

def id = 78874
def json = TheTVDB.requestJson("series/${id}/actors", Locale.ENGLISH, Cache.ONE_MONTH)

json.data.name.each{
	println it
}
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: FileBot 4.7 - New TV api problems

Post by kim »

NICE :D

"Cache.ONE_MONTH" does this mean it will only download "actors" once a "MONTH"?
(if I don't clear the cache)

can I use only on "requestJson" ?

I guess this means I can get ALL info I need to make the episode.nfo using "requestJson" ?

For others that wants "actor" back in the "tvshow.nfo"... I made this (Kodi style) ;)
Put in local HTPC.groovy:

Code: Select all

def fetchSeriesNfo(outputFile, seriesInfo, override, locale) {
def json = TheTVDB.requestJson("series/${seriesInfo.id}/actors", locale, Cache.ONE_MONTH)

Code: Select all

tvshow {
				json.data.each{ a ->
					actor {
						name(a.name)
						role(a.role)
						order(a.sortOrder)
						if (a.image != '') {
							thumb("https://www.thetvdb.com/banners/${a.image}")
						}
					}
				}
}
Last edited by kim on 08 May 2016, 16:18, edited 3 times in total.
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: FileBot 4.7 - New TV api problems

Post by rednoah »

Yep, that internal method takes care of caching, and the last parameter is just a duration. You can't just add that to methods randomly. :lol:
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: FileBot 4.7 - New TV api problems

Post by kim »

The log say:
Fetch resource: https://api.thetvdb.com/series/ID/episodes?page=1

then it must have access to the data:
"episodeName", "firstAired", "id", and "overview"

1. how do I access this data ?

I can get some of it, but what about "id", and "overview" ?
def eInfo = net.filebot.WebServices.TheTVDB.getEpisodeList(series.id, null, Locale.ENGLISH).find{it =~ sxe};
eInfo.title ("episodeName" )
eInfo.airdate ("firstAired")

1.1. is there a shorter/better way (that work in htpc) ?

2. please add support for this.
(No need to download any more and it takes Filebot 1ms to add to info)

3. (my goal) then doing a https://api.thetvdb.com/episodes/ID to get the rest info is simple.
the rest:
"guestStars"
"director"
"writers"
"filename"
"imdbId"
"siteRating"
"siteRatingCount"
+"episodeName", "firstAired", "id", and "overview" from before
= Kodi TV style DONE :D
(all info is available + the img URLs )
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: FileBot 4.7 - New TV api problems

Post by rednoah »

0.
The API requires you to send certain HTTP headers, so you can't just open it in the browser. The easiest way would be to use Fiddler (or any other HTTP Debugging Proxy) and intercept the HTTP requests. Fiddler supports decrypting HTTPS sessions and you'll need that to see the TheTVDB requests.


1. to 3.
FileBot Episode objects do not contain that information. You can do your own requestJson calls if you need the full json response.


4.
If you want to check if two episode objects have the same numbers you should do this:

Code: Select all

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

Re: FileBot 4.7 - New TV api problems

Post by kim »

1.
Fetch resource: https://api.thetvdb.com/search/series?n ... con+Valley
Received 2.605 bytes
Rank [Silicon Valley] => [Silicon Valley, Silicon Valley Rebels, Start-ups: Silicon Valley]
Rank [Silicon Valley] => [Silicon Valley, Silicon Valley Rebels, Start-ups: Silicon Valley]
Fetching episode data for [Silicon Valley]
Fetch resource: https://api.thetvdb.com/series/277165
Received 859 bytes
Fetch resource: https://api.thetvdb.com/series/277165/episodes?page=1
Received 18.414 bytes
Fetching episode data for [Silicon Valley Rebels]
Fetch resource: https://api.thetvdb.com/series/283723
Received 1.122 bytes
Fetch resource: https://api.thetvdb.com/series/283723/episodes?page=1
Resource not found: https://api.thetvdb.com/series/283723/episodes?page=1
Received 0 bytes
null
java.lang.NullPointerException
the api (https://api.thetvdb.com/swagger#!/Serie ... d_episodes) say:
{
"Error": "No results for your query: map[tve.seriesId:283723]"
}
= Result FAIL

2.
"e1.numbers == e2.numbers" ?
do you have a e.g. "numbers" don't work
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: FileBot 4.7 - New TV api problems

Post by kim »

To be clear... now the show "Silicon Valley" can't be scraped because of other show NOT having any episodes

java.lang.NullPointerException
or from api
{
"Error": "No results for your query: map[tve.seriesId:283723]"
}

this error/problem can happen again on other shows, so fix pls
more info... look @ my pre. post
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: FileBot 4.7 - New TV api problems

Post by rednoah »

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

Re: FileBot 4.7 - New TV api problems

Post by kim »

I think "seasonwide" banner is broken ?

fetchSeriesBanner(seasonDir.resolve('banner.jpg'), series, 'season', 'seasonwide', season, override, locale)
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: FileBot 4.7 - New TV api problems

Post by rednoah »

Fixed.
:idea: Please read the FAQ and How to Request Help.
Post Reply