Jump to content

Python script: Emby MDBList Collection Creator


Recommended Posts

Posted (edited)

@shorty1483There was an issue with local paths for posters. An extra slash in the url that only caused bug if I ran the script on my local Emby test server but didn't affect anything when I used on my remote server. It's OK to use spaces in the path btw. It's updated on GitHub.

@rbjtechYou mean this repo right? https://github.com/Kometa-Team/Default-Images?tab=readme-ov-file 
According to the readme they seem to be cool with anyone using them. Adding direct url to the script will only pull the image the first time so not too bad bandwidth wise 😅

 

Edited by Amything
  • Like 1
Posted (edited)
6 minutes ago, Amything said:

@rbjtechYou mean this repo right? https://github.com/Kometa-Team/Default-Images?tab=readme-ov-file 
According to the readme they seem to be cool with anyone using them. Adding direct url to the script will only pull the image the first time so not too bad bandwidth wise 😅

That's the one .. 👍

Not sure you can direct link though, you'll need to be logged into Github I believe ..

Edited by rbjtech
Posted

btw @Amything- there is a little bug/issue in the system adding items if you name your collection with a '+' in it - ie Apple TV+, Paramount+ etc

If you use 'Plus' then no issues ;)

 

  • Like 1
adminExitium
Posted (edited)
1 hour ago, rbjtech said:

Not sure you can direct link though, you'll need to be logged into Github I believe ..

You can, just add ?raw=true to the image URL like https://github.com/Kometa-Team/Default-Images/blob/master/chart/AniDB Popular.jpg?raw=true to get the raw image URL: https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/chart/AniDB Popular.jpg

Edited by adminExitium
  • Thanks 1
Posted (edited)
35 minutes ago, adminExitium said:

Thanks - you can indeed - I'll update my URL's .. 👍

Working examples below ..

[Oscars 2024]
source = https://mdblist.com/lists/squint/the-96th-academy-awards
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/award/oscars/2024.jpg
frequency = 100
update_items_sort_names = False

[Trending TV Shows]
Source = https://mdblist.com/lists/teddysmoot/trending-new-shows
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/chart/white/Trakt Trending.jpg
Frequency = 100
update_items_sort_names = False

[Netflix TV Shows]
Source = https://mdblist.com/lists/garycrawfordgc/netflix-shows
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Netflix_shows.jpg
Frequency = 100
update_items_sort_names = False

[Netflix Movies]
Source = https://mdblist.com/lists/garycrawfordgc/netflix-movies
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Netflix_movies.jpg
Frequency = 100
update_items_sort_names = False

[Paramount Plus TV Shows]
Source = https://mdblist.com/lists/sig1878/cbs-all-access
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Paramount+_shows.jpg
Frequency = 100
update_items_sort_names = False

[Paramount Plus Movies]
Source = https://mdblist.com/lists/sig1878/movies-paramount-plus
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Paramount+_movies.jpg
Frequency = 100
update_items_sort_names = False

[Hulu Shows]
Source = https://mdblist.com/lists/garycrawfordgc/hulu-shows
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Hulu_shows.jpg
Frequency = 100
update_items_sort_names = False

[Hulu Movies]
Source = https://mdblist.com/lists/garycrawfordgc/hulu-movies
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Hulu_movies.jpg
Frequency = 100
update_items_sort_names = False

[HBO Max Shows]
Source = https://mdblist.com/lists/garycrawfordgc/hbo-shows
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Max_shows.jpg
Frequency = 100
update_items_sort_names = False

[Apple TV Plus Shows]
Source = https://mdblist.com/lists/hdlists/apple-tv-shows-series-2021-2025,https://mdblist.com/lists/jonfinley/apple-tv-tv-show-originals
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Apple TV+_shows.jpg
Frequency = 100
update_items_sort_names = False

[Apple TV Plus Movies]
Source = https://mdblist.com/lists/JassyCliq/apple-tv-movies
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Apple TV+_movies.jpg
Frequency = 100
update_items_sort_names = False

[Disney Plus Shows]
Source = https://mdblist.com/lists/garycrawfordgc/disney-shows
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Disney+_shows.jpg
Frequency = 100
update_items_sort_names = False

[Disney Plus Movies]
Source = https://mdblist.com/lists/garycrawfordgc/disney-movies
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Disney+_movies.jpg
Frequency = 100
update_items_sort_names = False

[Amazon Prime Shows]
Source = https://mdblist.com/lists/garycrawfordgc/amazon-prime-shows
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Prime Video_shows.jpg
Frequency = 100
update_items_sort_names = False

[Amazon Prime Movies]
Source = https://mdblist.com/lists/garycrawfordgc/amazon-prime-movies
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/streaming/Prime Video_movies.jpg
Frequency = 100
update_items_sort_names = False

[BBC Shows]
Source = https://mdblist.com/lists/garycrawfordgc/bbc-shows
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/studio/BBC Studios.jpg
Frequency = 100
update_items_sort_names = False

[IMDB Top 250]
Source = https://mdblist.com/lists/traktfanone/imdb-top250
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/chart/IMDb Top 250.jpg
Frequency = 100
update_items_sort_names = False

[Christmas Movies]
Source = https://mdblist.com/lists/hdlists/christmas-movies
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/seasonal/christmas.jpg
Frequency = 100
update_items_sort_names = True
active_between = 11-01, 01-07

[Halloween]
Source = https://mdblist.com/lists/hdlists/the-top-100-halloween-movies-of-all-time
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/seasonal/halloween.jpg
active_between = 09-30, 11-01
Frequency = 100
update_items_sort_names = True

[DC Universe Movies]
Source = https://mdblist.com/lists/sumofd/dc-universe-movies
poster = https://raw.githubusercontent.com/Kometa-Team/Default-Images/refs/heads/master/universe/dcu.jpg
Frequency = 100
update_items_sort_names = True

 

Edited by rbjtech
Posted (edited)

first time here and i dont know where to get started with this, if anyone can help me that would be great. 

I have unraid server locally but my emby server is in datacenter. I've moved the files onto my server. im new to this 

Edited by xbmconnect
Posted
5 hours ago, xbmconnect said:

first time here and i dont know where to get started with this, if anyone can help me that would be great. 

I have unraid server locally but my emby server is in datacenter. I've moved the files onto my server. im new to this 

If you are kinda new to this type of stuff I would just run it on your main desktop machine to start with and worry about putting it on a server later. 

  • Open a cmd window and do "pip install requests" (one time only)
  • Put the script in some folder
  • Copy config.cfg and rename it config_hidden.cfg
  • Fill in config_hidden.cfg by reading it carefully
  • Open cmd window, go to your script folder and type "python app.py" in the cmd window
Posted
1 hour ago, Amything said:

If you are kinda new to this type of stuff I would just run it on your main desktop machine to start with and worry about putting it on a server later. 

  • Open a cmd window and do "pip install requests" (one time only)
  • Put the script in some folder
  • Copy config.cfg and rename it config_hidden.cfg
  • Fill in config_hidden.cfg by reading it carefully
  • Open cmd window, go to your script folder and type "python app.py" in the cmd window

ok so i think i have it down but getting connection issue of my emby url and etc. https://imgur.com/a/qxnKam7 do you have a discord?

Posted

I tried editing / deleting the post above it seems I cant. 

anyway I believe got it work but not seeing anything on the emby app in collection? but this is what's on the CMD which i dont quite understand 

Error occurred while getting collections using url https://jussaren-cdn.xxxxxxxx.world//emby/users/xxxxxxx/items?Fields=ChildCount,RecursiveItemCount&Recursive=true&IncludeItemTypes=boxset: Expecting value: line 1 column 1 (char 0). Response: <Response [500]>
Traceback (most recent call last):
  File "D:\Downloads\Emby-MDBList-Collection-Creator\app.py", line 340, in <module>
    main()
  File "D:\Downloads\Emby-MDBList-Collection-Creator\app.py", line 296, in main
    process_hardcoded_lists()
  File "D:\Downloads\Emby-MDBList-Collection-Creator\app.py", line 244, in process_hardcoded_lists
    process_list(mdblist_list)
  File "D:\Downloads\Emby-MDBList-Collection-Creator\app.py", line 73, in process_list
    collection_id = emby.get_collection_id(collection_name)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Downloads\Emby-MDBList-Collection-Creator\src\emby.py", line 311, in get_collection_id
    for collection in all_collections:
                      ^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

adminExitium
Posted
19 hours ago, rbjtech said:

I'll update my URL's

Just a tip, you may want to use the permalinks from GH rather than the direct links in case they change the repository layout again. Has happened before and broke my collections 😅.

  • Thanks 1
Posted
14 hours ago, Amything said:

If you are kinda new to this type of stuff I would just run it on your main desktop machine to start with and worry about putting it on a server later. 

  • Open a cmd window and do "pip install requests" (one time only)
  • Put the script in some folder
  • Copy config.cfg and rename it config_hidden.cfg
  • Fill in config_hidden.cfg by reading it carefully
  • Open cmd window, go to your script folder and type "python app.py" in the cmd window

So, i've been trying what I can but this seems to give me this error  sorry i had to hide my url i looked up the line on app.py and not sure if I have to change anything to it to make it work and do i have to do anything on the emby app to show collections. I'm not understanding, i've read thru the githuib, read me, i have no clue on what to do now. 

Quote

PS D:\Downloads\Emby-MDBList-Collection-Creator-main> python app.py
Error occurred while getting collections using url https://jussaren.----------/emby/users/-------/items?Fields=ChildCount,RecursiveItemCount&Recursive=true&IncludeItemTypes=boxset: Expecting value: line 1 column 1 (char 0). Response: <Response [500]>
Traceback (most recent call last):
  File "D:\Downloads\Emby-MDBList-Collection-Creator-main\app.py", line 340, in <module>
    main()
  File "D:\Downloads\Emby-MDBList-Collection-Creator-main\app.py", line 296, in main
    process_hardcoded_lists()
  File "D:\Downloads\Emby-MDBList-Collection-Creator-main\app.py", line 244, in process_hardcoded_lists
    process_list(mdblist_list)
  File "D:\Downloads\Emby-MDBList-Collection-Creator-main\app.py", line 73, in process_list
    collection_id = emby.get_collection_id(collection_name)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Downloads\Emby-MDBList-Collection-Creator-main\src\emby.py", line 311, in get_collection_id
    for collection in all_collections:
                      ^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

 

Posted
3 minutes ago, xbmconnect said:

So, i've been trying what I can but this seems to give me this error  sorry i had to hide my url i looked up the line on app.py and not sure if I have to change anything to it to make it work and do i have to do anything on the emby app to show collections. I'm not understanding, i've read thru the githuib, read me, i have no clue on what to do now. 

 

i wish i can delete post but i managed to make it work. user error. great work by the way

  • Like 2
Posted
58 minutes ago, xbmconnect said:

i wish i can delete post but i managed to make it work. user error. great work by the way

Nice one! Do you know what was the problem? Perhaps there something I can put a check for in the script to help future users. 

Posted
On 16/11/2024 at 15:52, rbjtech said:

there is a little bug/issue in the system adding items if you name your collection with a '+' in it - ie Apple TV+, Paramount+ etc

@rbjtechThanks for letting me know, I pushed a fix for it.

  • Thanks 1
Posted
1 hour ago, Amything said:

Nice one! Do you know what was the problem? Perhaps there something I can put a check for in the script to help future users. 

I didnt pay attention to the actual steps on where to get the user ID#, so I ran the script and went to my device and seen that it made the changes and now when I shutdown my gaming pc which where I ran the script from then collections were gone, hence the reason my next step is implementing this on Unraid

So, now my mission to someone create a docker image to which I have no clue on, I usually rely on the app store of unraid to do all this. 

Posted

I don't suppose there's anyway to pull directly from Trakt lists is there? Does everything have to go via MDBlist? Going to have a crack at setting it up on my Emby server tomorrow if I get the chance

Posted
13 minutes ago, F1nchy said:

I don't suppose there's anyway to pull directly from Trakt lists is there? Does everything have to go via MDBlist? Going to have a crack at setting it up on my Emby server tomorrow if I get the chance

Yeah everything goes through MDBList for now, however you can easily import Trakt lists to MDBList. I also import my IMDB Watchlist to IMDBList.

Posted

Don't you have to be a paid user to do that? 

Posted (edited)

@xbmconnectHere is some pointers for unRaid.

Guess you have you connection in order from mdblist api and admin user nr + emby api.

And created you config.

Create a new share that you expose to emby.

Upload you config.cfg to your share.

image.thumb.png.58a9c232b791b1047e2b789c033a232e.png

Adding the docker

First 

image.png.c5401a69271b107f18a1a89343dab4ff.png

Second fill in details.

jonjonsson/Emby-MDBList-Collection-Creator: A Python script can take MDBList.com lists and create collections from them in Emby. MDBList stores Trakt and IMDB lists (and more) that can be accessed via API.

image.png.d8bebfeccb9c8ecd983c3df09e00eaa1.png

add the path to share you made.

image.thumb.png.b8f459f81a77422d79c851768fc05dfb.png

image.png.042eea86c69f2417756f51cb91f51fff.png

Edited by Neminem
  • Like 1
Posted
6 hours ago, Neminem said:

@xbmconnectHere is some pointers for unRaid.

Guess you have you connection in order from mdblist api and admin user nr + emby api.

And created you config.

Create a new share that you expose to emby.

Upload you config.cfg to your share.

image.thumb.png.58a9c232b791b1047e2b789c033a232e.png

Adding the docker

First 

image.png.c5401a69271b107f18a1a89343dab4ff.png

Second fill in details.

jonjonsson/Emby-MDBList-Collection-Creator: A Python script can take MDBList.com lists and create collections from them in Emby. MDBList stores Trakt and IMDB lists (and more) that can be accessed via API.

image.png.d8bebfeccb9c8ecd983c3df09e00eaa1.png

add the path to share you made.

image.thumb.png.b8f459f81a77422d79c851768fc05dfb.png

image.png.042eea86c69f2417756f51cb91f51fff.png

First of all thank you and I believe I got it to work now with your help and clear directions cuz I can start the mdblist docker or restart. I have it set for 6 hours but I was wondering how can I know when it runs the script and I looked at the log but I don't see anything in it 

Posted
10 hours ago, Neminem said:

@xbmconnectHere is some pointers for unRaid.

Guess you have you connection in order from mdblist api and admin user nr + emby api.

And created you config.

Create a new share that you expose to emby.

Upload you config.cfg to your share.

image.thumb.png.58a9c232b791b1047e2b789c033a232e.png

Adding the docker

First 

image.png.c5401a69271b107f18a1a89343dab4ff.png

Second fill in details.

jonjonsson/Emby-MDBList-Collection-Creator: A Python script can take MDBList.com lists and create collections from them in Emby. MDBList stores Trakt and IMDB lists (and more) that can be accessed via API.

image.png.d8bebfeccb9c8ecd983c3df09e00eaa1.png

add the path to share you made.

image.thumb.png.b8f459f81a77422d79c851768fc05dfb.png

image.png.042eea86c69f2417756f51cb91f51fff.png

crap now im getting this error 

-v '/mnt/user/files/emby-mdblist-collection/config.cfg':' /app/config.cfg':'rw' 'ghcr.io/jonjonsson/emby-mdblist-collection-creator:latest'

docker: Error response from daemon: invalid volume specification: '/mnt/user/files/emby-mdblist-collection/config.cfg: /app/config.cfg:rw': invalid mount config for type "bind": invalid mount path: ' /app/config.cfg' mount path must be absolute.
See 'docker run --help'.

Posted (edited)

@AmythingUpdated my whole lists with own images in /app/posters inside the Docker container. When running the script, i get the following error:

Exception occurred while uploading image: Failed to parse: http://192.168.2.50:80emby/Items/516219/Images/Primary?api_key=3f53ac399cf149fe95af67cc675dcb19
Failed to set poster for - Critics Choice Award: Best Picture -.

Shouldn't it be 192.168.2.50:80/emby ?

But I made a GH repo for my images in meanwhile since fetching images from the internet works.

Edited by shorty1483
Posted

I updated my image collection with Kometa style ones to fit my specific playlists. Perhaps someone finds it useful.

 

  • Like 1
  • 2 weeks later...
Posted

This worked well for me.

Thank you.

 

It should be an official plugin 

Posted
36 minutes ago, 242Movies said:

This worked well for me.

Thank you.

 

It should be an official plugin 

If nothing comes of 4.9 - then I may convert the Python to c# and create a plugin - Assuming @Amythingis ok with that of course.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...