mirror of
https://github.com/blacktwin/JBOPS.git
synced 2025-12-16 21:15:37 +00:00
Merge branch 'master' into style-cleanup
This commit is contained in:
commit
60772450a0
@ -3,28 +3,15 @@
|
|||||||
|
|
||||||
"""Delete all playlists from Plex.
|
"""Delete all playlists from Plex.
|
||||||
|
|
||||||
https://github.com/mjs7231/python-plexapi
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from plexapi.server import PlexServer
|
from plexapi.server import PlexServer
|
||||||
import requests
|
|
||||||
|
|
||||||
baseurl = 'http://localhost:32400'
|
baseurl = 'http://localhost:32400'
|
||||||
token = 'XXXXXXXX'
|
token = 'XXXXXXXX'
|
||||||
plex = PlexServer(baseurl, token)
|
plex = PlexServer(baseurl, token)
|
||||||
|
|
||||||
tmp_lst = []
|
|
||||||
|
|
||||||
|
|
||||||
for playlist in plex.playlists():
|
for playlist in plex.playlists():
|
||||||
tmp = playlist.key
|
playlist.delete()
|
||||||
split = tmp.split('/playlists/')
|
|
||||||
tmp_lst += [split[1]]
|
|
||||||
|
|
||||||
for i in tmp_lst:
|
|
||||||
try:
|
|
||||||
r = requests.delete('{}/playlists/{}?X-Plex-Token={}'.format(baseurl, i, token))
|
|
||||||
print(r)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user