Kodi incompatibility with Python script
#1
I use Kodi with the external player MPV. In MPV, I trigger a .lua script that loads a Python script that searches and downloads subtitles with Ctrl + S. This works fine when simply opening a video by double clicking it (as a file on a folder, outside of Kodi), but when I open the video from Kodi, the script crashes when a subtitle is found and attempted to be downloaded, getting a Windows troubleshooter error saying that "Python has stopped working"
Reply
#2
Bump.
Reply
#3
It's a bit unclear as too what routines are being used for the download and operation, on one hand it;'s a stand alone script, then you run Kodi and use an external viewer, activate the script then at that point you have the crash, which should still be external to Kodi, which makes me think of a stack overflow or some buffer over capacity, or just plain out of memory. Work round would be to use the standalone feature exclusively.
Reply
#4
I believe the subtitle searcher in Kodi only works while using the internal player (which I don't want to use), so I'll try asking the people who made the scripts if they know what's up.

This is the error log:
Code:
Problem signature:
  Problem Event Name:    BEX
  Application Name:    python.exe
  Application Version:    3.5.1150.1013
  Application Timestamp:    576eff6a
  Fault Module Name:    ucrtbase.DLL
  Fault Module Version:    10.0.10137.0
  Fault Module Timestamp:    556ebf74
  Exception Offset:    000764eb
  Exception Code:    c0000409
  Exception Data:    00000007
  OS Version:    6.2.9200.2.0.0.768.101
  Locale ID:    1033
  Additional Information 1:    acae
  Additional Information 2:    acaed1a5d52c6ba50fb191bdec3e72f9
  Additional Information 3:    c5e6
  Additional Information 4:    c5e64ea88ef509ea702ac8a9fe780b42
Reply
#5
Bumping because I've asked the devs of both the script for MPV and the one to fetch subtitles, and both point me here. My guess as a non-developer is that I have a separate install of Python running this script - is there any chance I could either use Kodi's Python implementation to do it, or disable Kodi's Python? Because I believe they're clashing one another.
Reply
#6
Since your python install is crashing in ucrtbase.dll (the Visual Studio 2015 C language run time) I don't see how that has anything to do with Kodi. You didn't note which version of Kodi you run; Ver 17 requires the VS 2015 runtime but IIRC 16 is OK with 2013.

Kodi runs Python 2.7.10 if that makes a difference to you.

scott s.
Reply
#7
I'm running Kodi 17 beta 6... so could that mean it's something with Kodi?

I tried running Python 2.7, but the script has problems with it (as in, outside of Kodi). I need Python 3.5 for it to run properly (which I have installed on Windows).

I'm gonna try running this on Kodi 16 and see what happens.

edit: Jarvis

Code:
Problem signature:
  Problem Event Name:    BEX
  Application Name:    python.exe
  Application Version:    3.5.1150.1013
  Application Timestamp:    576eff6a
  Fault Module Name:    ucrtbase.DLL
  Fault Module Version:    10.0.10240.16390
  Fault Module Timestamp:    55a5bf73
  Exception Offset:    0007d84b
  Exception Code:    c0000409
  Exception Data:    00000007
  OS Version:    6.2.9200.2.0.0.256.48
  Locale ID:    13322
  Additional Information 1:    acae
  Additional Information 2:    acaed1a5d52c6ba50fb191bdec3e72f9
  Additional Information 3:    10ec
  Additional Information 4:    10ecf6d2c9f1c83ef6d7b1fa699424d0
Reply
#8
I believe it's most definitely a problem with Kodi. I tried yet another script that uses subliminal (https://github.com/wiiaboo/mpv-scripts/b.../subit.lua), and the same problem appears only when opening the video from Kodi. Using latest stable build, on a formatted computer, too.
Reply
#9
Well for starters the error log suggests you are running Win 8.0 which isn't well-supported at this point. Since ucrtbase is now OS dependent, that's the first thing I would look at. It might be that since you are launching from Kodi, maybe Python 3.5 is not running in the correct context. A troubleshooting tool like Procexp or Procmon might give you insight into what is going wrong.

scott s.
.
Reply
#10
First of all, thanks for staying with me all through this.

I've recorded a log with Procmon consisting of opening Kodi > opening a video (with MPV) > searching for a subtitle (with one script) > searching for a subtitle (with another). The result being that neither script searches for subtitles, and that instead both immediately jump to a "Subtitle search failed" message - no Python crash though (I believe this would happen either because of another version of Kodi, or another version of Python). The log was huge, so I narrowed it down to the first appearance of Python, until the last:
https://mega.nz/#!HAcUHYhK!bVULUKRuWcumb...YvuqQqXqwM


It's somewhat of a relief if this is actually OS-dependent, as I hope to jump out of Windows in the future - but still, I'll probably stay here for a while, and as of now it's a big inconvenient for my setup (that is nevertheless not as inconvenient as having to abandon MPV). I don't have any computers running a different OS to test this out, so if you, or anybody else reading this, can try it themselves, it'd be a big help. The process from beginning to end, to get this running, is:

1. Download MPV: https://mpv.io/installation/
2. Set up Kodi to launch videos with MPV: http://kodi.wiki/view/External_players
3. Download Python, if not already present on the OS
4. On your OS's console, run "pip install subliminal"
5. Create a "scripts" folder, on the same location were you have mpv.exe
6. Save either of these scripts, as "autosub.lua"/"subit.lua", on the "scripts" folder: https://gist.github.com/selsta/ce3fb37e775dbd15c698 / https://github.com/wiiaboo/mpv-scripts/b.../subit.lua
7. Change the "etc/etc/etc/subliminal.exe" path were specified on the script, to the one were you have "subliminal.exe"
8. Load up a video from Kodi, press "b" or "d" depending on the script (note that these aren't the same as pressing "B" or "D") to search for subtitles
9. See it fail immediately
10. Load up a video on MPV, without Kodi, and see it at least try to find the subtitle

Hope this can narrow down the error!
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi incompatibility with Python script0