# JBOPS - Just a Bunch Of Plex Scripts

**URL:** <https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [October 2, 2017, 6:30pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680 "2017-10-02T18:30:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blacktwin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/blacktwin/32/11185_2.png) [@Blacktwin](https://forums.plex.tv/u/Blacktwin)\
**Post date:** [October 2, 2017, 6:30pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/1 "2017-10-02T18:30:27Z")

</div>

Hello,

What started as an attempt to learn Python ended up with a slight obsession with creating useful and fun scripts to that interact with Plex and/or PlexPy. My favorite script so far is the [ips\_to\_map.py](https://github.com/blacktwin/JBOPS/blob/master/maps/ips_to_maps.py "ips\_to\_map.py").

I’ve posted some of these scripts on /r/plex and got some positive buzz so I thought I’d share them here as well. This repo is a collection of all the scripts I’ve created.

I’m adding more and am taking requests. So let me know what you think, any improvements, suggestions, requests, etc.

#[JBOPS - Just a Bunch Of Plex Scripts](https://github.com/blacktwin/JBOPS)

[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4J6RPWZ9J9YML)[![PM](https://img.shields.io/badge/Reddit-Message-lightgrey.svg)](https://www.reddit.com/user/Blacktwin/)[![PM](https://img.shields.io/badge/Plex-Message-orange.svg)](https://forums.plex.tv/profile/discussions/Blacktwin)

Most of these scripts utilize a combination of [PlexPy](https://github.com/JonnyWong16/plexpy), [python-plexapi](https://github.com/pkkid/python-plexapi), and [requests](http://docs.python-requests.org/en/master/user/install/#install).

---

<div class="post-metadata">

**Author:** ![Blacktwin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/blacktwin/32/11185_2.png) [@Blacktwin](https://forums.plex.tv/u/Blacktwin)\
**Post date:** [October 21, 2017, 4:12pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/2 "2017-10-21T16:12:19Z")

</div>

#Scripts List  
[![Gist](https://img.shields.io/badge/gist-Blacktwin-green.svg)](https://gist.github.com/blacktwin)

Scripts pulled from my gist profile.

> **Maps**
>
> | Example | File | Description |
> | --- | --- | --- |
> | [\<img src="https://img.shields.io/badge/Image-EU\_map-blue.svg" alt=""](https://github.com/blacktwin/JBOPS/raw/master/maps/EU_map_example.PNG)[\<img src="https://img.shields.io/badge/Image-NA\_map-blue.svg" alt=""](https://github.com/blacktwin/JBOPS/raw/master/maps/NA_map_example.PNG)[\<img src="https://img.shields.io/badge/Image-World\_map-blue.svg" alt=""](https://github.com/blacktwin/JBOPS/raw/master/maps/World_map_example.PNG)[\<img src="https://img.shields.io/badge/Image-geojson-blue.svg" alt=""](https://goo.gl/9abVxE/maps/geojson_example.geojson) | [Maps](https://goo.gl/9abVxE/maps/ips_to_maps.py) | Using PlexPy data, draw a map connecting Server to Clients based on IP addresses. |

> **Fun**
>
> | Gist | File | Description |
> | --- | --- | --- |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/397f07724abebd1223ba6ea644ea1669) | [aired\_today\_playlist](https://goo.gl/9abVxE/fun/aired_today_playlist.py) | Create a Plex Playlist with what was aired on this today's month-day, sort by oldest first. If Playlist from yesterday exists delete and create today's. If today's Playlist exists exit. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/4ccb79c7d01a95176b8e88bf4890cd2b) | [plexapi\_haiku](https://goo.gl/9abVxE/fun/plexapi_haiku.py) | Create a hiaku from titles found in Plex. |

> **Kill stream**
>
> | Gist | File | Description |
> | --- | --- | --- |
> | | [wait\_kill\_pause\_notify\_main](https://goo.gl/9abVxE/killstream/wait_kill_pause_notify_main.py) | Receive session\_key from PlexPy when paused. Use sub-script [wait\_kill\_pause\_notify\_sub](https://goo.gl/9abVxE/killstream/wait_kill_pause_notify_sub.py) to wait for X time then check if still paused. If so, kill. Toggle whether you'd like to be notified through a PlexPy notification agent. |
> | | [watch\_limit](https://goo.gl/9abVxE/killstream/watch_limit.py) | Kill streams if user has watched too much Plex Today. |
> |
> | |
> | | [play\_limit](https://goo.gl/9abVxE/killstream/play_limit.py) | Kill streams if user has played too much Plex Today. |
> | | [kill\_time](https://goo.gl/9abVxE/killstream/kill_time.py) | Limit number of plays of TV Show episodes during time of day. Idea is to reduce continuous plays while sleeping. |
> | | [kill\_trans\_pause\_notify](https://goo.gl/9abVxE/killstream/kill_trans_pause_notify.py) | Kill Plex paused video transcoding streams and receive notification. |
> | | [ip\_whitelist](https://goo.gl/9abVxE/killstream/ip_whitelist.py) | Receive session\_key and IP from PlexPy when playback starts. Use IP to check against whitelist. If not in whitelist use session\_key to determine stream and kill. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/88fce565c8ecf56839641f22f4c5c422) | [kill\_all\_more\_than](https://goo.gl/9abVxE/killstream/kill_all_more_than.py) | If user has 2 or more concurrent streams kill all streams |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/d47d3ada86d02a494f9dc33e50dd15b5) | [kill\_else\_if\_buffering](https://goo.gl/9abVxE/killstream/kill_else_if_buffering.py) | Kill concurrent transcode streams of other users if Admin user is experiencing buffering warnings from PlexPy. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/6d08b94ca3e80d3ed0bb3c7172fae21d) | [kill\_more\_than](https://goo.gl/9abVxE/killstream/kill_more_than.py) | If user has 2 or more concurrent streams and the IP of the 2nd stream differs from 1st kill 2nd. If 2nd stream IP is the same as 1st stream don't kill. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/eee23eeb95f1285fbb495c5a8592b242) | [kill\_outsider\_stream](https://goo.gl/9abVxE/killstream/kill_outsider_stream.py) | Kill stream if user is outside of local network. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/8b174165cfc5e5e80c6698a1494fc9ee) | [kill\_plex\_streams](https://goo.gl/9abVxE/killstream/kill_plex_streams.py) | Kill all Plex streams for whatever reason you want. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/77f6f1be32621ed71655ca27406ef772) | [kill\_session\_bitrate](https://goo.gl/9abVxE/killstream/kill_session_bitrate.py) | Kill stream if bitrate is greater than 4 Mbps |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/0e6207346acfaaca602eb7dce80226a0) | [kill\_trans\_exp\_audio](https://goo.gl/9abVxE/killstream/kill_trans_exp_audio.py) | Kill Plex video transcoding streams only. All audio streams are left alone. Kill message based on platform. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/14d400a0f442da465389164fa046647a) | [kill\_trans\_pause](https://goo.gl/9abVxE/killstream/kill_trans_pause.py) | Kill Plex paused video transcoding streams using PlexPy. |

> **Notify**
>
> | Gist | File | Description |
> | --- | --- | --- |
> | | [notify\_delay](https://goo.gl/9abVxE/notify/notify_delay.py) | Delay Notification Agent message for concurrent streams. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/e6d589a9af9bdf168717951083861e93) | [find\_unwatched\_notify](https://goo.gl/9abVxE/notify/find_unwatched_notify.py) | Find what was added TFRAME ago and not watched and notify admin using PlexPy. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/1094dcf38249f36c8d374e0cba7a86cd) | [notify\_added\_custom](https://goo.gl/9abVxE/notify/notify_added_custom.py) | Send an email with what was added to Plex in the past week using PlexPy. Email includes title (TV: Show Name: Episode Name; Movie: Movie Title), time added, image, and summary. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/099c07d8099c18a378bba6415d9253ba) | [notify\_fav\_tv\_all\_movie](https://goo.gl/9abVxE/notify/notify_fav_tv_all_movie.py) | Notify users of recently added episode to show that they have watched at least LIMIT times via email. Also notify users of new movies. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/a2d4b2f2c3b616f1d6da0752fecb2ae7) | [notify\_newip](https://goo.gl/9abVxE/notify/notify_newip.py) | If a new IP is found send notification via the Email Notification Agent. Email contains User's Avatar image, link to location, IP address, and User's Email address. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/a327055da54d7feb3eef10e64a8b661a) | [notify\_on\_added](https://goo.gl/9abVxE/notify/notify_on_added.py) | Send an Email notification when a specific show is added to Plex. Add shows to list that you want notifications for. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/18960ff01c03b67a05594daa6f53660c) | [notify\_user\_favorites](https://goo.gl/9abVxE/notify/notify_user_favorites.py) | Notify users of recently added episode to show that they have watched at least LIMIT times via email. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/066c66328a795ebd6079a575e14f0b8b) | [notify\_user\_newip](https://goo.gl/9abVxE/notify/notify_user_newip.py) | Notify user that their account has been accessed by a new IP. IP is cleared to make sure notification is sent again. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/261c416dbed08291e6d12f6987d9bafa) | [twitter\_notify](https://goo.gl/9abVxE/notify/twitter_notify.py) | Post to Twitter when TV/Movie is added to Plex. Include custom message and embed poster image. Option to tweet to TWITTER\_USER if title is inside TITLE\_FIND. |

> **Utility**
>
> | Gist | File | Description |
> | --- | --- | --- |
> | | [plex\_api\_parental\_control](https://goo.gl/9abVxE/utility/plex_api_parental_control.py) | Set as cron or task for times of allowing and not allowing user access to server. Unsharing will kill any current stream from user before unsharing. |
> | | [plex\_api\_share](https://goo.gl/9abVxE/utility/plex_api_share.py) | Share or unshare libraries |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/f4149c296f2d1ffd1cbd863c37bb3a3c) | [bypass\_auth\_name](https://goo.gl/9abVxE/utility/bypass_auth_name.py) | Use PlexPy to pull last IP address from user and add to List of IP addresses and networks that are allowed without auth in Plex. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/0332f2dc9534bdf412ff3f664e9513c0) | [delete\_watched\_TV](https://goo.gl/9abVxE/utility/delete_watched_TV.py) | From a list of TV shows, check if users in a list has watched shows episodes. If all users in list have watched an episode of listed show, then delete episode. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/76b0abf88181618af4598092dd6b0dbb) | [find\_plex\_meta](https://goo.gl/9abVxE/utility/find_plex_meta.py) | Find location of Plex metadata. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/603d5da5b70b366e98d0d82d1aa1a470) | [find\_unwatched](https://goo.gl/9abVxE/utility/find_unwatched.py) | Find what was added TFRAME ago and not watched using PlexPy. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/f435aa0ccd498b0840d2407d599bf31d) | [grab\_gdrive\_media](https://goo.gl/9abVxE/utility/grab_gdrive_media.py) | Grab media (videos, pictures) from Google Drive. All videos and pictures were automatically synced from Google Photos to Google Drive. Puts media into MEDIA\_TYPE/YEAR/MONTH-DAY/FILE.ext directory structure. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/85a63ffd70c6ccb7c1faa70a8f33fc2e) | [plex\_api\_poster\_pull](https://goo.gl/9abVxE/utility/plex_api_poster_pull.py) | Pull Movie and TV Show poster images from Plex. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/17b58156f69cc52026b71fe4d5afea05) | [plex\_imgur\_dl](https://goo.gl/9abVxE/utility/plex_imgur_dl.py) | Pull poster images from Imgur and places them inside Shows root folder. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/f10e0a1e85af00e878963b4570a99054) | [plex\_theme\_songs](https://goo.gl/9abVxE/utility/plex_theme_songs.py) | Download theme songs from Plex TV Shows. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/45c420cbba4e18aadc8cc5090a67b9d1) | [plexapi\_delete\_playlists](https://goo.gl/9abVxE/utility/plexapi_delete_playlists.py) | Delete all playlists from Plex using PlexAPI. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/df58032de3e6f4d29f7ea562aeaebbab) | [plexapi\_search\_file](https://goo.gl/9abVxE/utility/plexapi_search_file.py) | Find full path for Plex items. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/3752a76fa0b3fc6d19e842af7b812184) | [refresh\_next\_episode](https://goo.gl/9abVxE/utility/refresh_next_episode.py) | Refresh the next episode of show once current episode is watched. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/370ca42ee20a33fb00c8253fa9bd0de7) | [remove\_watched\_movies](https://goo.gl/9abVxE/utility/remove_watched_movies.py) | Find Movies that have been watched by a list of users. If all users have watched movie then delete. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/2f619e62d99edcec27f680998379664c) | [stream\_limiter\_ban\_email](https://goo.gl/9abVxE/utility/stream_limiter_ban_email.py) | This is indented to restrict a user to the LIMIT amount of concurrent streams. User will be warned, punished, and banned completely if violations continue. |

> **Reporting**
>
> | Gist | File | Description |
> | --- | --- | --- |
> | | [weekly\_stats\_reporting](https://goo.gl/9abVxE/reporting/weekly_stats_reporting.py) | Pull library and user statistics of last week. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/21823b3394f5b077d42495b21570b593) | [added\_to\_plex](https://goo.gl/9abVxE/reporting/added_to_plex.py) | Find when media was added between STARTFRAME and ENDFRAME to Plex through PlexPy. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/f070dff29ddbeb87973be9c0a94a1df7) | [check\_play](https://goo.gl/9abVxE/reporting/check_play.py) | Check if user has play a file more than 3 times but has not finished watching. Hoping to catch play failures. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/1a8933252ad1a9bc2c97395a020c144a) | [check\_plex\_log](https://goo.gl/9abVxE/reporting/check_plex_log.py) | Checking plex logs for debug code WARN and 'Failed to obtain a streaming resource for transcode of key /library/metadata/"titleID"'. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/561c3a404754eb7b9e543867619d3251) | [drive\_check](https://goo.gl/9abVxE/reporting/drive_check.py) | Check if drive exists. If not then notify via PlexPy notifier agent. |
> | [![](https://img.shields.io/badge/gist-original-green.svg)](https://gist.github.com/blacktwin/bd905d39ab71c5d7c628e27fddd1086e) | [userplays\_weekly\_reporting](https://goo.gl/9abVxE/reporting/userplays_weekly_reporting.py) | Use PlexPy to count how many plays per user occurred this week and send email via PlexPy. |

* * *

> **Setting Up PlexPy for Custom Scripts**
>
> #### Enabling Scripts in PlexPy:
> 
> Settings \> Notification Agents \> Click the Scripts gear
> 
> - [] Set scripts location to location of your scripts
> - [] Scroll down to option you want to use and select the script from the drop down menu
> - [] Save
> 
> Settings \> Notification Agents \> Click the Bell next to Scripts
> 
> - [] Check desired trigger
> - [] Close
> 
> Settings \> Notifications \> Click Script
> 
> - [] Enter in the Script Arguments
> - [] Save

* * *

> **Common variables**
>
> > **Plex**
> >
> > - [] PLEX\_HOST - Local IP to connect to Plex (‘localhost’, ‘192.168.0.x’, ‘127.0.0.1’, etc.)
> > - [] PLEX\_PORT - Port number used by Plex (default: 32400)
> > - [] PLEX\_SSL - http:// or https://? ‘’ if http and ‘s’ if https
> > - [] PLEX\_TOKEN - [Plex](https://support.plex.tv/hc/en-us/articles/204059436-Finding-an-authentication-token-X-Plex-Token) or PlexPy Settings \> [Plex.tv](http://Plex.tv) Account \> PMS Token
> 
> > **PlexPy**
> >
> > - [] PLEXPY\_URL - Local IP to connect to PlexPy (‘localhost’, ‘192.168.0.x’, ‘127.0.0.1’, etc.)
> > - [] PLEXPY\_APIKEY - PlexPy Settings \> Access Control \> Enable API - API Key

---

<div class="post-metadata">

**Author:** ![craig91](https://avatars.discourse-cdn.com/v4/letter/c/bbce88/32.png) [@craig91](https://forums.plex.tv/u/craig91)\
**Post date:** [November 11, 2017, 4:52am UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/3 "2017-11-11T04:52:25Z")

</div>

Impressive collection!

---

<div class="post-metadata">

**Author:** ![almontef](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@almontef](https://forums.plex.tv/u/almontef)\
**Post date:** [February 23, 2018, 8:18pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/4 "2018-02-23T20:18:51Z")

</div>

@Blacktwin I am getting the following error for every internal IP when I run the ips\_to\_maps.py script:

PlexPy API ‘get\_geoip\_lookup’ request failed: The address x.x.x.x is not in the database…User: John IP: x.x.x.x caused error in geo\_dict.

I get this for all internal IPs but the chart produces my external connections just find. Is there a way to exclude the internal addresses if the error is expected because these are internal IPs?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Blacktwin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/blacktwin/32/11185_2.png) [@Blacktwin](https://forums.plex.tv/u/Blacktwin)\
**Post date:** [February 23, 2018, 9:01pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/5 "2018-02-23T21:01:19Z")

</div>

@almontef You would use the REPLACEMENT\_WAN\_IP variable to substitute your LAN\_SUBNET. The error is there to simply let you know that the local addresses aren’t being mapped.

If you don’t mind could you PM me your map? Just curious how others maps turn out. I like maps. 🙂

---

<div class="post-metadata">

**Author:** ![almontef](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@almontef](https://forums.plex.tv/u/almontef)\
**Post date:** [February 23, 2018, 11:32pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/6 "2018-02-23T23:32:29Z")

</div>

Thanks for the info! Love the script. I’ll PM you my map, not very interesting since I only got a few remote users, but will be sharing with more family in the upcoming weeks, but even then most connections will be from the northeast.

---

<div class="post-metadata">

**Author:** ![almontef](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@almontef](https://forums.plex.tv/u/almontef)\
**Post date:** [March 11, 2018, 7:49pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/7 "2018-03-11T19:49:37Z")

</div>

@Blacktwin there was a recent major update to Plexpy and the ips\_to\_maps script not longer works. It produces the following error:

python ips\_to\_maps.py  
PlexPy API ‘get\_get\_users\_tables’ request failed: No JSON object could be decoded.PlexPy API ‘get\_get\_users\_tables’ request failed: No JSON object could be decoded.Traceback (most recent call last):  
File “ips\_to\_maps.py”, line 380, in   
user\_lst = sorted(get\_get\_users\_tables(‘friendly\_name’, user\_count))  
TypeError: ‘NoneType’ object is not iterable

Is the script not compatible with the latest version of Plexpy? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Blacktwin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/blacktwin/32/11185_2.png) [@Blacktwin](https://forums.plex.tv/u/Blacktwin)\
**Post date:** [March 13, 2018, 12:33pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/8 "2018-03-13T12:33:20Z")

</div>

@almontef Thanks for the heads up. I need to go through all my scripts now that Tautulli is out of beta and update them. Some may be removed and some will be improved to work better with Tautulli.

---

<div class="post-metadata">

**Author:** ![almontef](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@almontef](https://forums.plex.tv/u/almontef)\
**Post date:** [March 13, 2018, 8:49pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/9 "2018-03-13T20:49:41Z")

</div>

Sounds good. I’ll keep my eye out for your updates. Thanks much!!

---

<div class="post-metadata">

**Author:** ![Blacktwin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/blacktwin/32/11185_2.png) [@Blacktwin](https://forums.plex.tv/u/Blacktwin)\
**Post date:** [March 16, 2018, 7:31pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/10 "2018-03-16T19:31:58Z")

</div>

@almontef the maps script should work fine. Check your URL and API key.

---

<div class="post-metadata">

**Author:** ![cw101](https://avatars.discourse-cdn.com/v4/letter/c/9d8465/32.png) [@cw101](https://forums.plex.tv/u/cw101)\
**Post date:** [March 16, 2018, 8:15pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/11 "2018-03-16T20:15:14Z")

</div>

@Blacktwin I’m having issues with the kill\_more\_than.py script. Wasn’t sure if it was a Tautulli thing or just the way I have it setup. URL and API key are setup correctly.

---

<div class="post-metadata">

**Author:** ![Blacktwin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/blacktwin/32/11185_2.png) [@Blacktwin](https://forums.plex.tv/u/Blacktwin)\
**Post date:** [March 23, 2018, 1:19pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/12 "2018-03-23T13:19:29Z")

</div>

@cw101 what are the issues? Please copy your logs to a gist and link it here.

---

<div class="post-metadata">

**Author:** ![WeapKy92](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/weapky92/32/124040_2.png) [@WeapKy92](https://forums.plex.tv/u/WeapKy92)\
**Post date:** [March 29, 2018, 9:13pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/13 "2018-03-29T21:13:52Z")

</div>

@Blacktwin Hello, first thanks for your job 😄  
I have problem when i run “**_ips\_to\_maps.py -l Geo -j (my json file)_**” i get :  
Traceback (most recent call last):  
File “ips\_to\_maps.py”, line 449, in   
print(r.json()[‘html\_url’])  
KeyError: ‘html\_url’

And when i try run “**_ips\_to\_maps.py -l World -j (my json file)_**” i get :  
Traceback (most recent call last):  
File “ips\_to\_maps.py”, line 453, in   
draw\_map(opts.location, geo\_json, filename, opts.headless)  
File “ips\_to\_maps.py”, line 327, in draw\_map  
x, y = m([float(data[‘lon’]), float(SERVER\_LON)], [float(data[‘lat’]), float(SERVER\_LAT)])  
ValueError: could not convert string to float:

If you can help me, thanks 😃

---

<div class="post-metadata">

**Author:** ![Blacktwin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/blacktwin/32/11185_2.png) [@Blacktwin](https://forums.plex.tv/u/Blacktwin)\
**Post date:** [April 2, 2018, 5:12am UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/14 "2018-04-02T05:12:49Z")

</div>

@WeapKy92 looks like you might not be able to [anonymously create gists](https://developer.github.com/v3/gists/#authentication "anonymously create gists") anymore. It’ll need an account. I’ll need to add that then.

---

<div class="post-metadata">

**Author:** ![brentbarnett](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@brentbarnett](https://forums.plex.tv/u/brentbarnett)\
**Post date:** [April 2, 2018, 9:27pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/15 "2018-04-02T21:27:54Z")

</div>

This is awesome, but I am trying to figure out what the triggers, conditions, and arguments should be for the notify\_added\_custom.py should be. The script is exactly what I am looking for. I setup the API key and believe I have the other settings correct. Just don’t know how to fire it.

---

<div class="post-metadata">

**Author:** ![Blacktwin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/blacktwin/32/11185_2.png) [@Blacktwin](https://forums.plex.tv/u/Blacktwin)\
**Post date:** [April 5, 2018, 4:44pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/16 "2018-04-05T16:44:39Z")

</div>

@brentbarnett the notify\_added\_customer.py is not to be ran by Tautulli. Set it up as a cron or task to run on a schedule.

---

<div class="post-metadata">

**Author:** ![isaacrdz](https://avatars.discourse-cdn.com/v4/letter/i/85e7bf/32.png) [@isaacrdz](https://forums.plex.tv/u/isaacrdz)\
**Post date:** [April 6, 2018, 4:07am UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/17 "2018-04-06T04:07:29Z")

</div>

[edited]

---

<div class="post-metadata">

**Author:** ![UntamedGorilla](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/untamedgorilla/32/15387_2.png) [@UntamedGorilla](https://forums.plex.tv/u/UntamedGorilla)\
**Post date:** [April 9, 2018, 2:19am UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/18 "2018-04-09T02:19:15Z")

</div>

how do you get the posters images in the emails? Mines says image unavailable

---

<div class="post-metadata">

**Author:** ![Blacktwin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/blacktwin/32/11185_2.png) [@Blacktwin](https://forums.plex.tv/u/Blacktwin)\
**Post date:** [April 13, 2018, 12:30pm UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/19 "2018-04-13T12:30:23Z")

</div>

@diablc Need a little more information. Which script?

---

<div class="post-metadata">

**Author:** ![JamminR](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jamminr/32/4261_2.png) [@JamminR](https://forums.plex.tv/u/JamminR)\
**Post date:** [May 4, 2018, 3:14am UTC](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680/20 "2018-05-04T03:14:29Z")

</div>

@blacktwin - take modification requests?  
I’m looking to use your “kill more than” python script, but with Tautulli’s new conditions capability, I have no want of it looking for the same IP, or (seemingly) hardcoded limit of 2 inside the code itself.  
Though I can read and basically understand what Python is doing, I don’t have the experience to change it and have it working myself. (I’ve tried, failure has not helped teach me)

Would you modify the script to simply look to find username’s “x” number stream and kill it?  
Or perhaps create another script that does that? “kill\_users\_Xth\_session”  
I presume this should be reasonably easy (for you) using Tautulli’s {username} and {current\_streams}.  
Trigger - Notify on User Concurrent Streams  
Arguments {username} {current\_streams} (Custom kill message?)  
I have 2 particular users who I don’t care if they use separate IPs or not, I simply want to limit them to 2 sessions at once no matter where they are (by setting my user concurrent threshold at 3, and conditional statements to ‘username is blah’ or ‘username is blah2’)  
(They do share information I think, but let them punish themselves if the same internet household tries to watch 2 streams while the shared household is already watching something)

Bonus points for including the shutdown message to them indicating the stream limit (like the kill paused does)

[Next page](https://forums.plex.tv/t/jbops-just-a-bunch-of-plex-scripts/208680.md?page=2)
