Comments (4)
@Pabsilon I had the same issue, what I did at the end was use wizarr API to get the json from endpoint wizarr_base_url/api/users
then extracted 'id' and 'email' from it. then post '{email: < email>}'to jellyseerr_url/api/v1/user/<id>/settings/main
if id alligns.
You can modify the following python code and add it as Cron job
import requests
# Jellyseerr, wizarr instance variables. MODIFY These!!
J_url=f"http://localhost:5055/api/v1/"
W_url=f"http://localhost:5690/api/"
J_apikey="123456-1234-1234-1234-123456123456dc"
W_apikey="652d4b8b-0b7b-4b7b-8b7b-0b7b4b7b8b7b"
J_header={
'accept': 'application/json',
'Authorization': f'Bearer {J_apikey}'
}
W_header={
'accept': 'application/json',
'Authorization': f'Bearer {W_apikey}'
}
users=requests.get(J_url+"users", headers=J_header).json()
J_users=[]
for user in users:
J_users.append((user["jellyfinUsername"], user["id"]))
users=requests.get(W_url+"users", headers=W_header).json()
W_users=[]
for user in users:
W_users.append((user["username"],user["email"]))
for user in J_users:
for user2 in W_users:
if user[0]==user2[0]:
try:
requests.post(W_url+f"user/{user[1]}/settings/main", headers=J_header, json={'email':user2[1]},timeout=8)
except:
print(f"Error updating user {user[0]}")
This issue is few months old, still I hope someone would benefit from this :)
NB: I haven't tested this but it should work, unless there's some change in API. You can refer the API docs from http://wizarr_ip:5690/api/docs
and jellyseerr_url/api-docs
(might need to enable swagger UI in environment variables)
from wizarr.
Wizarr does not create users on Jellyseerr and thus does not hand emails to Jellyseerr, Wizarr triggers Jellyseerr to import Jellyfin users, this is not a bug, if this is functionality you would like I would suggest adding it over at https://features.wizarr.dev
from wizarr.
Hey, @Sarin-jacob ,
Thanks for your script. It didn't work on my instance, maybe because a typo on the jellyseer urls (endpoint is /users and not /user) so I modified a bit so that it just iterates on jellyseer users without email (either None, "" or equal to username, that's how newly created users show for me) and then tries to match them to wizarrrr users that do have an email.
import requests
# Jellyseerr, wizarr instance variables. MODIFY These!!
J_url=f"http://<jellyseerAddress:port>/api/v1/"
W_url=f"http://<wizarrrrAddress:port>/api/"
J_apikey="<JellySeerApiKey>" # Get it from Settings / General / API Key"
W_apikey="<WizarrrrApiKey>" # Create a new one in Admin Dasboard / Settings / API Keys / Big Red Plus button
# Header for Jellyseer
J_header={
'accept': 'application/json',
'X-Api-Key': f'{J_apikey}'
}
# Header for wizarrrr
W_header={
'accept': 'application/json',
'Authorization': f'Bearer {W_apikey}'
}
# Getting the list of users from Jellyeer that don't have a mail
users=requests.get(J_url+"user?take=50&skip=0&sort=created", headers=J_header).json()
J_users=[]
for user in users["results"]:
# In my case, newly created user in jellyseer have the user set as email
if user["email"] is None or user["email"]=="" or user["email"]==user["jellyfinUsername"]:
J_users.append((user["jellyfinUsername"], user["id"]))
# Getting the list of all users user from wizarrrr that have a mail set
users=requests.get(W_url+"users", headers=W_header).json()
W_users=[]
for user in users:
if user["email"] is not None:
W_users.append((user["username"],user["email"]))
# Calling Jellyseer to set email // Twice because sometimes it doesn't work when it's None
for jelly_user in J_users:
for wizarrrr_user in W_users:
if jelly_user[0] == wizarrrr_user[0]:
# Request Twice because when the email is set to username, it takes a couple attempts...
req = requests.post(J_url+f"user/{jelly_user[1]}/settings/main", headers=J_header, json={"email": wizarrrr_user[1]})
req = requests.post(J_url+f"user/{jelly_user[1]}/settings/main", headers=J_header, json={"email": wizarrrr_user[1]})
Again, thanks for the idea. It saves some time and avoids typing errors!
from wizarr.
This issue is few months old, still I hope someone would benefit from this :)
Very handy script, thanks for your contribution. I'll be sure to post this to users in the discord.
from wizarr.
Related Issues (20)
- [Bug] | Guest User causes Wizarr to remove server access for everyone HOT 2
- IntegrityError: NOT NULL constraint failed: users.email HOT 3
- Feature request add email to jellyfin news letter HOT 1
- [Feature Request] | Emby | Ability to specify whether a user displays on login page HOT 1
- [Bug] | Jellyfin | Default Session Limit
- [Feature] Ability to add both Jellyfin and Plex at the same time. HOT 1
- IntegrityError: NOT NULL constraint failed: users.email
- [Bug] | Emby default authentication provider HOT 1
- [Feature] - Emby new policy defaults
- [BUG] - Change LiveTV default policy for Emby HOT 1
- IntegrityError: NOT NULL constraint failed: users.email HOT 1
- [Bug] | Stable version still shows BETA software banner in about under advanced settings HOT 1
- [Bug] | Plex Home users don't work HOT 2
- [Feature] - Add Emby Connect
- [Feature] | Add expiration date for existing users
- BadRequest: (410) gone; https://plex.tv/api/friends/290024786 <?xml version="1.0" encoding="UTF-8"?> <Respons... HOT 2
- [Bug] | Wizarr shows blank page, console shows "The message port closed before a response was received" HOT 8
- [Language Request] | Turkish - TR Langugage Localization
- [Bug/Solution] | Setting a Github Rate limit for statistics on the site
- [Bug] | Issue when user presses "open" on the plex portion of the invite
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wizarr.