Comments (6)
If you follow the steps in the troubleshooting doc are you able to connect to the API? If not, this isn't something that can be fixed and would explain why the HA plex component doesn't work for you as well.
from sensor.plex_recently_added.
I try to explain.
When you do:
https://plex.tv/api/servers.xml?X-Plex-Token=xxxxxxxxxxxxxgYE <--- My Login Token
I receive:
<?xml version="1.0" encoding="UTF-8"?> <MediaContainer friendlyName="myPlex" identifier="com.plexapp.plugins.myplex" machineIdentifier="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" size="1"> <Server accessToken="xxxxxxxxxxxxxx9jY4" name="xxxxxxxxxxx" address="xxxxxxx" port="32400" version="1.16.3.1402-22929c8a2" scheme="http" host="xxxxxxx" localAddresses="" machineIdentifier="xxxxxxxxxxx" createdAt="1549384857" updatedAt="1565904197" owned="0" synced="0" sourceTitle="xxxxxxx" ownerId="xxxxxxxx" home="0"/> </MediaContainer>
If you see the Tokens are distinct and of course localAddresses is not used because is not at your location.
Regards
from sensor.plex_recently_added.
Have you tried the host/port option instead of the server_name
option?
from sensor.plex_recently_added.
@maykar It is being thought that all servers within an account are the property of the person being authenticated, and this is not the case.
A part of the code uses the variable "localAddresses" that returns the xml, when this variable is only reported by Plex when the server is local (You belong) not remote (has been shared with you by someone).
It is also assumed that the access token is the same as the user token when as you can see in the XML example this is not the case.
I'll paste the lines where the problem is:
Line 298
def image_url(url_elements, cert_check, img):
"""Plex can resize images with a long & partially % encoded url."""
from urllib.parse import quote
ssl, host, local, port, token, self_cert, dl_images = url_elements
if not cert_check and not self_cert:
ssl = ''
if dl_images:
host = local
encoded = quote('http{0}://{1}:{2}{3}?X-Plex-Token={4}'.format(ssl,
local,
port,
img,
token),
safe='')
url = ('http{0}://{1}:{2}/photo/:/transcode?width=200&height=200'
'&minSize=1&url={3}&X-Plex-Token={4}').format(ssl, host, port,
encoded, token)
"""Check if image exists"""
if not self_cert:
r = requests.head(url, verify=False)
else:
r = requests.head(url)
if r.status_code == 200:
return url
else:
return False
And using the same token for all the code. You must use "host" or "address" instead for image download, and add a new variable for each server that is a token. If there is no token then use the one provided by the user in its configuration.
from sensor.plex_recently_added.
I understand. A while back I removed server_name
from the readme as that option created more problems than it solved, with user confusion and plex API changes. It's still in the code to avoid a breaking change for the people who are using it successfully. As such, I don't think I'll expand that feature, it should be considered depreciated.
Are you able to connect to the server using host/port instead of server_name
? The code you are pointing to is only used when using server_name
.
from sensor.plex_recently_added.
Closing this issue as stale and because the server_name
option is depreciated and this should be possible by using host/port. If you are unable to connect with host/port, please reopen this issue or create a new one.
from sensor.plex_recently_added.
Related Issues (20)
- section_types movies shows "TV shows" HOT 5
- [Feature Request] Exclude keywords HOT 1
- Config option to exclude whole libraries [Feature Request] HOT 5
- Text shadows HOT 1
- No Metadata field for "TV Shows" HOT 1
- OverflowError: timestamp out of range for platform time_t when loading HOT 6
- No Metadata field for "XXX" HOT 4
- [Feature request] recently added items on remote server HOT 1
- [Feature Request] Managed users differences HOT 1
- [Feature Request] Exclude watched from results HOT 4
- No version key in the manifest file
- Exclude item or library from results HOT 2
- [Feature Request] filter on (picture) libraries HOT 1
- plex_recently_added: Error on device update! HOT 2
- Platform not found HOT 1
- Corrupted thumbnail images HOT 1
- `device_state_attributes` property replaced with `extra_state_attributes` in HA core HOT 1
- [Feature Request] $date is in US format, makes it hard for people in the rest of the world to read HOT 2
- Not pulling in upcoming events HOT 1
- getting untested by HA error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sensor.plex_recently_added.