test
This commit is contained in:
parent
e8b5843731
commit
7cac5fd957
750
DBRepair.sh
750
DBRepair.sh
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import pathlib
|
import pathlib
|
||||||
import subprocess
|
import subprocess
|
||||||
import requests
|
import requests
|
||||||
@ -47,18 +46,22 @@ class PLEX_INFO():
|
|||||||
return '%s%s:%s' % (self.proto, self.address, str(self.port))
|
return '%s%s:%s' % (self.proto, self.address, str(self.port))
|
||||||
|
|
||||||
|
|
||||||
|
print("Gathering local Plex information.")
|
||||||
plex_info = PLEX_INFO()
|
plex_info = PLEX_INFO()
|
||||||
|
print("Plex server is running at %s and using token %s" % (plex_info.url, plex_info.token))
|
||||||
|
|
||||||
|
sess = requests.Session()
|
||||||
|
sess.verify = False
|
||||||
|
print("Connecting to Plex server API.")
|
||||||
|
plex = PlexServer(plex_info.url, plex_info.token, session=sess)
|
||||||
|
|
||||||
print(plex_info.token)
|
all_libraries = plex.library.sections()
|
||||||
print(plex_info.url)
|
print("Checking %s libraries" % len(all_libraries))
|
||||||
|
for library in all_libraries:
|
||||||
#sess = requests.Session()
|
print("Checking library: %s" % library)
|
||||||
#sess.verify = False
|
collection_delete_count = 0
|
||||||
#plex = PlexServer(plex_info.url, plex_info.token, session=sess)
|
for collection in library.search(libtype="collection"):
|
||||||
|
if collection.childCount == 0:
|
||||||
#all_libraries = plex.library.sections()
|
collection.delete()
|
||||||
#for library in all_libraries:
|
collection_delete_count += 1
|
||||||
# for collection in library.search(libtype="collection"):
|
print("Deleted %s collections from %s library" % (collection_delete_count, library))
|
||||||
# if collection.childCount == 0:
|
|
||||||
# collection.delete()
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user