{"id":16170663,"url":"https://github.com/wardpearce/jellyfin-session-kicker","last_synced_at":"2025-08-21T07:31:51.170Z","repository":{"id":42445528,"uuid":"475582203","full_name":"WardPearce/jellyfin-session-kicker","owner":"WardPearce","description":"Session kicker after X amount of watch time for Jellyfin","archived":false,"fork":false,"pushed_at":"2023-08-23T10:20:37.000Z","size":61,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"Production","last_synced_at":"2024-12-15T16:01:34.764Z","etag":null,"topics":["docker","jellyfin","kick","kicker","limit","limitor","session","time","timeout","watch","whitelist"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WardPearce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-29T19:03:01.000Z","updated_at":"2023-12-01T21:36:01.000Z","dependencies_parsed_at":"2024-10-27T19:19:50.041Z","dependency_job_id":"6c7dea68-edbf-4536-a8d5-9421d4aa8844","html_url":"https://github.com/WardPearce/jellyfin-session-kicker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WardPearce%2Fjellyfin-session-kicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WardPearce%2Fjellyfin-session-kicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WardPearce%2Fjellyfin-session-kicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WardPearce%2Fjellyfin-session-kicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WardPearce","download_url":"https://codeload.github.com/WardPearce/jellyfin-session-kicker/tar.gz/refs/heads/Production","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230501071,"owners_count":18236055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","jellyfin","kick","kicker","limit","limitor","session","time","timeout","watch","whitelist"],"created_at":"2024-10-10T03:19:19.812Z","updated_at":"2024-12-19T20:43:57.331Z","avatar_url":"https://github.com/WardPearce.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Session kicker for Jellyfin\nThis docker image allows you to kick users out of a session after X amount of time. Built with a simple HTTP server so integration into different services \u0026 scripts should be simple.\n\n\nBy default Session kicker will attempt to stop media with commands \u0026 stopping encoding. If stop command not support it will delete the device, you can disable this functionality with `DELETE_DEVICE_IF_NO_MEDIA_CONTROLS`.\n\n\n### or as u/llllllllillllllillll puts it\nThis is useful if you share your server with a bunch of knob heads who use up your monthly internet bandwidth by leaving The Simpsons playing for 12 hours straight\n\n## Documentation\n### Environment variables\n- JELLYFIN_API_KEY - `Required`\n\t- API key for Jellyfin\n- JELLYFIN_API_URL - `Required`\n\t- API URL for Jellyfin\n- DONT_KICK_ITEM_TYPE - `Optional`\n\t- Default `\"movie\"`\n\t- Comma separated list of Item types what shouldn't be tracked, should be lowercase.\n- MESSAGE_TIME_IN_MILLI - `Optional`\n\t- Default `60000`\n\t- Meant to be how long the message displays for, but Jellyfin doesn't respect it.\n- MAX_WATCH_TIME_IN_SECONDS - `Optional`\n\t- Default `50.0`\n\t- Max watch time a user can have in seconds.\n- ITEM_ID_ON_SESSION_KICKED - `Optional`\n\t- Default `\"\"`\n\t- Item ID to play instead of stopping playback, leave blank to disable.\n- WATCH_TIME_OVER_MSG - `Optional`\n\t- Default `\"You aren't whitelisted for unlimited watch time.\"`\n- NOT_WHITELISTED_MSG - `Optional`\n\t- Default `\"You have used up your watch time.\"`\n- RESET_AFTER_IN_HOURS - `Optional`\n\t- Default `24`\n\t- How many hours should the session cache be reset, set as `0` to disable.\n- HTTP_HOST - `Optional`\n- HTTP_PORT - `Optional`\n- MONGO_DB - `Optional`\n\t- By default `\"session_timer\"`\n- MONGO_HOST - `Optional`\n\t- By default `\"localhost\"`\n- MONGO_PORT - `Optional`\n\t- By default `27017`\n- DELETE_DEVICE_IF_NO_MEDIA_CONTROLS  - `Optional`\n\t- If device doesn't support media controls, nuke the device.\n\t- by default `True`\n- ACCRUE_BY_DEVICE_INSTEAD_OF_USER  - `Optional`\n\t- Accrue time per device rather than per user\n\t- by default `False`\n\n### Deployment\n- Download \u0026 configure `docker-compose.yml`\n- `sudo docker-compose build; sudo docker-compose up -d`\n- Proxy exposed port.\n\n### HTTP Server\n#### Authorization\n- Session kicker uses [Basic Auth](https://datatracker.ietf.org/doc/html/rfc7617).\n- Basic Auth credentials are display on initial run.\n    - e.g. `Your basic auth: xxxx`\n\n#### Add user to whitelist for Media type.\n- Method - `POST`\n- Authorization - `Basic Auth`\n- Body - `Json`\n##### Payload\n```json\n{\n\t\"UserId\": \"f521b643f9914b749b9e30bbd06b1792\",\n\t\"MediaTypes\": [\"episode\"]\n}\n```\n\n#### Remove user from whitelist for Media type.\n- Method - `DELETE`\n- Authorization - `Basic Auth`\n- Body - `Json`\n##### Payload\n```json\n{\n\t\"UserId\": \"f521b643f9914b749b9e30bbd06b1792\",\n\t\"MediaTypes\": [\"episode\"]\n}\n```\n#### Get all whitelisted Users.\n- Method - `GET`\n- Authorization - `Basic Auth`\n##### Response\n```json\n[\n\t{\n\t\t\"UserId\": \"f521b643f9914b749b9e30bbd06b1792\",\n\t\t\"MediaTypes\": [\n\t\t\t\"episode\"\n\t\t]\n\t}\n]\n```\n#### Reset HTTP Key\n- Method - `PATCH`\n- Authorization - `Basic Auth`\n\n##### Response\n```json\n{\n\t\"key\": \"d8C9ORsEzjSlUFJx8GMl8VClDmzcRLE_5B5B79Jz0QTtycw0EypqSw\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwardpearce%2Fjellyfin-session-kicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwardpearce%2Fjellyfin-session-kicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwardpearce%2Fjellyfin-session-kicker/lists"}