Command to select the most recent video of a list
#1
Question 
Hello all,

I am just starting to play with the Python libraries and I am a little bit lost.

Basically what I am trying to achieve is to press one button on my remote and go directly to the most recent video listed by a plugin.

I added the following line in ~/.kodi/userdata/keymaps/gen.xml and that part works, the script is executed when I push the button:
Code:
<key id="251">RunScript(/home/osmc/.kodi/userdata/scripts/test.py)</key>

My script test.py:
Code:
#! /usr/bin/env python
import xbmc
xbmc.executebuiltin('ActivateWindow(10025,"plugin://plugin.video.belgium/?action=show_videos&channel_id=rtbf&id=9&url=https%3a%2f%2fwww.rtbf.be%2fauvio%2femissions%2fdetail_le-12-minutes%3fid%3d9")') # go to video list
xbmc.executebuiltin('Container.Refresh') # refresh the list to get the last episodes
xbmc.executebuiltin('Container.SetSortMethod(2)') # sort by date
??? # select the first video
??? # play it

Now I am looking to select the first video in the list (the most recent one) but I cannot find how to do. Does anybody know? Or does anybody know if there is a better way to do?
#2
Nobody? I cannot believe that is not possible.
#3
This isn't the best place to ask this question (the question is not pi-specific).
Might get a better response in the add-on developers forum?
#4
Yes you are right. I asked the question here: https://forum.kodi.tv/showthread.php?tid=321530

Thanks
#5
Since you found the correct sub-forum I will close this thread.
Always read the Wiki, FAQ and search the forum before posting.
Read/follow the forum rules.

Logout Mark Read Team Forum Stats Members Help
Command to select the most recent video of a list0