Skip to content

Instantly share code, notes, and snippets.

@kissgyorgy
Last active January 10, 2022 21:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kissgyorgy/d1528eefb1ba7f68401fbdd2336a5510 to your computer and use it in GitHub Desktop.
Save kissgyorgy/d1528eefb1ba7f68401fbdd2336a5510 to your computer and use it in GitHub Desktop.
List movies from Plex database
#!/usr/bin/python3
import sqlite3
from urllib.parse import unquote, parse_qs
PLEX_DB = '/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db'
conn = sqlite3.connect(PLEX_DB)
res = conn.execute('SELECT hints FROM media_items WHERE library_section_id = 1;')
for row, in res:
qs = parse_qs(row)
name = qs['name'][0]
print(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment