Page 3 of 6

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Friday 12 February 2016 19:55
by racquemis
Fixed.
On line 164 change

Code: Select all

urllib.quote(PlayString)
to

Code: Select all

urllib.quote(PlayString.encode('utf-8'))

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Friday 12 February 2016 22:21
by denisb88
YES !!!
It works

Last thing : can I translate playing paused stopped at lines 174 176 178 and Movie at line 153 ?
In fact word begining with " and ending with " ?

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Saturday 13 February 2016 13:48
by racquemis
Script has been updated:
- Added possibility to make translations (see line 40 & 41)
- Further encoding fixes
- Added 'clip' to possible video types.
- Added `buffering` to the user variable status values.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Saturday 13 February 2016 14:53
by denisb88
With the new script I get this error
File "plex2.py", line 47
SyntaxError: Non-ASCII character '\xc3' in file plex2.py on line 47, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
with
#Translation Array - It's also possible to specify custom search strings. Place them at the beginning of the array.
transl_search = ['Playing','Stopped','Buffering','Paused','Video','Movie','Episode','Clip','Audio','Slideshow']
transl_replace = ['Lecture','Arrêté','Mise en cache','En pause','Vidéo','Film','','Morceau','Diaporama'] #place replacement string on the same index as the search string. empty strings are not processed.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Saturday 13 February 2016 15:08
by racquemis
Solution was already given in the url in the error message
Add

Code: Select all

# -*- coding: utf-8 -*-
under the first line in the script.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Saturday 13 February 2016 15:20
by denisb88
Thanks for all
As I don't know how to use # -*- coding: utf-8 -*-, I have just replace Arrêté with Arret and now everything works perfectly.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Saturday 13 February 2016 15:57
by racquemis
Good to hear. Check the script in the first post. Updated to include that line.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Saturday 13 February 2016 16:10
by denisb88
Now everything works fine.
Great thanks from France ;-)

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 0:06
by denisb88
I don't know why but there is no log of files played.
Before, with the older script, logging works but with the new script, no log is available.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 0:10
by denisb88
And another error message now
'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
Traceback (most recent call last):
File "plex2.py", line 182, in <module>
PlayString = urllib.quote(translate(PlayString).encode("utf-8"))
File "plex2.py", line 109, in translate
returnstring = returnstring.replace(transl_search[idx],transl_replace[idx])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
None

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 9:31
by racquemis
denisb88 wrote:I don't know why but there is no log of files played.
Before, with the older script, logging works but with the new script, no log is available.
Which log do you mean? The one in the terminal? The domoticz text dummy? Or the domoticz log?
The domoticz text dummy log is automatically cleared when Play Progress is shown. Otherwise the log would contain thousands of lines in no time at all. This has always been this way.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 9:37
by denisb88
When you click on Text icon, it seemed to me that I could see the movies had been played with the last script

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 10:10
by racquemis
There is still a small bug that will cause the text log not to be cleared when the playback status is 'stopped'. Maybe that is what you're seeing.
You can have a log of what it played, just disable the PlayProgress and disable the autoclear. There are two parameters for it in the script.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 10:31
by denisb88
Thanks, I will try

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 10:45
by denisb88
Yes, I understand, I have tried.
Do you thing if it's possible to keep only one ligne of each movie played in the log or it's to difficult to do ?

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 11:22
by racquemis
There isn't really a good way to do you want. The domoticz log is not suitable for this.
I can only think of the option of introducing a second set of text dummy's with the only purpose logging a single entry for each movie/episode played.

But i'm not going to do that. There are better tools to maintain a history of all the movies/episodes played.
You should look at a tool called PlexPy. You install it on the same system as your plex server. The tool reads the plex log file. And maintains a history for you. There are even statistics for each Plex User.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 11:22
by BoelShit
This script gives me a 401 Unauthorizated probably because I have multiple Plex Home users in the household. I'm trying to modify it so it can use a token.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 11:36
by racquemis
Have you tried the solution given in the first post? It works for me.
under Plex Options>Server>Network you can specify which networks can access the server without authentication. You can enter specific IP addresses or whole networks (e.g 192.168.0.1) don’t forget to add the subnet as shows in the settings description.

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 11:50
by denisb88
Thanks, it's exactly what I want with PlexPy

Re: Plex Status - Video, Audio, Photo, Play Progress

Posted: Sunday 14 February 2016 11:50
by BoelShit
racquemis wrote:Have you tried the solution given in the first post? It works for me.
I have these settings in the Plex server under network: "127.0.0.1/255.255.255.255". I don't have to login to the Plex web page but when you enable Plex Home Plex tells you this:
If you've already set up a Plex Home, then you don't need to do anything else. When you become part of a Home, your Server automatically changes some security-related settings, one of which requires authentication for all access to the Server.
Do you have Plex Home enabled?