PM4K / PlexMod for Kodi (18, 19, 20, 21, 22+)

Thank you very much, I’ll test it after work.

Dumb question, but what’s the recommended way to update to the beta? I read something about a beta updater but it’s hard for me to find info in this thread, even with the search option.

And another question about the codec logos from the plextuary cpm skin: I realized the logos only show when I play files through kodi directly. If I play them through pm4k I can’t see them. Is this supposed to happen? I could have sworn it used to work through pm4k as well.

1.0.5f stable pushed to Don’t Panic repository. Includes the backported Watchlist fix.

3 Likes

You need to set your PM4K to the beta channel (inside normal settings). Then it’ll auto update via its integrated service.

It’s kind of buggy, though, you can make sure to just restart Kodi when you know there’s a new beta, and it’ll offer it.

A proper updater addon is what I’m currently working on.

Hmm no that should still happen (just tested it myself, I see them).

I just tested the beta and the new glitch works. However, I’m back to beta 4.2, which works perfectly for me and behaves like the other add-ons.

OK, why, exactly? The new approach is much less risky.

Edit: We just append the glitch to running PM4K instead of trying to do it at first (which poses potential issues)

Thanks, I updated to the latest beta and now everything is working as intended!

I’ve left the “hack” enabled this time. I almost don’t notice the “blip” now.

1 Like

It’s not that much of a “hack” anymore, I guess. We simply access our program/plugin endpoint (script.plexmod has three endpoints: script (main), service (background), program (unused)) once we exit the script. This triggers the lastused value in Kodi.

It’s far from elegant, but sufficient for what we want to do.

Edit: I tried asking the Kodi guys on whether it’s possible to properly programmatically update lastused of an addon and got no answer. From looking at the source code, there doesn’t seem to be any way to do so. That means what we’re doing is not intended, but probably also the most sane way to achieve what we want.

2 Likes

cannot exit PM4K with latest version on Fire Stick any more - just gets stuck on grey box with animating 3 yellow dots. makes no difference if the new last used option is checked or not. have to reboot device at this point.

can’t use the log uploader right now, but this is from the tail:

2025-12-06 13:54:41.152 T:5307     info <general>: script.plexmod: Home: Showing exit confirmation dialog
2025-12-06 13:54:41.153 T:5307    debug <CSettingsManager>: requested setting (exit_default_is_quit) was not found.
2025-12-06 13:54:41.197 T:4518    debug <general>: ------ Window Init (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-options_dialog.xml) ------
2025-12-06 13:54:41.198 T:4518     info <general>: Loading skin file: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-options_dialog.xml, load type: LOAD_ON_GUI_INIT
2025-12-06 13:54:42.302 T:4514    debug <general>: CAndroidKey: key down (dev: 7; src: 769; code: 23 (AKEYCODE_DPAD_CENTER); repeat: 0; flags: 0x8; alt: no; shift: no; sym: no)
2025-12-06 13:54:42.321 T:4518    debug <general>: Keyboard: scancode: 0x17, sym: 0x0d (enter), unicode: 0x00, modifier: 0x0
2025-12-06 13:54:42.383 T:4514    debug <general>: CAndroidKey: key up (dev: 7; src: 769; code: 23 (AKEYCODE_DPAD_CENTER); repeat: 0; flags: 0x8; alt: no; shift: no; sym: no)
2025-12-06 13:54:42.404 T:4518    debug <general>: Keyboard: scancode: 0x17, sym: 0x0d (enter), unicode: 0x00, modifier: 0x0
2025-12-06 13:54:42.405 T:4518    debug <general>: HandleKey: return (0xf00d) pressed, window 13003, action is Select
2025-12-06 13:54:42.421 T:4518    debug <general>: ------ Window Deinit (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-options_dialog.xml) ------
2025-12-06 13:54:42.490 T:5307     info <general>: script.plexmod: Home: Initiating shutdown, setting background
2025-12-06 13:54:42.491 T:5307     info <general>: script.plexmod: Home: doClose called, triggering close.windows
2025-12-06 13:54:42.491 T:5307     info <general>: script.plexmod: SettingsWindow: doClose called, force: True
2025-12-06 13:54:42.527 T:4518    debug <general>: CGUIWindowManager::PreviousWindow: Deactivate
2025-12-06 13:54:42.527 T:4518    debug <general>: ------ Window Deinit (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-home.xml) ------
2025-12-06 13:54:42.527 T:4518    debug <general>: Activating window ID: 10000
2025-12-06 13:54:42.527 T:4518    debug <general>: ------ Window Init (Home.xml) ------
2025-12-06 13:54:42.537 T:5307     info <general>: script.plexmod: HomeWindow: doClose called, force: True
2025-12-06 13:54:42.541 T:4518    debug <general>: CGUIWindowManager::PreviousWindow: Deactivate
2025-12-06 13:54:42.541 T:5307     info <general>: script.plexmod: Cron: Receiver canceled: <lib.windows.home.HomeWindow object at 0xba058de0>
2025-12-06 13:54:42.542 T:5307     info <general>: script.plexmod: Main: Starting hard exit timer of 5 seconds...
2025-12-06 13:54:42.542 T:5307     info <general>: script.plexmod: Home: shutdown called
2025-12-06 13:54:42.543 T:5307     info <general>: script.plexmod: Stopping request retries
2025-12-06 13:54:42.543 T:5307     info <general>: script.plexmod: Home: unhooking signals
2025-12-06 13:54:42.543 T:5307     info <general>: script.plexmod: Home: exiting shutdown method
2025-12-06 13:54:42.558 T:4518    debug <general>: Activating window ID: 13000
2025-12-06 13:54:42.579 T:4518    debug <general>: ------ Window Deinit (Home.xml) ------
2025-12-06 13:54:42.579 T:4518    debug <general>: FreeVisualisation() done
2025-12-06 13:54:42.588 T:4518    debug <general>: ------ Window Init (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-background.xml) ------
2025-12-06 13:54:42.596 T:4518    debug <general>: Error [-541478725] while reading frame: Unknown error 541478725
2025-12-06 13:54:42.658 T:5307     info <general>: script.plexmod: Main: SHUTTING DOWN...
2025-12-06 13:54:42.658 T:5307    debug <CSettingsManager>: requested setting (persist_requests_cache) was not found.
2025-12-06 13:54:42.658 T:5307     info <general>: script.plexmod: Main: Clearing requests cache...
2025-12-06 13:54:42.698 T:5307     info <general>: script.plexmod: PlexInterface: Cleared requests cache.
2025-12-06 13:54:42.699 T:5307     info <general>: script.plexmod: API: DEBUG: Closing server...
2025-12-06 13:54:42.731 T:5307    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'HTTPConnectionPool' object has no attribute 'cancel'
                                                   Traceback (most recent call last):
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/lib/windows/kodigui.py", line 186, in onInit
                                                       self._onInit()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/lib/windows/kodigui.py", line 255, in _onInit
                                                       self.onFirstInit()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/lib/windows/background.py", line 25, in onFirstInit
                                                       self.function()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/lib/main.py", line 330, in _main
                                                       plexapp.util.APP.preShutdown()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/lib/_included_packages/plexnet/plexapp.py", line 122, in preShutdown
                                                       SERVERMANAGER.selectedServer.close()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/lib/_included_packages/plexnet/plexserver.py", line 113, in close
                                                       self.session.cancel()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/lib/_included_packages/plexnet/asyncadapter.py", line 398, in cancel
                                                       v.cancel()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/lib/_included_packages/plexnet/asyncadapter.py", line 315, in cancel
                                                       c.cancel()
                                                       ^^^^^^^^
                                                   AttributeError: 'HTTPConnectionPool' object has no attribute 'cancel'
                                                   -->End of Python script error report<--
                                                   
2025-12-06 13:54:42.758 T:5447     info <general>: script.plexmod: Player: Closed
2025-12-06 13:54:47.543 T:8220     info <general>: script.plexmod: Main: script.plexmod: timer hit, triggering hard exit...

Thanks, will be fixed in next beta.

1 Like

Is there a possibilty to disable transcoding playback? I want to play all my files (audio and video stream) only in direct play mode.

If it’s not possible, I’m missing some information about the playback. In the offical Android Plex Client there are a lot of playback informations and when transcoding you can read why it’s transcoding. Please have a look at the screenshot.

It’s annoying to have a look at this menu every time you start a playback just to be sure the playback is really direct play.

server side. settings, transcoder

Screenshot 2025-12-06 173917

1 Like

1.1.4-beta1: script.plexmod.zip (3.2 MB)

Changelog:

  • Player: Embedded subtitles: Fix parsing mis-tagged Kodi subtitle offset (stream tagged as “pt (BR)” for example gets parsed by Kodi as “pt-”, which is invalid and lead to errors in PM4K)
  • Core/Plexnet: Don’t fail on HTTPConnectionPool.cancel
  • SeekHandler/Blackout: Make sure we arrive at a correct volume; might fix “no sound” issues after seeking
13 Likes

I am having issues with this plugin playing files in external player (MPC-HC). Playing directly opens correctly in MPC-HC. Does anyone have this setup?

Care to supply some logs and your external player Config maybe? I don’t have a crystal ball, yet :slight_smile:

Edit: you didn’t even care to list what issues you have. Come on, dude.

Just updated to latest from 0.7.9-rev4. Feels a lot snappier. Thanks a lot for continuing to maintain this.

Any reason to enable local preference vs http? Doesn’t this do that already if I’m in the same subnet/vlan? Same question for the smb shares - what’s the benefit over using it the way I was using it before without that? My host plex PC is on the same LAN as my Kodi playback client.

Also, any pictures of estuary theme?

Cheers. If it’s already hit skip outro, I’d expect there’s not a lot (if any) of the file left to buffer…

All CPM skins should work, but perhaps there are still some adjustments that can be made? Hopefully, PM4K is as compatible with AVDVPLUS.R1 as Jamal’s last 21.3 + A14 build.