Comments (15)
Can you send over how you're calling the script? with args.
Haven't seen that myself. Perhaps you can hit the plexpy api in the browser directly and make sure that part is working as well.
from tautulli-influxdb-export.
API is working in the browser.
get_activity
{"response": {"message": null, "data": {"stream_count": "0", "sessions": []}, "result": "success"}}
also get_users is returning output.
calling as following
plexpy_influxdb_export.py --influxdbdatabase media --plexpyhost 192.168.XX.XX --plexpyapikey 9be1XXXXXXXXXXXXX9abb
Also have your sabnzbd_influxdb_export.py running with almost same arguments without problems.
from tautulli-influxdb-export.
I had a similar problem on a Windows machine.
The "400" error is somewhere in the create_database function, but it isn't fatal. My script will throw the error then happily carry on. I think you may just need to manually create the database in InfluxDB.
On the 'unicode' error, looking at the code between the sabnzbd and Plexpy exporters, the json.load
calls are different. I think the call should be json.loads
I changed the Plexpy code to:
data = json.loads(req)
at line 19 and
data = json.loads(requests.get('{0}{1}'.format(plexpy_url, '&cmd=get_users'), verify=False).text)
at line 65
It worked like a charm. No more 'unicode' errors and data is flowing.
New to Github, so apologies if I'm posting wrong.
from tautulli-influxdb-export.
Hi there,
I'm too getting the same error when starting it up
`Started
400: {"error":"error parsing query: found NOT, expected ; at line 1, char 20"}
'unicode' object has no attribute 'read'
'unicode' object has no attribute 'read'
'unicode' object has no attribute 'read'
'unicode' object has no attribute 'read'`
Line 19 already shows as data = json.loads(req)
and Line 65 shows up as data = json.loads(requests.get('{0}{1}'.format(plexpy_url, '&cmd=get_users'), verify=False).text)
from tautulli-influxdb-export.
Yea sorry guys, that was a change someone else made that I pushed in (without testing). I believe the .load() call fixed it for them probably due to some oddball version of python they had. I'll take a look.
from tautulli-influxdb-export.
Thanks for looking into this, Drew!
from tautulli-influxdb-export.
guys, please post the following:
- OS (+ version)
- Python Version
- PlexPy Version
Thanks,
Drew
from tautulli-influxdb-export.
Please see the details:
- OS : macOS 10.12.3
- Python: Python 2.7.10
- PlexPy: 1.4.16
from tautulli-influxdb-export.
OS: Windows Server 2016 Essentials
Python: Python 2.7.12 (running from within Command Prompt)
PlexPy: 1.4.14 (guess I'm due for an update)
from tautulli-influxdb-export.
OS: Ubuntu 16.04.1 LTS
Python: 2.7.12
PlexPy: From Git
from tautulli-influxdb-export.
When I checkout 056cf25 it works
from tautulli-influxdb-export.
I tried 056cf25 however python crashes.
from tautulli-influxdb-export.
Sorry guys, I haven't had a chance to look at this. Planning to soon. Thanks!
from tautulli-influxdb-export.
Hey Drewster, found your script while searching for a solution and decided to copy/rewrite it for the learning experience. While rewriting it I found the issues causing these reported errors:
- InfluxDB removed the 'CREATE DATABASE IF NOT EXISTS' option and set 'CREATE DATABASE' to do the same behavior by default (seems silly that they didn't just leave the old syntax as well to prevent this exact situation)
- json.load() does not work on string objects, requiring json.loads() to be used instead. I ended up just using the built-in json() function of requests. IE: data = requests.get(cmd, verify=False).json(). No clue what changed that broke this.
I would have modified and submitted a correction but I have no idea how GitHub works enough to do that yet :P. Can find mine here: https://github.com/JeordyR/Scripts/tree/master/plexpyInflux if you want to pull some stuff back out. I also added the pulling of libraries and their content counts as well.
from tautulli-influxdb-export.
@JeordyR This is super late, but thanks for the info. The changes have been incorporated. Thanks!
from tautulli-influxdb-export.
Related Issues (11)
- Cannot seem to get it to work HOT 11
- Direct Stream noted as Transcode HOT 8
- More 'Question' than 'Issue' - Tautulli compatibility? HOT 2
- Expecting value: line 1 column 1 (char 0) HOT 2
- No JSON object could be decoded HOT 3
- Invalid syntax: Line 59 except Exception, e: HOT 1
- Invalid syntax: Line 60 print str(e) HOT 5
- 404 page not found HOT 3
- Queries HOT 1
- Added Direct stream as a option 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 tautulli-influxdb-export.