autoexec script / run addon on startup - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228) +---- Thread: autoexec script / run addon on startup (/showthread.php?tid=116107) |
autoexec script / run addon on startup - xbmc_atv2 - 2011-12-04 How can a script or addon be started automatically when xbmc starts? A use case would be to start the add-on "Wake_On_Lan" every time xbmc is started. - xbmc_atv2 - 2011-12-05 Found this wiki page saying autoexec.py is obsolete and that an addon can be started using the "start tag". http://wiki.xbmc.org/index.php?title=HOW-TO:Automatically_start_addons_using_services - jhsrennie - 2011-12-06 autoexec.py is still supported in Eden. Services are a special type of add-on and not generally relevant to your question. To have your autoexec.py do a wakeonlan, which is an emminently reasonable use of autoexec.py, create the following autoexec.py in your userdata folder: Code: import xbmc Starting an add-on is slightly, but only slightly, harder because you need to work out what command is needed. To do this add the add-on to your favourites and open favourites.xml in a text editor. For example if I do this with the YouTube add-on, my favourites.xml contains: Code: <favourite name="YouTube" thumb="C:\Users\renniej\AppData\Roaming\XBMC\addons\plugin.video.youtube\icon.png">ActivateWindow(10024,"plugin://plugin.video.youtube/")</favourite> so the script you need would be: Code: import xbmc JR - xbmc_atv2 - 2011-12-06 Excellent, thanks a lot! The built-in function WakeOnLan is exactly what I looked for. Now xbmc on my atv2 brings my NAS out of sleep mode. Will autoexec.py be supported in the final release of Eden (11.0)? Any plans of removing it in Frodo (12.0), or why the comment of obsolete? Is there a similar Perl script that is called upon when xbmc quits? - spiff - 2011-12-07 It's obsolete as a mechanism for addons to start on app launch which it has been misused to for all these years - jhsrennie - 2011-12-07 xbmc_atv2 Wrote:Is there a similar Perl script that is called upon when xbmc quits? No. In principle it would be possible to write a service add-on that used JSON to receive notifications from XBMC, and then you could do whatever you wanted e.g. run specified scripts. JR - The_Flying_Scot - 2011-12-19 jhsrennie Wrote:To have your autoexec.py do a wakeonlan, which is an emminently reasonable use of autoexec.py, create the following autoexec.py in your userdata folder: This is exactly what i want to do but how do i create this script and where does it go! Basicaly i want my NAS to boot up when XBMC starts. Thanks in advance! - jhsrennie - 2011-12-20 The autoexec.py needs to go in your userdata directory. The location of this directory depends on your operating system. See http://wiki.xbmc.org/index.php?title=Profile_directory for details. In Windows press Windows-R and in the Run dialog type: "%appdata%\xbmc\userdata" (including the quotes) and click OK and this will open an Explorer window showing the contents of the userdata folder. autoexec.py is just a text file, but with the suffix ".py" instead of ".txt". Create it with Notepad, gedit, or whatever your preferred text editor is. In Windows make sure Notepad doesn't helpfully tack ".txt" onto the file name i.e. save the file as "autoexec.py.txt". JR - The_Flying_Scot - 2011-12-20 Thanks JR Something so easy, my brain cell was obviously taking the day off!! RE: - foivosv - 2021-07-17 (2011-12-06, 10:25)jhsrennie Wrote: autoexec.py is still supported in Eden. Services are a special type of add-on and not generally relevant to your question. So I found the actions in favorites which is the following one: PlayMedia(“plugin://plugin.video.AliveGR/?action=play&url=https%3A%2F%2Fwww.dailymotion.com%2Fvideo%2Fxqjey2_star-lamia-live-streaming_news&title=STAR+K.E.&image=%2Fhome%2Fosmc%2F.kodi%2Faddons%2Fresource.images.alivegr.logos%2Fresources%2Flogos%2FSTAR+CENTRAL+GR.png&plot=%CE%A7%CF%89%CF%81%CE%AF%CF%82+%CF%80%CE%BB%CE%B7%CF%81%CE%BF%CF%86%CE%BF%CF%81%CE%AF%CE%B5%CF%82&genre=%CE%A4%CE%BF%CF%80%CE%B9%CE%BA%CE%AC”) And I made it like this one: import xbmc xbmc.executebuiltin(“PlayMedia(plugin://plugin.video.AliveGR/?action=play&url=https://www.dailymotion.com/video/xqjey2_star-lamia-live-streaming_news&title=STAR+K.E.&image=/home/osmc/.kodi/addons/resource.images.alivegr.logos/resources/logos/STAR+CENTRAL+GR.png&plot=Χωρίς+πληροφορίες&genre=Τοπικά)”) Did I made it right you think? (I also saved as the suggested name of the file) Thank for your precious time, I am looking forward to a response. P.S. the content of the favorite is a legal video stream from a greek channel which is hosted on dailymotion by the channel itself |