Comments (8)
Check your PLEXPY_APIKEY
and PLEXPY_URL
? How are you testing?
from jbops.
Now i get:
PlexPy Notifiers :: Script error: Traceback (most recent call last): File "/home/plex/scripts/py_watch_limit.py", line 67, in if get_get_history(username) > WATCH_LIMIT[username]: KeyError: 'Ajki'
--
from jbops.
Is 'Ajki'
in your WATCH_LIMIT
dict?
WATCH_LIMIT = {'Ajki': 2,
'user2': 3,
'user3': 4}
from jbops.
No its
WATCH_LIMIT = {'iShiki': 1 }
from jbops.
But you tested it using 'Ajki'
. If the name is not in the dict then the script will error out, which it should because the user 'Ajki'
is not defined. Does that make sense? If need be I can pretty it up so say User is not defined in WATCH_LIMIT, skipping
from jbops.
Should I use id instead of usernames, since user Ajki is my main account.
from jbops.
This section of the script:
def get_get_history(username):
# Get the PlexPy history.
payload = {'apikey': PLEXPY_APIKEY,
'cmd': 'get_history',
'user': username, # <------ here
'start_date': TODAY}
is calling for the user
based on the API doc for PlexPy. If you want to change it to user_id
then go ahead but then change that section of the script to:
def get_get_history(username):
# Get the PlexPy history.
payload = {'apikey': PLEXPY_APIKEY,
'cmd': 'get_history',
'user_id': int(username),
'start_date': TODAY}
the username
value needs to be an int
(based on the API doc). Change it however you want.
But again if the id or username is not defined in the dict the script fail, which it should. If the username or id is not defined think of it as ignoring that user. So if you want your main account Ajki
to be ignored, don't add it to the dict. Does that make sense?
from jbops.
Yup, working
from jbops.
Related Issues (20)
- [Request] Add/Remove "Allow Only Labels" and "Exclude Labels" on users HOT 1
- Kill transcode by bitrate LESS than 4mbps HOT 1
- [Request] - Add/Remove Live TV and DVR with the plex_api_share Script HOT 1
- --jbop limit not functioning.
- merge_multiepisode.py causes Plex to show 2 dpulicate files for each merged episode. HOT 1
- Issue with sync_watch_status.py HOT 2
- [Request] Limiter to work on playlists. HOT 2
- [Request] off_deck.py to have --action watch argument again HOT 1
- Issue - mediamanager.py 'unwatched' not working as expected HOT 2
- Scripts do not work for Chromecast HOT 3
- kill_stream.py "ModuleNotFoundError:No Module named 'requests'" HOT 1
- hide_episode_spoilers.py Issue HOT 1
- The first line of the summary is still shown in PLEX TV app HOT 1
- Request: Support pulling posters that have identical filenames
- Sync_watch_status =/= Plex token HOT 8
- hide_episode_spoilers.py - blur not removed HOT 1
- [Bug] Same server never evaluates to `true` in Sync Watch Status script HOT 1
- Send email to removed users
- Issue with find_unwatched.py deleting new content HOT 1
- Issue - merge_multiepisodes.py not allowing --composite_thumb 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 jbops.