Plex - Plex Top Playlists | PlexGuide.com

Plex Plex Top Playlists

  • Stop using Chrome! Download the Brave Browser via >>> [Brave.com]
    It's a forked version of Chrome with native ad-blockers and Google's spyware stripped out! Download for Mac, Windows, Android, and Linux!
Welcome to the PlexGuide.com
Serving the Community since 2016!
Register Now

Dexter.

Active
Original poster
Donor
Jan 25, 2020
46
10
Hi,

in the past i was using plex_top_playlists to have different playlists (e.g. Trakt Trending, Imdb 250, ...) automatically updated in Plex. Lately it's not working anymore and i get the following error code. Maybe someone know how to fix this or have another solution on how to get Trakt.tv playlists to Plex.

I tried to reinstall plex_top_playlists from https://github.com/pbrink231/plex_top_playlists, but still getting this error when running the script:

Code:
===================================================================
   Automated Playlist to Plex script
===================================================================

Traceback (most recent call last):
  File "./plex_playlist_update.py", line 631, in <module>
    list_updater(plex)
  File "./plex_playlist_update.py", line 591, in list_updater
    users = get_user_tokens(plex)
  File "./plex_playlist_update.py", line 582, in get_user_tokens
    users = get_all_users(plex)
  File "./plex_playlist_update.py", line 564, in get_all_users
    user_ids = {plex_user['@id']: plex_user.get('@username', plex_user.get('@title')) for plex_user in xmlData2['MediaContainer']['User']}
  File "./plex_playlist_update.py", line 564, in <dictcomp>
    user_ids = {plex_user['@id']: plex_user.get('@username', plex_user.get('@title')) for plex_user in xmlData2['MediaContainer']['User']}
AttributeError: 'str' object has no attribute 'get'
 

pakira

Active
Donor
May 4, 2018
31
12
Hi,

in the past i was using plex_top_playlists to have different playlists (e.g. Trakt Trending, Imdb 250, ...) automatically updated in Plex. Lately it's not working anymore and i get the following error code. Maybe someone know how to fix this or have another solution on how to get Trakt.tv playlists to Plex.

I tried to reinstall plex_top_playlists from https://github.com/pbrink231/plex_top_playlists, but still getting this error when running the script:

Code:
===================================================================
   Automated Playlist to Plex script
===================================================================

Traceback (most recent call last):
  File "./plex_playlist_update.py", line 631, in <module>
    list_updater(plex)
  File "./plex_playlist_update.py", line 591, in list_updater
    users = get_user_tokens(plex)
  File "./plex_playlist_update.py", line 582, in get_user_tokens
    users = get_all_users(plex)
  File "./plex_playlist_update.py", line 564, in get_all_users
    user_ids = {plex_user['@id']: plex_user.get('@username', plex_user.get('@title')) for plex_user in xmlData2['MediaContainer']['User']}
  File "./plex_playlist_update.py", line 564, in <dictcomp>
    user_ids = {plex_user['@id']: plex_user.get('@username', plex_user.get('@title')) for plex_user in xmlData2['MediaContainer']['User']}
AttributeError: 'str' object has no attribute 'get'
I just tried to run mine, i use the command via cron
Code:
sudo python3 /opt/appdata/plex_top_playlists/plex_playlist_update.py run
no error on my side. It update collection and playlist.
Can you share your config (settings.ini - w/o the token details)?
maybe your token is expired?

edit: formatting
Post automatically merged:

@dexter not sure if you tried IMDBList2PlexCollection. I get better results to build collection but it is a manual script
 
Last edited:

Dexter.

Active
Original poster
Donor
Jan 25, 2020
46
10
Thanks for your reply. So now I know already the problem is on my side and the script still work. I checked the plex token and it's valid (I changed the token, which gives me a error that the token is invalid - so this checks seems to work).

Here is the settings.ini I'm using:
Code:
[Plex]
### [REQUIRED] Plex server details - Github for instructions on token ###
plex-host: https://plex.mydomain.com:443
plex-token: mytoken

### [REQUIRED] Current library info - Change defaults to match your current librarys ###
# supports multiple libs, if separate by comma, no spaces
# e.g.: movie-library: Adult Movies,Kid Movies
# e.g.: tv-library: Adult TV,Kid TV
movie-library: Filme
tv-library: Serien

# Share playlist with other user?
# Choices True, False -- Caps matter, (if True, syncs all or list, if false, only token user)
shared: True

# (keep empty list for all users, comma list for specific users.)
# EX: ["username","anotheruser"] << notice the use of double-quotes
# $shared must be True.
users: []

# (keep empty list to allow all users, comma list for specific users to block.)
# EX ["greg","luiz"] << notice the use of double-quotes
# $shared must be True.
not_users: []

### [OPTIONAL] Plex server timeout setting .. default 300secs
# Uncomment and increase if you are experiencing timeout issues
# timeout: 300

### [OPTIONAL] Show the list of missing movies
# Set to True to see missing IMDB IDs from movie lists.  default is False
show_missing: False

### [OPTIONAL] logging level.  value possibilities: [-1, 0, 1, 2, 3].
# -1 = quiet, 0 = normal, 1 = verbose, 2 = very verbose, 3 = debug
verbose: 0

### [OPTIONAL] Missing list columns
# number of columns wide to show list.  default is 4
missing_columns: 4

[Trakt]
### [OPTIONAL] Trakt API Info ###
# This is REQUIRED for Trakt.  Without it you will not get any Trakt playlists
api-key: mytraktapikey

### Trakt Lists
# has a title, type, limit & url
# limit max is 100
# These are two of the examples.
# the type is for how to parse the response.  Let me know in github if you have trouble with an endpoint.
# COMMA's matter.

# Currently 2 different kinds.  "playlist" and "collection"
# playlist is default if not supplied
# adding "kind":"collection" will tag all movies with a collection tag.  A collection can go on movies or shows and will show together

## Movie list
trakt-movie-list: [
  { "title": "Movies Top Weekly", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/weekly"},
  { "title": "Movies Top Monthly", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/monthly"},
  { "title": "Movies Top Yearly", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/yearly"},
  { "title": "Best Movies Trakt", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/all"},
  { "title": "Movies Top Trending", "type":"trending", "limit": 80, "url":"https://api.trakt.tv/movies/watched/trending"},
  { "title": "Movies Popular", "type":"popular", "limit": 80, "url":"https://api.trakt.tv/movies/popular", "show_summary": "False"}
  ]

## Show list
# !!!! WARNING !!!! - collection cannot be placed on a show list yet.  Will update when my pull request goes through on plexapi


[IMDb]
# this is a LIST of all your fav IMDB lists
# types available are: ['chart', 'search', 'custom']
# put new list items on a new line
# each line needs a title, url and type
# if title is empty it will try and get the title from the imdb list
# CHECK YOUR COMMAs.  Need one after every line except last.  Will break

# Currently 2 different kinds.  "playlist" and "collection"
# playlist is default if not supplied
# adding "kind":"collection" will tag all movies with a collection tag.  A collection can go on movies or shows and will show together

### SEARCH TYPE
# type: "search"
# view MUST BE simple as a query param
# e.g.: &view=simple
# wrapped in double quotes,

### CHART TYPE
# used for links with 'chart' in the url

### CUSTOM TYPE
# used for links with 'list' in the url

imdb-lists: [
  { "title":"IMDB Top 250", "type":"chart", "url":"https://www.imdb.com/chart/top"},
  { "title":"Latest Best Picture-Winning Titles", "type":"search", "url":"http://www.imdb.com/search/title?groups=oscar_best_picture_winners&sort=year,desc&view=simple" },
  { "title":"Top Rated Movies", "type":"chart", "url":"http://www.imdb.com/chart/top"},
  { "title":"Most Popular Movies", "type":"chart", "url":"http://www.imdb.com/chart/moviemeter"}

  ]


[Discord]
### Testing phase
# this will send a message for each movie/show summary finished to a channel
# by adding the url you will recieve messages
webhook_url:

[Radarr]
### Testing
# this will be used to auto add missing movies from lists
radarr_token:
add_movies: False
# [REQUIRED] Used to pick the profile when adding the movie
quality_profile:

If you have any idea let me know :)
 

pakira

Active
Donor
May 4, 2018
31
12
So the difference i noticed with my config:
  • plex-host: i dropped the port 443 on my side
otherwise i have pretty much the same config and i do share playlist as well.
Did you try to use the original config setup. I did faced issue when i missed a comma or apostrophe.
 

Dexter.

Active
Original poster
Donor
Jan 25, 2020
46
10
I tried it without :443 on the server address, but same error. Also the basic config gives me the same error. It seems the script not even going to start to connect to trakt or imdb to get the lists, because no matter what i wrote to those lines, the error stay the same.

I have two VPS running (1 old, 1 new) and exactly the same error on both. So maybe it have to do something with my plex library as I restored it on the new server aswell. But honestly, I dont have a idea what is wrong as I'm not so deep into linux. So for the moment I need to give up :confused:
 

pakira

Active
Donor
May 4, 2018
31
12
I tried it without :443 on the server address, but same error. Also the basic config gives me the same error. It seems the script not even going to start to connect to trakt or imdb to get the lists, because no matter what i wrote to those lines, the error stay the same.

I have two VPS running (1 old, 1 new) and exactly the same error on both. So maybe it have to do something with my plex library as I restored it on the new server aswell. But honestly, I dont have a idea what is wrong as I'm not so deep into linux. So for the moment I need to give up :confused:
Are you sure that you are running the script with python3 and not python2 ? and did you go thru installing the requirements https://github.com/pbrink231/plex_top_playlists/wiki/Linux-Setup-and-Update
 

Dexter.

Active
Original poster
Donor
Jan 25, 2020
46
10
I suspected something was wrong with my plex database.
- I uninstalled the Plex Container and created a new database with same Plex Account -> didn't work; changed password to get new token -> didn't work
- I uninstalled the Plex Container and created a new database with new Plex Account -> worked

Since I don't have a Plex Pass, many users or similar, I could do this without loosing too much (just time :sneaky:). And now it's working again .. I still don't know what cause the problem in the beginning, but for the moment it's working again.
Post automatically merged:

@pakira or other users:
Does it still work for you? My script stopped working again after it worked fine for many weeks o_O:cautious:
Post automatically merged:

EDIT:
The script was updated on github and fixed all the issues i had. The script now supports also trakt.tv User-Lists which is really great.
 
Last edited:
  • Like
Reactions: 1 user

mrv153

Active
Mar 14, 2020
35
4
Im getting this error, someone has a idea??

Code:
python3 ./plex_playlist_update.py run
Traceback (most recent call last):
  File "./plex_playlist_update.py", line 19, in <module>
    import global_vars
  File "/usr/scripts/plex_top_playlists/global_vars.py", line 88
    print(f"SKIPPING SETTINGS LIST: Problem with trakt-movie-list, {ex}")
                                                                       ^
SyntaxError: invalid syntax
 

Dexter.

Active
Original poster
Donor
Jan 25, 2020
46
10
You could check your trakt-movie-list entries. The error message points that something is wrong there. I had also some troubles when i forget a , or something else.

For e.g. my trakt-movie-list looks like this:
Code:
## Movie list
trakt-movie-list: [
  { "title": "Movies Top Weekly", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/weekly"},
  { "title": "Movies Top Monthly", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/monthly"},
  { "title": "Movies Top Yearly", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/yearly"},
  { "title": "Movies Top All Time", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/all"},
  { "title": "Movies Top Trending", "type":"trending", "limit": 80, "url":"https://api.trakt.tv/movies/trending"},
  { "title": "Movies Popular", "type":"popular", "limit": 80, "url":"https://api.trakt.tv/movies/popular", "show_summary": "False"}
  ]
 

mrv153

Active
Mar 14, 2020
35
4
You could check your trakt-movie-list entries. The error message points that something is wrong there. I had also some troubles when i forget a , or something else.

For e.g. my trakt-movie-list looks like this:
Code:
## Movie list
trakt-movie-list: [
  { "title": "Movies Top Weekly", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/weekly"},
  { "title": "Movies Top Monthly", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/monthly"},
  { "title": "Movies Top Yearly", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/yearly"},
  { "title": "Movies Top All Time", "type":"watched", "limit": 80, "url":"https://api.trakt.tv/movies/watched/all"},
  { "title": "Movies Top Trending", "type":"trending", "limit": 80, "url":"https://api.trakt.tv/movies/trending"},
  { "title": "Movies Popular", "type":"popular", "limit": 80, "url":"https://api.trakt.tv/movies/popular", "show_summary": "False"}
  ]
I tested it aswell, no chance.
For me theres a syntax error near print(f" dunno why i get this, maybe a different python3 version?
After I changed all prints to print(" it seems to work but trakt still not work (only imdb playlist gonna added).

Which python3 you are running? im on 3.5.3
You use debian?
Post automatically merged:

Nvm python 3.6 is required im dump :D
Did you guys installed plexguide on debian 10 or higher?
Post automatically merged:

Dist-upgraded to buster working now.
Im confused how easy this was and pg working fine after a dist upgrade lol.
Here and there a few redeploys (traefik) and its back up working.
 
Last edited:
  • Like
Reactions: 1 user

Recommend NewsGroups

      Up To a 58% Discount!

Trending