ilyaz / PlexDownloader

102 stars 27 forks source link

Something went wrong: ('http error', 401, 'Unauthorized', <httplib.HTTPMessage instance at 0x1051a6a70>) #25

Open fkick opened 8 years ago

fkick commented 8 years ago

Hi,

I'm getting the below error now when I attempt to use PlexDownloader. This occurs with both shared and owned servers, both local and remote. Currently I'm running Plex Server 1.2.2.2857 and Mac OS Sierra

Something went wrong: ('http error', 401, 'Unauthorized', <httplib.HTTPMessage instance at 0x1051a6a70>)
Traceback (most recent call last):
  File "PlexDownloader-master /plexdl.py", line 1062, in <module>
    x.search()
  File "PlexDownloader-master /plexdl.py", line 201, in search
    xmldoc = minidom.parse(urllib.urlopen(constructPlexUrl("/library/sections/"+unicode(self.plexid)+"/all")))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 87, in urlopen
    return opener.open(url)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 213, in open
    return getattr(self, name)(url)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 364, in open_http
    return self.http_error(url, fp, errcode, errmsg, headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 377, in http_error
    result = method(url, fp, errcode, errmsg, headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 689, in http_error_401
    errcode, errmsg, headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 386, in http_error_default
    raise IOError, ('http error', errcode, errmsg, headers)
IOError: ('http error', 401, 'Unauthorized', <httplib.HTTPMessage instance at 0x1051a6a70>)

Plex Download failed at 2016-10-21 18:18:20
Retrying in 600 Seconds...
Jonher937 commented 7 years ago

I had the same problem but it works if you enter the token manually to "token.txt". You can search on the Plex helpcenter for "Finding an authentication token / X-Plex-Token"

I used the network debugger in Chrome to get the token, looks like you can browse to the web page and when browsing for servers you enter this in the Chrome developer console: window.PLEXWEB.myPlexAccessToken

That should give you your token, not sure how to get the shared one as easy.

lumpyrabbit commented 5 years ago

A somewhat quick way to find the X-Plex-Token

In your browser, open the Plex Shared Libary you want to use. Then, use your browser's Dev Tools (in Chrome: More Tools -> Dev Tools and FF it's Web Developer Tools) and use the Network tool. The Request URL output string will give you the IP of the shared server and the Token.