• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Media Scanning & Identification Jellyfin for kodi: Scan on start

     
    • 0 Vote(s) - 0 Average

    Jellyfin for kodi: Scan on start

    A way to trigger a Phyton script when Kodi starts?
    Ejz
    Offline

    Junior Member

    Posts: 4
    Threads: 1
    Joined: 2024 Jan
    Reputation: 0
    #2
    2024-01-14, 02:19 PM
    Okay I think I actually managed to code my first phyton script and get it to run on kodi start.. :P


    Android\data\org.xbmc.kodi\files\.kodi\addons\service.autoexec\autoexec.py

    Code:
    import requests

    headers = {
        'Content-Type': 'application/x-www-form-urlencoded',
    }

    params = {
        'api_key': 'JELLY-API-KEY',
    }

    response = requests.post('http://YOUR-IP:PORT/library/refresh', params=params, headers=headers)

    And then also

    Android\data\org.xbmc.kodi\files\.kodi\addons\service.autoexec\addon.xml

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <addon id="service.autoexec" name="Autoexec Service" version="1.0.0" provider-name="your username">
    <requires>
    <import addon="xbmc.python" version="3.0.0"/>
    <import addon="script.module.requests" version="3.0.0"/>
    </requires>
    <extension point="xbmc.service" library="autoexec.py">
    </extension>
    <extension point="xbmc.addon.metadata">
    <summary lang="en_GB">Automatically run python code when Kodi starts.</summary>
    <description lang="en_GB">The Autoexec Service will automatically be run on Kodi startup.</description>
    <platform>all</platform>
    <license>GNU GENERAL PUBLIC LICENSE Version 2</license>
    </extension>
    </addon>
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    Jellyfin for kodi: Scan on start - by Ejz - 2024-01-14, 01:29 PM
    RE: Jellyfin for kodi: Scan on start - by Ejz - 2024-01-14, 02:19 PM
    RE: Jellyfin for kodi: Scan on start - by TheDreadPirate - 2024-01-14, 05:16 PM
    RE: Jellyfin for kodi: Scan on start - by Ejz - 2024-01-14, 05:52 PM
    RE: Jellyfin for kodi: Scan on start - by TheDreadPirate - 2024-01-14, 06:09 PM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode