wardpearce / jellyfin-session-kicker Goto Github PK
View Code? Open in Web Editor NEWSession kicker after X amount of watch time for Jellyfin
License: GNU Affero General Public License v3.0
Session kicker after X amount of watch time for Jellyfin
License: GNU Affero General Public License v3.0
os.getenv(A, B) looks for env variable A and returns B as a default if it doesn't exist. However variable B is always returned as a string, regardless of what the function was called with.
For DELETE_DEVICE_IF_NO_MEDIA_CONTROLS, B is set to the bool False, which gets converted to the string "False". This will always True for bool("False") since the string is not empty. This is a very annoying oversight from the python developers. A better check is:
DELETE_DEVICE_IF_NO_MEDIA_CONTROLS = os.getenv("DELETE_DEVICE_IF_NO_MEDIA_CONTROLS", "True").lower() == "true"
I've created a PR that includes this change. This PR also includes a new env variable that allows time to be accrued by DeviceId rather than UserId. So the same user with multiple devices is treated differently.
PR: #27
I've tried several different ways to perform a GET request, making sure to include the Authorization header with the given basic token supplied at runtime, and I always received invalid auth. Here's an example of request and response:
root@63fa9d5d9c8b:/# curl jellyfin-session-kicker --header "Authorization: basic TJziSL1bx4X8fYLJZnlZHxyXOjvUgLdXXPGtbn7NyAgOsj4leJohXQ"
{"error": "Invalid basic auth credentials"}
I would greatly appreciate any help figuring this out! Or providing another means to whitelist would also work.
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.