Plugin.video.themoviedb.helper: [Request] Create plexkodiconnect player

Created on 19 Jan 2020  路  12Comments  路  Source: jurialmunkey/plugin.video.themoviedb.helper

I try to create plexkodiconnect player to play all movies and tvshows
which i added with TMD helper to my library...

plexkodiconnect.json in folder players

{

 "name"         : "plexkodiconnect",
 "plugin"       : "plugin.video.plexkodiconnect",

  "play_movie"        : [
                            "plugin://plugin.video.plexkodiconnect/search/search/{title}/",
                            {"title": "{title}", "year": "{year}"}
                          ],
    "play_episode"      : [
                            "plugin://plugin.video.plexkodiconnect/directory/search/search/{showname}/",
                            {"title": "{showname}"},
                            {"position": "{season}"},
                            {"season": "{season}", "episode": "{episode}"}
                          ],
    "search_movie"      : "plugin://plugin.video.plexkodiconnect/directory/search/search/{title}/",
    "search_episode"    : "plugin://plugin.video.plexkodiconnect/directory/search/search/{showname}/"

}

and this is my settings.xml file

<settings version="2">
    <setting id="bundled_players">true</setting>
    <setting id="cache_details_days" default="true">0</setting>
    <setting id="cache_list_days" default="true">0</setting>
    <setting id="debug_logging" default="true">false</setting>
    <setting id="default_player_episodes" default="true">plexkodiconnect</setting>
    <setting id="default_player_movies" default="true">plexkodiconnect</setting>
    <setting id="fanarttv_apikey" default="true"></setting>
    <setting id="fanarttv_clientkey" default="true"></setting>
    <setting id="fanarttv_lookup" default="true">false</setting>
    <setting id="fuzzymatch_movie" default="true">false</setting>
    <setting id="fuzzymatch_tv" default="true">false</setting>
    <setting id="hide_unaired" default="true">false</setting>
    <setting id="language">18</setting>
    <setting id="local_db">true</setting>
    <setting id="mpaa_prefix" default="true">Rated </setting>
    <setting id="omdb_apikey" default="true"></setting>
    <setting id="players_url">http://bit.ly/openplayers</setting>
    <setting id="select_action" default="true">0</setting>
    <setting id="tmdb_apikey" default="true"></setting>
    <setting id="trakt_management">true</setting>
    <setting id="trakt_token" default="true">xxxxxx</setting>
    <setting id="trakt_unwatchedcounts">true</setting>
    <setting id="trakt_watchedindicators">true</setting>
    <setting id="widget_fanarttv_lookup" default="true">false</setting>
</settings>

and this is ERROR:

2020-01-19 16:41:41.535 T:1332   ERROR: Playlist Player: skipping unplayable item: 0, path [C:\Users\Jan\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\movies\Gemini Man (2019)\Gemini Man (2019).strm]
2020-01-19 16:41:41.913 T:35996   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: Expecting , delimiter: line 3 column 20 (char 135)
                                            Traceback (most recent call last):
                                              File "C:\Users\Jan\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\script.py", line 10, in <module>
                                                TMDbScript.router()
                                              File "C:\Users\Jan\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\resources\lib\script.py", line 387, in router
                                                self.play()
                                              File "C:\Users\Jan\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\resources\lib\script.py", line 324, in play
                                                season=self.params.get('season'), episode=self.params.get('episode'))
                                              File "C:\Users\Jan\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\resources\lib\player.py", line 130, in play
                                                self.setup_players(details=True)
                                              File "C:\Users\Jan\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\resources\lib\player.py", line 36, in setup_players
                                                self.build_players(tmdbtype)
                                              File "C:\Users\Jan\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\resources\lib\player.py", line 195, in build_players
                                                meta = loads(content) or {}
                                              File "C:\Program Files\Kodi\system\python\Lib\json\__init__.py", line 339, in loads
                                                return _default_decoder.decode(s)
                                              File "C:\Program Files\Kodi\system\python\Lib\json\decoder.py", line 364, in decode
                                                obj, end = self.raw_decode(s, idx=_w(s, 0).end())
                                              File "C:\Program Files\Kodi\system\python\Lib\json\decoder.py", line 380, in raw_decode
                                                obj, end = self.scan_once(s, idx)
                                            ValueError: Expecting , delimiter: line 3 column 20 (char 135)
                                            -->End of Python script error report<--
enhancement help wanted

Most helpful comment

@webmaher - Can you test the below player with the PKC beta? I have no idea if it will work since I don't use PKC but hopefully it will...

{
    "name"              : "PlexKodiConnect",
    "plugin"            : "plugin.video.plexkodiconnect",
    "priority"          : 500,
    "play_movie"        : [
                            "plugin://plugin.video.plexkodiconnect?mode=search&query={title}",
                            {"title": "{title}", "year": "{year}"}
                          ],
    "play_episode"      : [
                            "plugin://plugin.video.plexkodiconnect?mode=search&query={showname}",
                            {"title": "{showname}"},
                            {"season": "{season}"},
                            {"season": "{season}", "episode": "{episode}"}
                          ],
    "search_movie"      : "plugin://plugin.video.plexkodiconnect?mode=search&query={title}",
    "search_episode"    : "plugin://plugin.video.plexkodiconnect?mode=search&query={showname}"
}

If the above doesn't work for play, can you get me screenshots of what happens when you use the search function for each of the movies and episodes search (preferably with a media view that shows a lot of information). In particular, I'm interested in how tvshows are navigated (e.g. does the search show tvshow names or episodes, and what happens when you click on tvshows and each step to get to the episode from the search results).

All 12 comments

The error suggests you're missing a , somewhere.

i really dont know in which file i can find this error and why:

Error Type: <type 'exceptions.ValueError'> Error Contents: Expecting , delimiter: line 3 column 20 (char 135)

in file plexikodiconnect.json i think not ...
i look also this but i dont understand much because im not a programmer
https://github.com/jurialmunkey/plugin.video.themoviedb.helper/wiki/Player-Function
Can please somebody help me :-(

Copying the Netflix player and just changing the plugin name is not going to work. You need to find out what the path is that the plugin uses for searching and then create steps that are appropriate.

Also, for future issues, please format your code blocks correctly by using three backticks so that it is readable. One backtick is only used for inline code - using it for multiline makes an unreadable mess.

E.g.
```
Code goes here
Code goes here
Code goes here
```

Code goes here
Code goes here
Code goes here

I really dont know how to do that so please help :-(
Here is code from plexkodiconnect.json for OpenMeta which work:

{
 "name"         : "PlexKodiConnect",
 "plugin"       : "plugin.video.plexkodiconnect",
 "priority"     : 200,
 "id"           : "plexkodiconnect",
 "filters"      : {},
 "postprocess"  : "",
 "movies"       : [
  [
   {
    "link"      : "plugin://plugin.video.plexkodiconnect/?mode=browseplex&key=%2fhubs%2fsearch%3ftype%3d1&prompt=Search+Movie",
    "steps"     : [
     "@keyboard:{realtitle}",
     "{realtitle} .{year}."
     ],
    "action"    : "PLAY"
   },
   {
    "link"      : "plugin://plugin.video.plexkodiconnect/?mode=browseplex&key=%2fhubs%2fsearch%3ftype%3d1&prompt=Search+Movie",
    "steps"     : [
     "@keyboard:{realtitle}",
     "{realtitle}"
     ],
    "action"    : "PLAY"
   }
  ]
 ],
 "tvshows"      : [
  [
   {
    "link"      : "plugin://plugin.video.plexkodiconnect/?mode=browseplex&key=%2fhubs%2fsearch%3ftype%3d2&prompt=Search+TVShow",
    "steps"     : [
     "@keyboard:{realname}",
     "{realname} .{year}.",
     ".* {season}",
     "{title}"
     ],
    "action"    : "PLAY"
   },
   {
    "link"      : "plugin://plugin.video.plexkodiconnect/?mode=browseplex&key=%2fhubs%2fsearch%3ftype%3d2&prompt=Search+TVShow",
    "steps"     : [
     "@keyboard:{realname}",
     "{realname} .{year}.",
     ".* {season}",
     "{season}x{episode}"
     ],
    "action"    : "PLAY"
   },
   {
    "link"      : "plugin://plugin.video.plexkodiconnect/?mode=browseplex&key=%2fhubs%2fsearch%3ftype%3d2&prompt=Search+TVShow",
    "steps"     : [
     "@keyboard:{realname}",
     "{realname}",
     ".* {season}",
     "{title}"
     ],
    "action"    : "PLAY"
   },
   {
    "link"      : "plugin://plugin.video.plexkodiconnect/?mode=browseplex&key=%2fhubs%2fsearch%3ftype%3d2&prompt=Search+TVShow",
    "steps"     : [
     "@keyboard:{realname}",
     "{realname}",
     ".* {season}",
     "{season}x{episode}"
     ],
    "action"    : "PLAY"
   }
  ]
 ]
}

Copying the Netflix player and just changing the plugin name is not going to work. You need to find out what the path is that the plugin uses for searching and then create steps that are appropriate.

I put this in c:\Users\Jan\AppDataRoaming\Kodiaddons\plugin.video.themoviedb.helper\resources\players\ and delete Netflix and Youtube players....

Go to my movies or series library and start to play ...pop up window appear with two options:
1) - Play with PlexKodiConnect
2) - Search PlexKodiConnect

enter option 1 nothing happen and
pop up window appear again but now only with option 2

I enter and my main plex folder is open and then i can go in any folders i want and start to play what i want...

For now im happy with that :-)
I hope that @croneter help you soon...

@jurialmunkey can you please contact @croneter and ask him when we can see some progress...

@jurialmunkey can you please contact @croneter and ask him when we can see some progress...

Why don't you?

I'm not interested in bugging him as this isn't a priority issue for me since I don't use PKC. Croneter hasn't made any updates to PKC in a few months, so clearly he's busy with other things.

He just did it :-)
https://github.com/croneter/PlexKodiConnect/issues/1103

@webmaher , @jurialmunkey
Try PKC BETA version 2.10.9. Your search string would need to look like this:

plugin://plugin.video.plexkodiconnect?mode=search&query=YOUR SEARCH STRING HERE

Can you please make a test player :-)

@webmaher - Can you test the below player with the PKC beta? I have no idea if it will work since I don't use PKC but hopefully it will...

{
    "name"              : "PlexKodiConnect",
    "plugin"            : "plugin.video.plexkodiconnect",
    "priority"          : 500,
    "play_movie"        : [
                            "plugin://plugin.video.plexkodiconnect?mode=search&query={title}",
                            {"title": "{title}", "year": "{year}"}
                          ],
    "play_episode"      : [
                            "plugin://plugin.video.plexkodiconnect?mode=search&query={showname}",
                            {"title": "{showname}"},
                            {"season": "{season}"},
                            {"season": "{season}", "episode": "{episode}"}
                          ],
    "search_movie"      : "plugin://plugin.video.plexkodiconnect?mode=search&query={title}",
    "search_episode"    : "plugin://plugin.video.plexkodiconnect?mode=search&query={showname}"
}

If the above doesn't work for play, can you get me screenshots of what happens when you use the search function for each of the movies and episodes search (preferably with a media view that shows a lot of information). In particular, I'm interested in how tvshows are navigated (e.g. does the search show tvshow names or episodes, and what happens when you click on tvshows and each step to get to the episode from the search results).

Thanks 4 this beta version :-)

just a few things about my plex

i have over 10 folders ....
For movies now i have 3:

  • Movies
  • Movies - 4K
  • Movies - 4K Remux

I tested a few movies
and when I got 3 hits with
exactly the same title (is any chance to see also folder name after title name)
first one is from folder Movies, then Movies - 4K and last from Movies - 4K Remux

Then i try with Play PKC and always started movie from folder Movies
Is possible create priority rules from which folder Play PKC must start first, second, third...

And now shows...
i have 2 folders:

  • Series
  • Series - 4K

i tested with Search PKC series:

  • Witcher
  • The Widow

Always found 2 hits from both folders with exactly the same showtitle names (Witcher and The Widow which probably not so good because i start S01E01)
first one is from folder Series and second one from Series - 4K
When push enter i see folder Season 1 and push again to see all episodes...

Then i try play both series S01E01 with Play PKC and always started from folder Series
Is possible create priority rules from which folder Play PKC must start first, second...

This is my Path in library:
D:\01koditeka\serije\The Witcher\Season 1\S01E01 - The Ends Beginning.strm

filename in my Plex:
The Widow 2019 - S01E01 - Mr. Tequila
The Witcher - S01E01 - The Ends Beginning

So if any chance to improve search PKC series to find alway episode which we start from library and of course priority rules ...

For start this is very good because and you even not have Plex ..

Thanks again 4 all your help :-)

You would need something in the title of the Movie/Show which indicates what folder it is from. Otherwise, how would TMDbHelper know what folder it is from if all the info it is presented is exactly the same?

For instance, if you have the title of the 4k version of Alien as "Alien (4K)" then you could do:

{"title": "{title} (4K)", "year": "{year}"}

Alternatively, if you can recreate the exact path to the file consistently, then you can check against file instead:

{"file": "/Path/To/Plex/Kodi/Connect/Movies - 4K/{title}.mkv"}

I have no idea what the path would be - you will need to figure that out yourself. Also, you would need to have very consistent file naming with all the exact same file extensions and so on, so probably not a solution.

Other alternative is to rename your folders so that your preferences have priority by being the first item alphabetically. I imagine "Movies" provides first results because it comes alphabetically before "Movies- 4K". If you rename the "Movies" folder to "Movies - SD" then it will comes after "Movies - 4K" alphabetically, and so won't be chosen first.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kawsiphek picture Kawsiphek  路  8Comments

drinfernoo picture drinfernoo  路  7Comments

drinfernoo picture drinfernoo  路  9Comments

skyfsza picture skyfsza  路  8Comments

prateek33 picture prateek33  路  5Comments