Skip to content

Commit b8b1e76

Browse files
author
Ryan Meek
authored
Add token to encoded url - @rsteckler
closes #18 thanks, @rsteckler
1 parent 3cd574f commit b8b1e76

File tree

1 file changed

+7
-3
lines changed
  • custom_components/plex_recently_added

1 file changed

+7
-3
lines changed

custom_components/plex_recently_added/sensor.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_SSL
1919
from homeassistant.helpers.entity import Entity
2020

21-
__version__ = '0.2.3'
21+
__version__ = '0.2.4'
2222

2323
_LOGGER = logging.getLogger(__name__)
2424

@@ -299,8 +299,12 @@ def image_url(url_elements, cert_check, img):
299299
ssl = ''
300300
if dl_images:
301301
host = local
302-
encoded = quote('http{0}://{1}:{2}{3}'.format(ssl, local,
303-
port, img), safe='')
302+
encoded = quote('http{0}://{1}:{2}{3}?X-Plex-Token={4}'.format(ssl,
303+
local,
304+
port,
305+
img,
306+
token),
307+
safe='')
304308
url = ('http{0}://{1}:{2}/photo/:/transcode?width=200&height=200'
305309
'&minSize=1&url={3}&X-Plex-Token={4}').format(ssl, host, port,
306310
encoded, token)

0 commit comments

Comments
 (0)