plugin.video.vtm.go icon indicating copy to clipboard operation
plugin.video.vtm.go copied to clipboard

No subtitles

Open Bart80-1 opened this issue 2 years ago • 3 comments

Describe the bug Subtitles not visible when playing video on demand. I noticed it in different programmes but I logged it in Timeless episide 2x08 "The day Reagan was shot" I checked the subtitle settings while displaying the stream, subtitles were not disabled.

To Reproduce Steps to reproduce the behavior: 1.Start Kodi/LibreElec 2.Choose any VOD in VTM Go (see remarks underneath) 3.Start playing. If the program starts with ads you can probably skip them (I did not do this when creating the logfile, but I tried fast forwarding the ads before with the same results) 4. Whenever you would expect subtitles (somebody speaking a non-Dutch sentence) you will see that there are no subtitles.

Remark: in combination with earlier reported issue https://github.com/add-ons/plugin.video.vtm.go/issues/307 I could only log this with programs that are in "mijn lijst" - A-Z is unavailable.

Expected behavior Subtitles when needing them.

Screenshots If applicable, add screenshots to help explain your problem.

Logs Add debug logs to help troubleshoot the issue. See https://kodi.wiki/view/Log_file/Easy for more info. https://paste.kodi.tv/pumaqafoze

System

  • Addon version: 1.2.12+matrix.1
  • Kodi version: 19.1
  • Inputstream adaptive version: 19.0.0.1
  • Operating System (Windows / Mac OS / Android / LibreElec / OSMC / ...): LibreElec 10.0.0
  • Special Hardware (RPI / Vero4K+ / ...):RPI4

Additional context Add any other context about the problem here.

Bart80-1 avatar Nov 11 '21 13:11 Bart80-1

When looking through the log, I can see that the subtitles get downloaded (first lines are in the log + mention of the URL where the VTT file is downloaded - which is correct, I can download the full VTT file for this episode by just browsing to that URL)... I just cannot seem to find where in the code this file (or URL) is communicated to the player? What I did found out meanwhile:

  • Subtitles are localised in resources/lib/vtmgo/vtmgostream.py method _extract_subtitles_from_stream_info(stream_info)
  • The above method is called in resources/lib/vtmgo/vtmgostream.py method get_stream. If not Anvato protocol (not sure what this is - ignoring it for now) they are downloaded locally in line 79 via the _download_subtitles method in the same class. The latter one does a call to resources/lib/vtmgo/util.py method http_get - which I think is confirmed by what's in the log. The subtitle's contents are stored in the subtitles variable.
  • Then an object from class ResolvedStream is created (dependent on the stream type with different parameters) but in all cases, the subtitles property is set to the subtitles variable from above. Also in all cases, this object is returned to the caller of the method...
  • Which seems to be resources/lib/modules/player.py, method "play" (method call is in line 68). The ResolvedStream object is stored in the variable resolved_stream (keep in mind that the property subtitles of this one contains the subtitles). And here comes the part I don't understand: in all further references to this object, various properties of it are consumed (program, title,duration, url...) but never the subtitles. In the method kodiutils.play (line 168) only the url and some other properties are given - but not the subtitles.
  • Also tried to find out if the subtitles are not consumed in the method calling resources/lib/modules/player.py.play . But the ResolvedStream object is not returned in the function (so a caller will typically not have access to it - except if the object is available in some way). Also, in none of the referring functions (resources/lib/modules/player.py "play_or_live" or resources/lib/addon.py I found something that was run after the call to player.py.play that would do something with the subtitles.

So to me it looks like the subtitles are retrieved but never consumed. I am probably missing something - as far as I can see there was no new VTM Go version at the moment it stopped working. But could somebody give me a clue on this?

Thanks!

Bart80-1 avatar Nov 25 '21 22:11 Bart80-1

Hi Bart , having the same issue on Android. Indeed the subtitles are available in /userdata/addon_data/plugin.video.vtm.go/temp as nl.default. I have installed a practical workaround to get the subttitles working. In Kodi\Settings\Player\Language\Download Services I have set a custom Subtitle storage location with this path "../userdata/addon_data/plugin.video.vtm.go/temp". Then I have changed the extension in the plugin script /addons/plugin.video.vtm.go/resources/lib/vtmgo/vtmgostream.py in _extract_subtitles_from_stream_info(stream_info) :
if name == 'nl': name = 'nl.default.srt' # changed to srt Now when you play a movie you can browse and select directly the subtitle in the player. Hope it helps till problem is solved.

frankdpGH avatar Nov 27 '21 17:11 frankdpGH

Thanks Frank for the workaround!

fivage avatar Nov 28 '21 16:11 fivage