dots


commit
9a90bd7
parent
c09d65c
author
xxwhirlpool
date
2026-04-11 20:05:52 -0400 EDT
download current plex playlist posters
2 files changed,  +32, -0
M .gitignore
+1, -0
1@@ -36,6 +36,7 @@ config/.local/bin/quote
2 config/.local/bin/quoterandom
3 config/.local/bin/discord_timest
4 scripts/Scripts/plex/playlists/*
5+scripts/Scripts/plex/posters/*
6 config/.config/mpd.conf
7 config/.config/rmpc/config.ron
8 config/.local/bin/env
A scripts/Scripts/plex/plex_playlist_cover.py
+31, -0
 1@@ -0,0 +1,31 @@
 2+#!/usr/bin/env -S uv run --script
 3+# /// script
 4+# requires-python = ">=3.14"
 5+# dependencies = [
 6+#     "plexapi>=4.18.1",
 7+# ]
 8+# ///
 9+
10+# USAGE: plex_playlist.py [TOKEN]
11+#
12+# download all CURRENTLY SELECTED playlist posters/covers
13+# posters are named after the playlists
14+
15+from plexapi.server import PlexServer
16+from plexapi.utils import download
17+from plexapi.mixins import PlaylistMixins
18+import sys
19+
20+SERVER_URL = "http://192.168.1.219:32400"
21+TOKEN = sys.argv[1]
22+
23+plex = PlexServer(SERVER_URL, TOKEN)
24+
25+for plist in plex.playlists(playlistType="audio"):
26+    list_title = plist.title
27+    posters = PlaylistMixins.posters(plist)
28+    filtered_posters = list(filter(lambda x: x.selected == True, posters))
29+    for po in filtered_posters:
30+        po_img = po.thumb
31+        po_img_todl = SERVER_URL + po_img
32+        download(po_img_todl, TOKEN, list_title + ".png", "posters/") # img to download, token so it can dl, filename, folder to dl to