Skip to main content

Selfhosted Alexa media player skill for Jellyfin

Project description

Jellyfin Alexa Skill

Selfhosted Alexa media player skill for Jellyfin


PyPI - Python Version GitHub

PyPI PyPI - Downloads GitHub Workflow Status

GitHub Workflow Status


Note: This project is still in a very early alpha phase, this means not all features are fully functional yet and features or usage can change significantly between releases. Moreover, new releases can result in data loss of the skill database. Support for playing videos is currently not fully implemented and may lead to unexpected errors.

Table of Contents

  1. About
  2. Features
  3. Installation
  4. Supported languages
  5. Skill speech examples
  6. Project plan
  7. FAQ
  8. Third party notices
  9. License

About

This is a self-hosting Alexa skill to play media from your Jellyfin server. Besides simple playback, other additional functions like playback of playlists or managing favorites are included. The skill and the Jellyfin player can be used behind a NAT or firewall without port opening/forwarding. Since the skill and also the Jellyfin server must be reachable from the outside, in this case the two services are exposed with a tunnel.

Features

  • playback control:
    • play a specific media
    • play media from an artist
    • pause/resume/stop/cancel a playback
    • play previous/next song in queue
    • repeat a single media
    • repeat all media in queue
    • shuffle mode
  • playlist:
    • play a specific playlist
  • favorite:
    • play favorite media
    • mark current media as favorite
    • remove current media from favorites
  • metadata:
    • show the metadata of the media (title and artist)

If you have a feature idea, use this issue template to suggest your idea for implementation.

Installation

Before you begin, make sure you meet the following requirements:

  • up-to-date Jellyfin Server with public or local access
  • free Amazon developer account
  • python 3.6+ or docker + docker-compose installed
  • optional:
    • free ngrok account if you're running a local access server

The initial setup requires several steps:

  1. create a Alexa skill:
    1. go to the Amazon Developer Console webpage for Alexa and create a new skill
    2. now fill out the skill setup settings:
      1. the skill name can be custom, there are no requirements
      2. choose one of the supported languages of this skill for the Primary locale
      3. choose Custom for the model type
      4. choose Provision your own for the skill's backend resources
      5. on the next page choose Start from Scratch
  2. generate SMAPI tokens:
    1. create a new security profile for the SMAPI access described here to get a CLIENT-ID and CLIENT-SECRET
    2. install npm if you have not already installed it and install the ask-cli package: npm install ask-cli -g
    3. now setup the ask cli: ask configure
    4. use the client id and client secret from step i. to generate the refresh token: ask util generate-lwa-tokens --client-id <CLIENT-ID> --client-confirmation <CLIENT-SECRET>

Note: The Skill id is needed for the interaction with the Alexa Skill. The SMAPI access is needed for the automatic setup of the skill.

Use this config file and adjust the values which are commented as required in the config file. Save the file in a safe place, because the file contains sensitive credentials. Also remember the save path, because the config file will be used again later.

Now you are ready to perform the actual installation and startup, you have two options to use the project:

  1. use docker:
    • you can build the image locally or use the prebuild images on Github container registry
      • if you want to build the Docker image locally, use this commands:
        git clone https://github.com/infinityofspace/jellyfin_alexa_skill
        cd jellyfin_alexa_skill
        docker build -t jellyfin_alexa_skill:latest .
        
    • start the skill:
      docker run \
      -v /path/to/the/skill.conf:/var/lib/jellyfin_alexa_skill/config/skill.conf \
      -v /path/to/persistence/skill/data:/var/lib/jellyfin_alexa_skill/data \
      ghcr.io/infinityofspace/jellyfin_alexa_skill:latest
      

OR

  1. with pip:
    • install:
      • from pypi:pip3 install jellyfin_alexa_skill
      • you can also install from source:
        git clone https://github.com/infinityofspace/jellyfin_alexa_skill
        cd jellyfin_alexa_skill
        pip3 install .
        
    • start the skill: jellyfin_alexa_skill --config /path/to/skill.conf --data /path/to/skill/data/

Note: The default path for the skill.conf file is /home/user/.jellyfin_alexa_skill/config/skill.conf and for the skill data path it is /home/user/.jellyfin_alexa_skill/data. You can adjust the paths with the config and data or as environment variables JELLYFIN_ALEXA_SKILL_CONFIG and JELLYFIN_ALEXA_SKILL_DATA. Make sure the skill.conf is writeable.

Now activate the skill in your Alexa app and link your Jellyfin account. Now you can use the skill with your Alexa enabled devices.

Supported languages

The skill has support for the following languages:

  • English
  • German (currently only english Alexa response)

Skill speech examples

The wiki contains examples how to interact with the skill.

Project plan

Take a look at the project plan to see what features and bug fixes are planned and in progress.

FAQ

You can find the FAQ here.

Third party notices

Module License Project
flask-ask-sdk License Project
pyngrok License Project
ask-smapi-sdk License Project
ask-smapi-model License Project
rapidfuzz License Project
peewee License Project
gunicorn License Project
Babel License Project
Flask-WTF License Project

Furthermore, this readme file contains embeddings of Shields.io.

License

GPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jellyfin_alexa_skill-0.2.1.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jellyfin_alexa_skill-0.2.1-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

Details for the file jellyfin_alexa_skill-0.2.1.tar.gz.

File metadata

  • Download URL: jellyfin_alexa_skill-0.2.1.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for jellyfin_alexa_skill-0.2.1.tar.gz
Algorithm Hash digest
SHA256 bdd1a8f94e07c8631a4a1c422d1c1a0c52f13d4a48c3c8626628922e3f52ec27
MD5 e2c35621f93e40b49f84fe186a7448ac
BLAKE2b-256 8c66975c88621fac6e93518e85541352070091025f7405b9356fd6c0fa0541b6

See more details on using hashes here.

File details

Details for the file jellyfin_alexa_skill-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: jellyfin_alexa_skill-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 49.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for jellyfin_alexa_skill-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c535234b2e57efb71970018cfe5e273081164f1d7ba4bd288429398d2135b63
MD5 4109278175cd81fd97eb843131f420ad
BLAKE2b-256 e9666e9f4429cc9c3c3b51014eb5fb91a22b462b236c1bf0877c2b6377631490

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page