blacktwin / JBOPS

Just a Bunch Of Plex Scripts
1.71k stars 304 forks source link

Issue #210

Closed stephan2006 closed 4 years ago

stephan2006 commented 4 years ago

Describe the bug When running the plex_api_share.py script, if empty library or one that has not been scanned yet, the script returns the following:

 python.exe plex_api_share.py --share --allUsers --allLibraries
Traceback (most recent call last):
  File "plex_api_share.py", line 299, in <module>
    movie_ratings += get_ratings_lst(movie)
  File "plex_api_share.py", line 159, in get_ratings_lst
    ratings_keys = content.json()['MediaContainer']['Directory']
  File "C:\Python27\lib\site-packages\requests\models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Python27\lib\json\__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "C:\Python27\lib\json\decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python27\lib\json\decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

To Reproduce Steps to reproduce the behavior:

  1. Have empty plex library
  2. Go to 'JBOPS/utility folder in cmd or PS'
  3. Enter ' python.exe plex_api_share.py --share --allUsers --allLibraries'
  4. See error

Desktop (please complete the following information):

** Notes Still waiting on Plex to scan the last library for content to see if this is the only issue. Through chatting with Blacktwin, the empty library appears to be the culprit. Was asked to submit an issue to document the process.

blacktwin commented 4 years ago

Update pushed @stephan2006