•   
  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 8
  •   
Alpha plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners
#16
(2019-08-01, 00:57)Lunatixz Wrote:
(2019-07-31, 12:26)sualfred Wrote:
Code:

2019-07-31 12:25:07.107 T:27484   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\xe9' in position 3: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "E:\Kodi-Leia\portable_data\addons\plugin.video.themoviedb.helper\main.py", line 564, in <module>
                                                router(sys.argv[2][1:])
                                              File "E:\Kodi-Leia\portable_data\addons\plugin.video.themoviedb.helper\main.py", line 547, in router
                                                list_items(items[category['request_key']], category['item_dbtype'], category['request_dbtype'])
                                              File "E:\Kodi-Leia\portable_data\addons\plugin.video.themoviedb.helper\main.py", line 457, in list_items
                                                url = get_url(info='item', tmdb_id=i.get('id', ''), type=item_dbtype, title=title)
                                              File "E:\Kodi-Leia\portable_data\addons\plugin.video.themoviedb.helper\main.py", line 237, in get_url
                                                return '{0}?{1}'.format(_url, urlencode(kwargs))
                                              File "E:\Kodi-Leia\system\python\Lib\urllib.py", line 1343, in urlencode
                                                v = quote_plus(str(v))
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 3: ordinal not in range(128)
                                            -->End of Python script error report<--

Your Unicode issue is here:

v = quote_plus(str(v))

Remove 'str'... for sanity avoid using 'str'.

BTW kudos on the release...

Thanks but urllib is not my module and that's not a line from my code - so I'm not quite sure where that's coming from as I don't have that issue with urllib.
Reply
#17
(2019-08-01, 01:01)jurialmunkey Wrote:
(2019-08-01, 00:57)Lunatixz Wrote:
(2019-07-31, 12:26)sualfred Wrote:
Code:

2019-07-31 12:25:07.107 T:27484   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\xe9' in position 3: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "E:\Kodi-Leia\portable_data\addons\plugin.video.themoviedb.helper\main.py", line 564, in <module>
                                                router(sys.argv[2][1:])
                                              File "E:\Kodi-Leia\portable_data\addons\plugin.video.themoviedb.helper\main.py", line 547, in router
                                                list_items(items[category['request_key']], category['item_dbtype'], category['request_dbtype'])
                                              File "E:\Kodi-Leia\portable_data\addons\plugin.video.themoviedb.helper\main.py", line 457, in list_items
                                                url = get_url(info='item', tmdb_id=i.get('id', ''), type=item_dbtype, title=title)
                                              File "E:\Kodi-Leia\portable_data\addons\plugin.video.themoviedb.helper\main.py", line 237, in get_url
                                                return '{0}?{1}'.format(_url, urlencode(kwargs))
                                              File "E:\Kodi-Leia\system\python\Lib\urllib.py", line 1343, in urlencode
                                                v = quote_plus(str(v))
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 3: ordinal not in range(128)
                                            -->End of Python script error report<--

Your Unicode issue is here:

v = quote_plus(str(v))

Remove 'str'... for sanity avoid using 'str'.

BTW kudos on the release...

Thanks but urllib is not my module and that's not a line from my code - so I'm not quite sure where that's coming from as I don't have that issue with urllib.

Haha, damn mobile screen... Nevertheless unicode errors are a pain... It's best to decide how you want to work with strings and encoding... then stick with one method. If you still have issues let me know and I can assist Smile
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Twitter | Help?
Reply
#18
(2019-08-01, 00:58)jurialmunkey Wrote:
(2019-08-01, 00:37)bsoriano Wrote:
(2019-08-01, 00:27)jurialmunkey Wrote: Added.
ListItem.Property(budget) and ListItem.Property(revenue)

Keep in mind that detailed info is only available when you "enter into" the item (i.e. the first screenshot). TMDB api only provides basic info when searching lists like Recommended. I don't want to go into SkinHelper territory of running a service, so I only call the detailed info for the item when you click on it

Other properties available:
ListItem.Property(Genre.X.Name)
ListItem.Property(Studio.X.Name)
ListItem.Property(Country.X.Name)
^ These three all provide Genre.X.ID which will be used when I implement Genre.Studio/Country look-ups (coming soon! Wink )

For people there are:
ListItem.Property(birthday)
ListItem.Property(deathday)
ListItem.Property(aliases) - aka "known as"
ListItem.Property(role) - aka "know for" (e.g. "Actress" or "Director")
ListItem.Property(born) - aka "place of birth"

All also put tmdb_id as property in
ListItem.Property(tmdb_id) 
@jurialmunkey , thanks!! I was planning on using those properties in the video info dialog, so I would call the plugin with "?info=item&title=$INFO[ListItem.Title]&year=$INFO[ListItem.Year]&&type=movie", correct? Given that I do not necessarily have the tmdbid for the movie.

Regards,

Bart
Yes that's correct, though you've got a double ampersand at the end there - only need one.

Plus I think you need to replace & with &amp; in skin xml.

You should also be able to get the tmdb_id as a property from that list to then use for other lists in the info dialog.

This is the general idea of one of the main use cases. I haven't tested extensively in info dialog yet, so I'm interested in how it goes.
@jurialmunkey, thanks! I have not tried this yet, I put the syntax that I saw with my skin debug on the folderpath from an individual movie traversing through the addon.

To further understand what I would need to do, is it the correct approach to have a hidden list in my info dialog that has as content the plugin path? That list would have just one item whose properties I would then use. Or am I over-complicating things?

Regards,

Bart
Reply
#19
(2019-08-01, 01:44)bsoriano Wrote:
(2019-08-01, 00:58)jurialmunkey Wrote:
(2019-08-01, 00:37)bsoriano Wrote: @jurialmunkey , thanks!! I was planning on using those properties in the video info dialog, so I would call the plugin with "?info=item&title=$INFO[ListItem.Title]&year=$INFO[ListItem.Year]&&type=movie", correct? Given that I do not necessarily have the tmdbid for the movie.

Regards,

Bart
Yes that's correct, though you've got a double ampersand at the end there - only need one.

Plus I think you need to replace & with &amp; in skin xml.

You should also be able to get the tmdb_id as a property from that list to then use for other lists in the info dialog.

This is the general idea of one of the main use cases. I haven't tested extensively in info dialog yet, so I'm interested in how it goes.
@jurialmunkey, thanks! I have not tried this yet, I put the syntax that I saw with my skin debug on the folderpath from an individual movie traversing through the addon.

To further understand what I would need to do, is it the correct approach to have a hidden list in my info dialog that has as content the plugin path? That list would have just one item whose properties I would then use. Or am I over-complicating things?

Regards,

Bart
Yeah thats correct. First item in the list will always be the retrieved item so you can reference it with Container(id).ListItemAbsolute(0)

You can also use the other listitems from that path to fill additional content lists (e.g. Cast or Similar). You can reference these with Container(id).ListItemAbsolute(x).FolderPath (and the label for that item will be the name of the list e.g. "Cast").

Currently the additional lists from info=item don't follow any sensible order but I will fix that soon. Idea is that it provides all the additional lists for that item without needing to explicitly reference the plugin paths - so basically you can use one content path and it will adapt depending on type of item.
Reply
#20
(2019-08-01, 02:00)jurialmunkey Wrote:
(2019-08-01, 01:44)bsoriano Wrote:
(2019-08-01, 00:58)jurialmunkey Wrote: Yes that's correct, though you've got a double ampersand at the end there - only need one.

Plus I think you need to replace & with &amp; in skin xml.

You should also be able to get the tmdb_id as a property from that list to then use for other lists in the info dialog.

This is the general idea of one of the main use cases. I haven't tested extensively in info dialog yet, so I'm interested in how it goes.
@jurialmunkey, thanks! I have not tried this yet, I put the syntax that I saw with my skin debug on the folderpath from an individual movie traversing through the addon.

To further understand what I would need to do, is it the correct approach to have a hidden list in my info dialog that has as content the plugin path? That list would have just one item whose properties I would then use. Or am I over-complicating things?

Regards,

Bart
Yeah thats correct. First item in the list will always be the retrieved item so you can reference it with Container(id).ListItemAbsolute(0)

You can also use the other listitems from that path to fill additional content lists (e.g. Cast or Similar). You can reference these with Container(id).ListItemAbsolute(x).FolderPath (and the label for that item will be the name of the list e.g. "Cast").

Currently the additional lists from info=item don't follow any sensible order but I will fix that soon. Idea is that it provides all the additional lists for that item without needing to explicitly reference the plugin paths - so basically you can use one content path and it will adapt depending on type of item.

Excellent!! Thank you Smile
Reply
#21
(2019-08-01, 00:30)jurialmunkey Wrote:
(2019-07-31, 20:19)Edworld Wrote:
(2019-07-31, 19:52)bsoriano Wrote: @jurialmunkey, this is fantastic, thanks! Will you be adding in the future other movie properties like budget and revenue?

Regards,

Bart
+1

Ratings for movies and tvshows would be great too. 

Script already puts TMDB rating in ListItem.Rating for the item.
TMDB doesn't supply any other ratings. Though I doubt it would be that difficult to work in OMDB as well.

EDIT: Oh Do you mean ListItem.MPAA? TMDB doesn't supply that. I will have to use OMDB. Looking at the API, it should be too difficult to implement though. 
I wish I could explain it better. Media Companion scrapes tvshow ratings coming from tmdb, I don't know if it comes from tmdb api or omdb api.
Reply
#22
(2019-08-01, 02:54)Edworld Wrote:
(2019-08-01, 00:30)jurialmunkey Wrote:
(2019-07-31, 20:19)Edworld Wrote: +1

Ratings for movies and tvshows would be great too. 

Script already puts TMDB rating in ListItem.Rating for the item.
TMDB doesn't supply any other ratings. Though I doubt it would be that difficult to work in OMDB as well.

EDIT: Oh Do you mean ListItem.MPAA? TMDB doesn't supply that. I will have to use OMDB. Looking at the API, it should be too difficult to implement though. 
I wish I could explain it better. Media Companion scrapes tvshow ratings coming from tmdb, I don't know if it comes from tmdb api or omdb api.

Yeah TMDb definitely has MPAA certifications on their website, but for some reason the API doesn't expose them when looking at movie details.
Reply
#23
(2019-08-01, 13:00)jurialmunkey Wrote:
(2019-08-01, 02:54)Edworld Wrote:
(2019-08-01, 00:30)jurialmunkey Wrote: Script already puts TMDB rating in ListItem.Rating for the item.
TMDB doesn't supply any other ratings. Though I doubt it would be that difficult to work in OMDB as well.

EDIT: Oh Do you mean ListItem.MPAA? TMDB doesn't supply that. I will have to use OMDB. Looking at the API, it should be too difficult to implement though. 
I wish I could explain it better. Media Companion scrapes tvshow ratings coming from tmdb, I don't know if it comes from tmdb api or omdb api.

Yeah TMDb definitely has MPAA certifications on their website, but for some reason the API doesn't expose them when looking at movie details.

I was referring to numerical ratings (9.0,9.4,etc). Media companion provides them for movies and tvshows.
Reply
#24
(2019-08-01, 13:00)jurialmunkey Wrote: Yeah TMDb definitely has MPAA certifications on their website, but for some reason the API doesn't expose them when looking at movie details.

MPAA ratings are part of the release date, you need 
Code:
https://api.themoviedb.org/3/movie/299534/release_dates?api_key=xxxxxxxxxxx

You can also use append_to_response to grab it at the same time as the details:-

Code:
https://api.themoviedb.org/3/movie/299534?append_to_response=release_dates&api_key=xxxxxxxxxxxxxx
Reply
#25
@jurialmunkey , are you planning on creating info pages for movies, tv shows and people like extendedinfo, or should we plan on modifying/creating our own?

Regards,

Bart
Reply
#26
(2019-08-01, 14:45)roidy Wrote:
(2019-08-01, 13:00)jurialmunkey Wrote: Yeah TMDb definitely has MPAA certifications on their website, but for some reason the API doesn't expose them when looking at movie details.

MPAA ratings are part of the release date, you need 
Code:
https://api.themoviedb.org/3/movie/299534/release_dates?api_key=xxxxxxxxxxx

You can also use append_to_response to grab it at the same time as the details:-

Code:
https://api.themoviedb.org/3/movie/299534?append_to_response=release_dates&api_key=xxxxxxxxxxxxxx

Thanks! I knew they must be somewhere. Big Grin
Bit strange that they are bundled with release dates, though I can see the logic behind it I guess.
Reply
#27
(2019-08-01, 14:29)Edworld Wrote:
(2019-08-01, 13:00)jurialmunkey Wrote:
(2019-08-01, 02:54)Edworld Wrote: I wish I could explain it better. Media Companion scrapes tvshow ratings coming from tmdb, I don't know if it comes from tmdb api or omdb api.

Yeah TMDb definitely has MPAA certifications on their website, but for some reason the API doesn't expose them when looking at movie details.

I was referring to numerical ratings (9.0,9.4,etc). Media companion provides them for movies and tvshows.

They should already be there. TMDb ratings are put into ListItem.Rating

I've now also added support for OMDb so can get Awards, IMDb, RT and Metacritic for the ?info=item plugin path.
ListItem.Property(Rating.Metacritic)
ListItem.Property(Rating.RottenTomatoes)
ListItem.Property(Rating.IMDB)
ListItem.Property(Awards)
Reply
#28
(2019-08-01, 15:29)bsoriano Wrote: @jurialmunkey , are you planning on creating info pages for movies, tv shows and people like extendedinfo, or should we plan on modifying/creating our own?

Regards,

Bart

Modify/create your own.

My idea is that you can just create a new view ID in MyVideoNav as if it was a normal viewtype but instead base the info off the listitem ?info=item
Put this in the "info" viewtype:
<visible>String.StartsWith(Container.FolderPath,plugin://plugin.video.themoviedb.helper/?info=item)</visible>

Then hide all the other viewtypes by adding to their visible conditions:
!String.StartsWith(Container.FolderPath,plugin://plugin.video.themoviedb.helper/?info=item)

That way when you navigate to the detailed ?info=item page you can recreate a videoinfo dialog window.
Then in the other info lists in the info dialog (e.g. Similar Movies), you can use the following onclick to update the folderpath and get the new info.
<onclick>Container.Update($INFO[Container(ID).ListItem.FolderPath])</onclick>
This will keep a memory of the different info pages you have moved through (because essentially you are navigating through the addon like you would in the library).

I'm making an example in Arctic Zephyr 2 and I'll add the code to github once it's done so that you can see how it works.
Reply
#29
(2019-08-01, 16:05)jurialmunkey Wrote:
(2019-08-01, 15:29)bsoriano Wrote: @jurialmunkey , are you planning on creating info pages for movies, tv shows and people like extendedinfo, or should we plan on modifying/creating our own?

Regards,

Bart

Modify/create your own.

My idea is that you can just create a new view ID in MyVideoNav as if it was a normal viewtype but instead base the info off the listitem ?info=item
Put this in the "info" viewtype:
<visible>String.StartsWith(Container.FolderPath,plugin://plugin.video.themoviedb.helper/?info=item)</visible>

Then hide all the other viewtypes by adding to their visible conditions:
!String.StartsWith(Container.FolderPath,plugin://plugin.video.themoviedb.helper/?info=item)

That way when you navigate to the detailed ?info=item page you can recreate a videoinfo dialog window.
Then in the other info lists in the info dialog (e.g. Similar Movies), you can use the following onclick to update the folderpath and get the new info.
<onclick>Container.Update($INFO[Container(ID).ListItem.FolderPath])</onclick>
This will keep a memory of the different info pages you have moved through (because essentially you are navigating through the addon like you would in the library).

I'm making an example in Arctic Zephyr 2 and I'll add the code to github once it's done so that you can see how it works. 
Awesome, thank you! Smile

Regards,

Bart
Reply
#30
(2019-08-01, 15:57)jurialmunkey Wrote:
(2019-08-01, 14:29)Edworld Wrote:
(2019-08-01, 13:00)jurialmunkey Wrote: Yeah TMDb definitely has MPAA certifications on their website, but for some reason the API doesn't expose them when looking at movie details.

I was referring to numerical ratings (9.0,9.4,etc). Media companion provides them for movies and tvshows.

They should already be there. TMDb ratings are put into ListItem.Rating

I've now also added support for OMDb so can get Awards, IMDb, RT and Metacritic for the ?info=item plugin path.
ListItem.Property(Rating.Metacritic)
ListItem.Property(Rating.RottenTomatoes)
ListItem.Property(Rating.IMDB)
ListItem.Property(Awards)

Can you add critics consensus and rottentomatoesaudience?
Reply
  •   
  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 8
  •   
 
Thread Rating:
  • 1 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners51