diff --git a/beetsplug/plexupdate.py b/beetsplug/plexupdate.py index 480007d66..02ed2324c 100644 --- a/beetsplug/plexupdate.py +++ b/beetsplug/plexupdate.py @@ -12,6 +12,7 @@ from __future__ import (division, absolute_import, print_function, import requests from urlparse import urljoin +from urllib import urlencode import xml.etree.ElementTree as ET from beets import config from beets.plugins import BeetsPlugin @@ -51,7 +52,7 @@ def append_token(url, token): """Appends the Plex Home token to the api call if required. """ if token: - url += '?X-Plex-Token={0}'.format(token) + url += '?' + urlencode({'X-Plex-Token': token}) return url diff --git a/docs/changelog.rst b/docs/changelog.rst index daf9210df..4f24cc37e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -56,6 +56,8 @@ Fixes: * Fix a bug, where the autotagger still considers matches that are specifically listed under the config's ignored section. :bug:`1487` * Fix a bug with unicode strings when generating thumbnails. :bug:`1485` +* :doc:`/plugins/plexupdate`: Fixed library updates not working when in a Plex + Home by allowing a token with requests. 1.3.13 (April 24, 2015) diff --git a/docs/plugins/plexupdate.rst b/docs/plugins/plexupdate.rst index 09ff940de..2e589f6a5 100644 --- a/docs/plugins/plexupdate.rst +++ b/docs/plugins/plexupdate.rst @@ -13,6 +13,9 @@ which looks like this:: plex: host: localhost port: 32400 + token: token + +Use the token configuration option only when in a Plex Home (see `Plex Token`_) To use the ``plexupdate`` plugin you need to install the `requests`_ library with: @@ -23,6 +26,7 @@ server every time you change your beets library. .. _Plex: http://plex.tv/ .. _requests: http://docs.python-requests.org/en/latest/ +.. _Plex Token: https://support.plex.tv/hc/en-us/articles/204059436-Finding-your-account-token-X-Plex-Token Configuration ------------- @@ -33,3 +37,5 @@ The available options under the ``plex:`` section are: Default: ``localhost``. - **port**: The Plex server port. Default: 32400. +- **token**: The Plex Home token. + Default: Empty.