Commit f519bbe
xxwhirlpool
·
2026-04-05 21:58:58 -0400 EDT
parent 062790b
more on plex_playlist.py
3 files changed,
+17,
-4
+1,
-0
| ... | ... | @@ -36,3 +36,4 @@ config/.local/bin/quote | |
| 36 | 36 | config/.local/bin/quoterandom | |
| 37 | 37 | config/.config/plexclip/config.toml | |
| 38 | 38 | config/.local/bin/discord_timest | |
| 39 | + | scripts/Scripts/plex/playlists/* |
+15,
-0
| ... | ... | @@ -0,0 +1,15 @@ | |
| 1 | + | # plex server management | |
| 2 | + | ||
| 3 | + | tracking my plex library & stuff | |
| 4 | + | ||
| 5 | + | ## plex_playlists.py | |
| 6 | + | ||
| 7 | + | - exports to ~/Scripts/plex/playlists | |
| 8 | + | - each filename is the title of the playlist + `.txt` | |
| 9 | + | - each track is formatted as "Artist - Song" | |
| 10 | + | - only works for music playlists | |
| 11 | + | - no track numbers; add them with `cat -n [FILENAME]` | |
| 12 | + | ||
| 13 | + | ### usage | |
| 14 | + | ||
| 15 | + | `plex_playlist.py [TOKEN IN QUOTES]` |
R config/.local/bin/plex_playlist.py =>
scripts/Scripts/plex/plex_playlist.py
+1,
-4
| ... | ... | @@ -10,7 +10,6 @@ | |
| 10 | 10 | # this is such script kiddie shit idk python | |
| 11 | 11 | ||
| 12 | 12 | from plexapi.server import PlexServer | |
| 13 | - | from plexapi.playlist import Playlist | |
| 14 | 13 | from os import sys | |
| 15 | 14 | ||
| 16 | 15 | SERVER_URL = "http://192.168.1.219:32400" |
| ... | ... | @@ -18,12 +17,10 @@ TOKEN = sys.argv[1] | |
| 18 | 17 | ||
| 19 | 18 | plex = PlexServer(SERVER_URL, TOKEN) | |
| 20 | 19 | ||
| 21 | - | print("title, album, artist" + "\n") | |
| 22 | - | ||
| 23 | 20 | for list in plex.playlists(playlistType="audio"): | |
| 24 | 21 | listTitle = list.title | |
| 25 | 22 | items = list.items() | |
| 26 | - | pl_file = open(listTitle, "w") | |
| 23 | + | pl_file = open("playlists/" + listTitle + ".txt", "w") | |
| 27 | 24 | for i in items: | |
| 28 | 25 | title = i.title | |
| 29 | 26 | artist = i.originalTitle |