Git Product home page Git Product logo

Comments (15)

Drewster727 avatar Drewster727 commented on June 5, 2024

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.

dkruyt avatar dkruyt commented on June 5, 2024

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.

iswanb avatar iswanb commented on June 5, 2024

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.

thegreyfox avatar thegreyfox commented on June 5, 2024

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.

Drewster727 avatar Drewster727 commented on June 5, 2024

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.

thegreyfox avatar thegreyfox commented on June 5, 2024

Thanks for looking into this, Drew!

from tautulli-influxdb-export.

Drewster727 avatar Drewster727 commented on June 5, 2024

@dkruyt @thegreyfox @iswanb

guys, please post the following:

  • OS (+ version)
  • Python Version
  • PlexPy Version

Thanks,
Drew

from tautulli-influxdb-export.

thegreyfox avatar thegreyfox commented on June 5, 2024

@Drewster727

Please see the details:

  • OS : macOS 10.12.3
  • Python: Python 2.7.10
  • PlexPy: 1.4.16

from tautulli-influxdb-export.

iswanb avatar iswanb commented on June 5, 2024

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.

dkruyt avatar dkruyt commented on June 5, 2024

OS: Ubuntu 16.04.1 LTS
Python: 2.7.12
PlexPy: From Git

from tautulli-influxdb-export.

dkruyt avatar dkruyt commented on June 5, 2024

When I checkout 056cf25 it works

from tautulli-influxdb-export.

thegreyfox avatar thegreyfox commented on June 5, 2024

I tried 056cf25 however python crashes.

from tautulli-influxdb-export.

Drewster727 avatar Drewster727 commented on June 5, 2024

Sorry guys, I haven't had a chance to look at this. Planning to soon. Thanks!

from tautulli-influxdb-export.

JeordyR avatar JeordyR commented on June 5, 2024

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.

Drewster727 avatar Drewster727 commented on June 5, 2024

@JeordyR This is super late, but thanks for the info. The changes have been incorporated. Thanks!

from tautulli-influxdb-export.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.