2023-11-22, 06:20 AM
(This post was last modified: 2023-11-22, 06:45 AM by tmsrxzar. Edited 1 time in total.)
started looking into this, not sure where you are reading documentation but i logged it in my browser's dev panel
the jellyfin web sends different parameters, specifically the headers and the auth to be more specific
edit
this code works for me
where ADMIN_API_KEY is an api key generated from the dashboard -> api keys
SERVER_URL is my server
JELLYFIN_USER_ID is the user id in the address bar when viewing a user (not a username)
the jellyfin web sends different parameters, specifically the headers and the auth to be more specific
edit
this code works for me
Code:
import requests
ADMIN_API_KEY = '...'
JELLYFIN_SERVER_URL = '...'
JELLYFIN_USER_ID = '...'
headers = {
"X-Emby-Authorization": f'MediaBrowser Token="{ADMIN_API_KEY}"',
"Content-Type": "application/json"
}
data = {"EnableContentDownloading":False,
"AuthenticationProviderId":"Jellyfin.Server.Implementations.Users.DefaultAuthenticationProvider",
"PasswordResetProviderId":"Jellyfin.Server.Implementations.Users.DefaultPasswordResetProvider"}
response = requests.post(f'{JELLYFIN_SERVER_URL}/Users/{JELLYFIN_USER_ID}/Policy', headers=headers, json=data)
print(response.status_code)
where ADMIN_API_KEY is an api key generated from the dashboard -> api keys
SERVER_URL is my server
JELLYFIN_USER_ID is the user id in the address bar when viewing a user (not a username)