Code Monkey home page Code Monkey logo

emby2jelly's Introduction

Emby2Jelly

Python script to recreate users from emby to jellyfin and migrate their watched content for movies and TV shows.

the script work by asking emby what each user's watched list, and then search them on Jellyfin by their ProviderIds (theTvdb, Imdb...) if ProviderIds are not available, it try to recognize your media by names (Les Animaux fantastiques : Les Crimes de Grindelwald)

***Be sure to have your content identified (It's prefered to refresh missing metadatas on your Library before) ***

Tested with Emby server Version : 4.4.0.40 and Jellyfin server Version : 10.5.4

!! Be sure to make emby and Jelly search for missing metadata, Even each Tvshow Episode need to have their providerIds identified to be correctly migrated


Requirements

python3

json
requests
urllib.parse
configobj
time
getpass

Configuration

simply edit settings.ini with your emby and jelly url and api keys

[Emby]
EMBY_APIKEY = aaaabbbbbbbcccccccccccccdddddddd
EMBY_URLBASE = http://127.0.0.1:8096/
[Jelly]
JELLY_APIKEY = eeeeeeeeeeeeeeeffffffffffffffffggggggggg
JELLY_URLBASE = http://127.0.0.1:8096/ 

# do not forget the trailing slash 

## if you have a custom path, or a reverse proxy, do not forget /emby/ or /jelly/ 

Using

python3 APImain.py 
Migrate from Emby to Jellyfin (or Jellyfin to Jellyfin)
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
			--new-user-pw "change-your-password-9efde123"

users

the script will get user list from Emby,

[user@computer Emby2Jelly]$ python3 APImain.py 
Emby has 1 Users
TestUser (1 / 1) : aaaabbbbbcccc4555577779999444422

Emby part

then very rapidly, it will get the viewed contend for all users from emby

##### EmbySync Done #####

Jelly part

the script will work user by user (create them on Jelly if they don't already exist), asking Jelly for their viewable content

When creating users, the script will ask you for password and confirmation.

TestUser ..  Creating
you will now enter password for user TestUser
Password : 
confirm   : 
TestUser  Created

Identify your media and tell to jelly the user already seen it

working by name when there is no ProviderId

found by name 101 - Towne Hall Follies
found by name 102 - The Quail Hunt

Working by Id the major part

OK ! 1/17 - 101 - Towne Hall Follies has been seen by TestUser

OK ! 2/17 - Night Mission: Stealing Friends Back has been seen by TestUser

OK ! 3/17 - 102 - The Quail Hunt has been seen by TestUser

OK ! 4/17 - Zombie Island... In Space has been seen by TestUser

OK ! 5/17 - An American Story has been seen by TestUser

OK ! 6/17 - Babysitting Unibaby has been seen by TestUser

OK ! 7/17 - Birthday Month has been seen by TestUser

OK ! 8/17 - The Rabbit Who Broke All the Rules has been seen by TestUser

OK ! 9/17 - No More Bad Guys has been seen by TestUser

OK ! 10/17 - Super Axe has been seen by TestUser

OK ! 11/17 - When Night Creatures Attack has been seen by TestUser

OK ! 12/17 - 28 Days Before has been seen by TestUser

OK ! 13/17 - Taxi Cop has been seen by TestUser

OK ! 14/17 - The Dumb List has been seen by TestUser

OK ! 15/17 - 2 Guns has been seen by TestUser

OK ! 16/17 - 2001 : l'odyssée de l'espace has been seen by TestUser

OK ! 17/17 - Alabama Monroe has been seen by TestUser

Result

The script will generate a RESULTS.txt with summary for each user and a list of the media not found :

                      ### Emby2Jelly ###


TestUser Created on Jelly


--- TestUser ---
Medias Migrated : 17 / 18
Unfortunately, I Missed 1 Medias :
[{'Type': 'Episode', 'EmbyId': '97723', 'JellyId': None, 'Name': 'La Griffe du passé', 'ProviderIds': {'Tvdb': '6218102', 'Imdb': 'tt5989942'}}]

Timing

just start the script, sip a beer and i'll be done example with a decent user (2986 media seen)

$time python3 APImain.py
real	5m22,223s
user	0m43,433s
sys	0m1,485s

CONTRIBUTE

Feel free to contribute however you want, I will be a pleasure !

emby2jelly's People

Contributors

marc-vieg avatar nothing4you avatar tetebueno avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.