marc-vieg / emby2jelly Goto Github PK
View Code? Open in Web Editor NEWpython script to recreate users from emby to jellyfin and migrate their watched content
License: GNU General Public License v3.0
python script to recreate users from emby to jellyfin and migrate their watched content
License: GNU General Public License v3.0
I'm getting an error on the first user while copying watched data.
Traceback (most recent call last):
File "/home/example/Workspace/Emby2Jelly/APImain.py", line 500, in <module>
jelly(newUser_pw)
File "/home/example/Workspace/Emby2Jelly/APImain.py", line 421, in jelly
iterateMigrationData()
File "/home/example/Workspace/Emby2Jelly/APImain.py", line 363, in iterateMigrationData
MigrationMedia['JellyId'] = search_byName(MigrationMedia,Library)
File "/home/example/Workspace/Emby2Jelly/APImain.py", line 335, in search_byName
if jelly_movie['Name'] == MigrationMedia['Name']:
KeyError: 'Name'
if this is due to a missing or misidentified file on the jellyfin side I have no idea how to find it.
Hey,
Can you incorporate the latest commits also into the docker-friendly branch?
Hi
Anyway to Jellyfin2Emby ?
thx
I just ran into the situation that I have marked movie 8 Mile
- https://www.themoviedb.org/movie/65 as watched in Emby.
Both providers don't have a prefix like imdb's tt
, so it looks through my jelly library and finds episode 65 on tvdb - https://thetvdb.com/series/buffy-the-vampire-slayer/episodes/65 which is obviously something completely different.
As this script currently does not check that the IDs belong to the same provider this results in incorrect media matching.
I'd like to dockerize your script, there are some things that would be great maybe you can conditionally read out the ENV variables.
Something along this would probably work.
# Get environment variables
EMBY_APIKEY = os.getenv('EMBY_APIKEY')
EMBY_URLBASE = os.getenv('EMBY_URLBASE')
JELLY_APIKEY = os.getenv('JELLY_APIKEY')
JELLY_URLBASE = os.getenv('JELLY_URLBASE')
so I ran this from my own PC given the layout of the settings.ini file. but in either case Jelly is running on new hardware running on Ubuntu, and Emby is running on an older server inside of a truenas jail.
It seems to pull user data from Emby just fine but then crashes.
`##### EmbySync Done #####
Traceback (most recent call last):
File "APImain.py", line 500, in
jelly(newUser_pw)
File "APImain.py", line 415, in jelly
jellyUsers = jelly_get_users_list()
File "APImain.py", line 187, in jelly_get_users_list
return "error : " + json.loads(response.content.decode('utf-8'))
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
`
I noticed this issue which appeared somewhat similar hence the title #8 (comment)
Awesome script for Movies and TV.
I have an Emby server bunch of video files like YouTube videos etc that aren't on IMDB etc.
Would it be at all possible to match based on filepath / filename instead of a release ID?
hat sich erledigt
Something along the line of:
Option Argument : (only one file can be used at a time, one run to a file, then one run from a file)
--tofile [file] run the script saving viewed statuses to a file instead of sending them to destination server
--fromfile [file] run the script with a file as source server and send viewed statuses to destination server
--newuserpwd "change-your-password-9efde123"
Please add the ability to migrate collections
Im on Windows, and was hoping to pull off the migration from Emby to Jellyfin for my watched files.
I can read off of Emby just fine and create a file. However, when it tries to move to Jellyfin, I'm receiving an error about users? Not sure? I'm moving from the same user to same user, only 1 user available in both Emby and Jellyfin
Traceback (most recent call last):
File "APImain.py", line 498, in
jelly(newUser_pw)
File "APImain.py", line 413, in jelly
jellyUsers = jelly_get_users_list()
File "APImain.py", line 187, in jelly_get_users_list
return "error : " + json.loads(response.content.decode('utf-8'))
File "C:\Users...\Python38\lib\json_init_.py", line 357, in loads
return _default_decoder.decode(s)
File "C:\Users...\Python38\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users...\Python38\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
How possible would it be to add a variable to sync to an existing user? Say I have the same user already created on my new server and I want to move over the status, on a test run it did nothing with that user because it already existed but I wanted to actually force the status over to it.
In the 'create users' step, for every user created, I get a 415 error:
415 -- {
"type":"https://tools.ietf.org/html/rfc7231#section-6.5.13",
"title":"Unsupported Media Type",
"status":415,
"traceId":"00-062998e40550fe4aad8d51b5a7a60e2f-81db80e46d907848-00"
}
Did the API endpoint change? I tried tinkering around with the code but I haven't found a fix. Here's the relevant code:
https://github.com/CobayeGunther/Emby2Jelly/blob/master/APImain.py#L220-L228
Using --fromfile option the selectedUsers list is not populated with data, therefore migration not happen.
I added two lines to the compare_users function after line 204 and then it did the job.
for eUser in MigrationData:
embyList.append(eUser)
if selectedUsers ==[]:
selectedUsers.append(eUser)
I used the master branch, and it worked fine from server to server and with the --tofile option.
I couldn't test the modified version from server2server and with --tofile option as the source server was not available anymore.
Ohtherwise, thanks for the script. It helped me a lot.
on windows, tried running this.
C:\Users\vaise\Downloads\Emby2Jelly>python APImain.py
Traceback (most recent call last):
File "C:\Users\vaise\Downloads\Emby2Jelly\APImain.py", line 15, in
import requests
ModuleNotFoundError: No module named 'requests'
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.