Kodi Community Forum
xbmc.player() - How to get to the subtitles - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
--- Thread: xbmc.player() - How to get to the subtitles (/showthread.php?tid=362217)



xbmc.player() - How to get to the subtitles - JimmySmith2 - 2021-04-22

Hello,

How I can access to the actual subtitles, loaded/enabled currently in xbmc.Player(), when video is played? 

Is there any option, how to:
  1. Find out, if subtitles are enabled or not
  2. find out, what is filepath of currently used subtitles or
  3. find out content of currently used subtitles to be able work with it



RE: xbmc.player() - How to get to the subtitles - black_eagle - 2021-04-23

Probably https://codedocs.xyz/AlwinEsch/kodi/group__python___player.html#ga1b1432e44a29091efef6b236c6010991


RE: xbmc.player() - How to get to the subtitles - JimmySmith2 - 2021-04-23

I already tried 

getAvailableSubtitleStreams() and getSubtitles(), but it seems it returns only string name, for example:

getAvailableSubtitleStreams => ['eng']
getSubtitles => eng

When I downloaded subtitles from opensubtitles to <name>.<sublangid>.srt format.

That doesnt helps me get to the content of the file Sad


RE: xbmc.player() - How to get to the subtitles - JimmySmith2 - 2021-05-16

nobody knows? Sad


RE: xbmc.player() - How to get to the subtitles - Klojum - 2021-05-16

(2021-05-16, 10:25)JimmySmith2 Wrote: nobody knows?

Perhaps create a Github ticket with all possible information if the functionality you're after is incorrect or incomplete.


RE: xbmc.player() - How to get to the subtitles - mvdwetering - 2021-05-16

(2021-05-16, 10:25)JimmySmith2 Wrote: nobody knows? Sad
You can get more information about the subtitles through the JSONRPC interface. More specifically the Player.GetProperties call.

It does not give you the filename I think (also not sure what filename would be for embedded subtitles or DVD), but you can see if subtitles are enabled and which are available.

You can check out the code of my audio/subtitle selection addon (work in progress) for some examples https://github.com/mvdwetering/service.saasbops


RE: xbmc.player() - How to get to the subtitles - JimmySmith2 - 2021-05-16

Thanks, I will check whats avaialable there, but actually the goal is get to the subtitles - My thought is check, lets say some % minutes before video ends, if user has enabled subtitles in Kodi. And if yes (nevermind, if they have it from video container, or copied along video file manually, or use some 3rd party plugin for download them), check, if they are available on OpenSubtitles, and if not, upload them automatically there under users OS credentials.

Check time before video ends should assure, that subtitles are valid and OK (as user watch whole video with them), and it would help any other users, which are using OpenSubtitles to check subtitles..


This forum uses Lukasz Tkacz MyBB addons.