audiogenerators-write.rst 1.2 KB

1234567891011121314151617181920212223242526272829
  1. Write your own audiogenerator
  2. =============================
  3. It's easy to have situations where you want to run your own custom
  4. audiogenerator. Fetching music with some very custom logic? Checking RSS
  5. feeds? Whatever. There are two main strategies to add audiogenerators to
  6. ``larigira``: scripts and setuptools entrypoints. Scripts are easier.
  7. setuptools entrypoints are somewhat "tidier". We suggest writing entrypoints if
  8. you want to distribute your code somehow. If your script is so custom that only
  9. makes sense to you, a script can be enough.
  10. writing a script
  11. -----------------
  12. a script is an executable file. The programming language is completely to your
  13. choice: bash, perl, python, compiled C code, ``larigira`` doesn't care.
  14. It must be in a specific directory (``~/.config/larigira/scripts/``), be
  15. executable (as in ``chmod +x``), and be owned by the same user running
  16. larigira.
  17. When executed, this script must output URIs, one per line. Only UTF-8 is
  18. supported as encoding. The script should expect limited environment (for
  19. security reaons). Please also see :mod:`larigira.audiogen_script` for more
  20. details.
  21. writing an audiogen entrypoint
  22. ------------------------------
  23. TODO