dots


commit
062790b
parent
4231e5e
author
xxwhirlpool
date
2026-04-05 20:56:36 -0400 EDT
plex playlist export, misc
3 files changed,  +43, -0
M config/.bashrc-laptop
+7, -0
 1@@ -238,6 +238,13 @@ boop() {
 2 	eval "$(exit "$last")"
 3 }
 4 
 5+# man by default, fall back to `help`
 6+# for shell functions
 7+# https://lobste.rs/s/fkr3ha/some_terminal_frustrations#c_70wike
 8+man() {
 9+	/usr/bin/man "$@" || help "$@" | less
10+}
11+
12 ######################################
13 # misc
14 ######################################
A config/.local/bin/plex_playlist.py
+34, -0
 1@@ -0,0 +1,34 @@
 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 IN QUOTES]
11+# this is such script kiddie shit idk python
12+
13+from plexapi.server import PlexServer
14+from plexapi.playlist import Playlist
15+from os import sys
16+
17+SERVER_URL = "http://192.168.1.219:32400"
18+TOKEN = sys.argv[1]
19+
20+plex = PlexServer(SERVER_URL, TOKEN)
21+
22+print("title, album, artist" + "\n")
23+
24+for list in plex.playlists(playlistType="audio"):
25+    listTitle = list.title
26+    items = list.items()
27+    pl_file = open(listTitle, "w")
28+    for i in items:
29+        title = i.title
30+        artist = i.originalTitle
31+        albumArtist = i.grandparentTitle
32+        if artist == None:
33+            artist = albumArtist + " - "
34+        pl_file.write(artist + title + "\n")
35+    pl_file.close()
M config/.local/bin/vidtools
+2, -0
1@@ -26,6 +26,8 @@ vidhash() {
2 		ext="${f##*.}"
3 		newname="${f%.*} [$hash]".$ext
4 
5+		[[ "$hash" -eq 0 ]]; echo "couldn't generate CRC32 hash" && exit 1
6+
7 		gum confirm "are you sure you want to rename?" --default=yes --timeout=2s && mv "$f" "$newname" && echo -e "new name: $newname" || echo -e "no files renamed: $newname"
8 	done
9 }