Commit 9a90bd7

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