diff --git a/fun/plexapi_haiku.py b/fun/plexapi_haiku.py index 4097b71..3b7c4d2 100644 --- a/fun/plexapi_haiku.py +++ b/fun/plexapi_haiku.py @@ -4,6 +4,7 @@ """ https://gist.github.com/blacktwin/4ccb79c7d01a95176b8e88bf4890cd2b """ +from __future__ import print_function from plexapi.server import PlexServer import random diff --git a/killstream/kill_else_if_buffering.py b/killstream/kill_else_if_buffering.py index b469c38..14e51db 100644 --- a/killstream/kill_else_if_buffering.py +++ b/killstream/kill_else_if_buffering.py @@ -15,6 +15,7 @@ Tautulli > Settings > Notification Agents > Scripts > Gear icon: Buffer Warnings: kill_else_if_buffering.py """ +from __future__ import print_function import requests from operator import itemgetter diff --git a/killstream/kill_stream.py b/killstream/kill_stream.py index d23a874..59a0442 100644 --- a/killstream/kill_stream.py +++ b/killstream/kill_stream.py @@ -45,6 +45,7 @@ Tautulli > Settings > Notification Agents > New Script > Script Arguments: Save Close """ +from __future__ import print_function import os diff --git a/killstream/limiterr.py b/killstream/limiterr.py index c3fdc76..5e16754 100644 --- a/killstream/limiterr.py +++ b/killstream/limiterr.py @@ -45,6 +45,7 @@ Taultulli > Settings > Notification Agents > New Script > Script Arguments: Save Close """ +from __future__ import print_function import requests import argparse diff --git a/maps/ips_to_maps.py b/maps/ips_to_maps.py index a78d160..1109f55 100644 --- a/maps/ips_to_maps.py +++ b/maps/ips_to_maps.py @@ -26,6 +26,7 @@ optional arguments: """ +from __future__ import print_function import requests import sys diff --git a/notify/find_unwatched_notify.py b/notify/find_unwatched_notify.py index d21cb81..32ab1dd 100644 --- a/notify/find_unwatched_notify.py +++ b/notify/find_unwatched_notify.py @@ -6,6 +6,7 @@ Find what was added TFRAME ago and not watched and notify admin using Tautulli. TAUTULLI_URL + delete_media_info_cache?section_id={section_id} """ +from __future__ import print_function import requests import sys diff --git a/notify/notify_delay.py b/notify/notify_delay.py index b2bbecb..9475b01 100644 --- a/notify/notify_delay.py +++ b/notify/notify_delay.py @@ -16,6 +16,7 @@ Tautulli > Settings > Notification Agents > Scripts > Gear icon: Tautulli Settings > Notification Agents > Scripts (Gear) > Script Timeout: 0 to disable or set to > 180 """ +from __future__ import print_function import requests import sys diff --git a/notify/notify_fav_tv_all_movie.py b/notify/notify_fav_tv_all_movie.py index 5e96732..5c4a247 100644 --- a/notify/notify_fav_tv_all_movie.py +++ b/notify/notify_fav_tv_all_movie.py @@ -17,6 +17,7 @@ Tautulli > Settings > Notification Agents > Scripts > Bell icon: Tautulli > Settings > Notification Agents > Scripts > Gear icon: Recently Added: notify_fav_tv_all_movie.py """ +from __future__ import print_function import requests from email.mime.text import MIMEText diff --git a/notify/notify_recently_aired.py b/notify/notify_recently_aired.py index 821eff6..5c7c810 100644 --- a/notify/notify_recently_aired.py +++ b/notify/notify_recently_aired.py @@ -43,6 +43,7 @@ Note: The notifier_id in the edit section will need to be this other notification agent you intend to use. It does not have to be an active notification agent, just setup. """ +from __future__ import print_function import os import sys import requests diff --git a/notify/notify_user_favorites.py b/notify/notify_user_favorites.py index 165fcc6..543c0c4 100644 --- a/notify/notify_user_favorites.py +++ b/notify/notify_user_favorites.py @@ -16,6 +16,7 @@ Tautulli > Settings > Notification Agents > Scripts > Bell icon: Tautulli > Settings > Notification Agents > Scripts > Gear icon: Recently Added: notify_user_favorite.py """ +from __future__ import print_function import requests from email.mime.text import MIMEText diff --git a/notify/notify_user_newip.py b/notify/notify_user_newip.py index c88a90d..74586ff 100644 --- a/notify/notify_user_newip.py +++ b/notify/notify_user_newip.py @@ -9,6 +9,7 @@ Set api_sql = 1 in the config file. Restart Tautulli. Place in Playback Start """ +from __future__ import print_function import argparse import requests import sys diff --git a/reporting/added_to_plex.py b/reporting/added_to_plex.py index 822067a..3e7c7e3 100644 --- a/reporting/added_to_plex.py +++ b/reporting/added_to_plex.py @@ -7,6 +7,7 @@ Find when media was added between STARTFRAME and ENDFRAME to Plex through Tautul Some Exceptions have been commented out to supress what is printed. Uncomment Exceptions if you run into problem and need to investigate. """ +from __future__ import print_function import requests import sys @@ -164,10 +165,10 @@ for i in glt: # Find movie rating_key. show_lst += [int(x.rating_key)] except Exception as e: - print("Rating_key failed: {e}").format(e=e) + print(("Rating_key failed: {e}").format(e=e)) except Exception as e: - print("Library media info failed: {e}").format(e=e) + print(("Library media info failed: {e}").format(e=e)) # All rating_keys for episodes and movies. # Reserving order will put newest rating_keys first diff --git a/reporting/check_plex_log.py b/reporting/check_plex_log.py index de8f168..4c8eb3e 100644 --- a/reporting/check_plex_log.py +++ b/reporting/check_plex_log.py @@ -6,6 +6,7 @@ Run script by itself. Will look for WARN code followed by /library/metadata/ str This is find files that are corrupt or having playback issues. I corrupted a file to test. """ +from __future__ import print_function import requests import sys diff --git a/reporting/library_play_days.py b/reporting/library_play_days.py index c3fc4f3..5b10bc0 100644 --- a/reporting/library_play_days.py +++ b/reporting/library_play_days.py @@ -24,6 +24,7 @@ Usage: Plays: 56 : 754 : 2899 """ +from __future__ import print_function import requests import sys diff --git a/reporting/plays_by_library.py b/reporting/plays_by_library.py index fba72d9..ce2a28b 100644 --- a/reporting/plays_by_library.py +++ b/reporting/plays_by_library.py @@ -17,6 +17,7 @@ Usage: Movies - Plays: 379 """ +from __future__ import print_function import requests import sys diff --git a/reporting/plex_netflix_check.py b/reporting/plex_netflix_check.py index d5bd0df..0c588ba 100644 --- a/reporting/plex_netflix_check.py +++ b/reporting/plex_netflix_check.py @@ -26,6 +26,7 @@ optional arguments: If title is matched in both, Amazon is first then Netflix. """ +from __future__ import print_function import requests import argparse diff --git a/reporting/server_compare.py b/reporting/server_compare.py index d31d3fd..d031f06 100644 --- a/reporting/server_compare.py +++ b/reporting/server_compare.py @@ -17,6 +17,7 @@ Requires: requests, plexapi python find_diff_other_servers.py --server "My Plex Server" --server PlexServer2 --server "Steven Plex" """ +from __future__ import print_function import argparse import requests diff --git a/reporting/watched_percentages.py b/reporting/watched_percentages.py index f9507eb..795d58d 100644 --- a/reporting/watched_percentages.py +++ b/reporting/watched_percentages.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from __future__ import print_function import time import argparse from plexapi.myplex import MyPlexAccount @@ -292,7 +293,7 @@ if __name__ == '__main__': else: user_dict[user] = {library: section_watched_total} except Exception as e: - print(user, e) + print((user, e)) if user_dict.get(user): user_dict[user].update({library: 0}) else: @@ -341,7 +342,7 @@ if __name__ == '__main__': start += count except Exception as e: - print(user, e) + print((user, e)) section_watched_total = len(list(set(section_watched_lst))) percent_watched = 100 * (float(section_watched_total) / float(section_total)) diff --git a/reporting/weekly_stats_reporting.py b/reporting/weekly_stats_reporting.py index f007417..5ebd2b4 100644 --- a/reporting/weekly_stats_reporting.py +++ b/reporting/weekly_stats_reporting.py @@ -11,6 +11,7 @@ User stats display username and hour, minutes, and seconds of view time Tautulli Settings > Extra Settings > Check - Calculate Total File Sizes [experimental] ...... wait """ +from __future__ import print_function from plexapi.server import CONFIG from datetime import datetime, timedelta, date from requests import Session diff --git a/utility/add_label_recently_added.py b/utility/add_label_recently_added.py index e3bfad7..b070f16 100644 --- a/utility/add_label_recently_added.py +++ b/utility/add_label_recently_added.py @@ -17,6 +17,7 @@ # * Recently Added: # --title {title} --section_id {section_id} --media_type {media_type} --rating_key {rating_key} --parent_rating_key {parent_rating_key} --grandparent_rating_key {grandparent_rating_key} --label "Label" +from __future__ import print_function import argparse import os import requests diff --git a/utility/bypass_auth_name.py b/utility/bypass_auth_name.py index 5c0c4af..9e077e1 100644 --- a/utility/bypass_auth_name.py +++ b/utility/bypass_auth_name.py @@ -16,6 +16,7 @@ optional arguments: List of IP addresses is cleared before adding new IPs """ +from __future__ import print_function import requests import argparse diff --git a/utility/delete_watched_TV.py b/utility/delete_watched_TV.py index b5f5c09..72deb03 100644 --- a/utility/delete_watched_TV.py +++ b/utility/delete_watched_TV.py @@ -7,6 +7,7 @@ If all users in list have watched an episode of listed show, then delete episode Add deletion via Plex. """ +from __future__ import print_function import requests import sys diff --git a/utility/enable_disable_all_guest_access.py b/utility/enable_disable_all_guest_access.py index 42c4511..24b4ffc 100644 --- a/utility/enable_disable_all_guest_access.py +++ b/utility/enable_disable_all_guest_access.py @@ -6,6 +6,7 @@ Author: DirtyCajunRice Requires: requests, python3.6+ """ +from __future__ import print_function from requests import Session from json.decoder import JSONDecodeError diff --git a/utility/find_plex_meta.py b/utility/find_plex_meta.py index de7dba1..7e163c1 100644 --- a/utility/find_plex_meta.py +++ b/utility/find_plex_meta.py @@ -10,6 +10,7 @@ or find_plex_meta.py -s adventure -m movie pulls all movie titles with adventure in the title ''' +from __future__ import print_function from plexapi.server import PlexServer, CONFIG diff --git a/utility/find_unwatched.py b/utility/find_unwatched.py index 9cb9743..030ad05 100644 --- a/utility/find_unwatched.py +++ b/utility/find_unwatched.py @@ -4,6 +4,7 @@ """ Find what was added TFRAME ago and not watched using Tautulli. """ +from __future__ import print_function import requests import sys @@ -148,10 +149,10 @@ for i in glt: # Find movie rating_key. show_lst += [int(x.rating_key)] except Exception as e: - print("Rating_key failed: {e}").format(e=e) + print(("Rating_key failed: {e}").format(e=e)) except Exception as e: - print("Library media info failed: {e}").format(e=e) + print(("Library media info failed: {e}").format(e=e)) # Remove reverse sort if you want the oldest keys first. for i in sorted(show_lst, reverse=True): @@ -169,7 +170,7 @@ for i in sorted(show_lst, reverse=True): path_lst += [x.file] except Exception as e: - print("Metadata failed. Likely end of range: {e}").format(e=e) + print(("Metadata failed. Likely end of range: {e}").format(e=e)) delete_files(path_lst) diff --git a/utility/get_serial_transcoders.py b/utility/get_serial_transcoders.py index da4baba..81f7ec2 100644 --- a/utility/get_serial_transcoders.py +++ b/utility/get_serial_transcoders.py @@ -6,6 +6,7 @@ Author: DirtyCajunRice Requires: requests, plexapi, python3.6+ """ +from __future__ import print_function from requests import Session from plexapi.server import CONFIG from datetime import date, timedelta diff --git a/utility/grab_gdrive_media.py b/utility/grab_gdrive_media.py index 612c32c..5cc663f 100644 --- a/utility/grab_gdrive_media.py +++ b/utility/grab_gdrive_media.py @@ -4,6 +4,7 @@ """ https://gist.github.com/blacktwin/f435aa0ccd498b0840d2407d599bf31d """ +from __future__ import print_function import os import httplib2 diff --git a/utility/mark_multiepisode_watched.py b/utility/mark_multiepisode_watched.py index 8878a8d..ea6c6c2 100644 --- a/utility/mark_multiepisode_watched.py +++ b/utility/mark_multiepisode_watched.py @@ -15,6 +15,7 @@ # * Watched: # --rating_key {rating_key} --filename {filename} +from __future__ import print_function import argparse import os from plexapi.server import PlexServer diff --git a/utility/media_manager.py b/utility/media_manager.py index c6e030c..808f615 100644 --- a/utility/media_manager.py +++ b/utility/media_manager.py @@ -23,6 +23,7 @@ Enabling Scripts in Tautulli: python media_manager.py --libraries "TV Shows" --select watched --users User1 User2 """ +from __future__ import print_function import argparse import datetime import time @@ -591,7 +592,7 @@ if __name__ == '__main__': if opts.select == "watched": if libraries: for user in user_lst: - print("Finding watched items from user: {}",format(user.name)) + print(("Finding watched items from user: {}",format(user.name))) for _library in libraries: print("Checking library: '{}' watch statuses...".format(_library.title)) watched_work(user=user, sectionID=_library.key) diff --git a/utility/off_deck.py b/utility/off_deck.py index fa08715..240c984 100644 --- a/utility/off_deck.py +++ b/utility/off_deck.py @@ -44,6 +44,7 @@ original. * For episodes of show not watched the view count will be set to 1. """ +from __future__ import print_function import requests import argparse diff --git a/utility/plex_api_invite.py b/utility/plex_api_invite.py index c30d8db..b360e02 100644 --- a/utility/plex_api_invite.py +++ b/utility/plex_api_invite.py @@ -36,6 +36,7 @@ Usage: - Share Movie library with USER but restrict them to only G and PG-13 titles. """ +from __future__ import print_function from plexapi.server import PlexServer, CONFIG import argparse diff --git a/utility/plex_api_parental_control.py b/utility/plex_api_parental_control.py index b460510..21eab66 100644 --- a/utility/plex_api_parental_control.py +++ b/utility/plex_api_parental_control.py @@ -36,6 +36,7 @@ Usage: - USER is still exists as a Friend or Home User """ +from __future__ import print_function import argparse diff --git a/utility/plex_api_poster_pull.py b/utility/plex_api_poster_pull.py index 82bef61..47f3895 100644 --- a/utility/plex_api_poster_pull.py +++ b/utility/plex_api_poster_pull.py @@ -13,6 +13,7 @@ Requires: plexapi python plex_api_poster_pull.py """ +from __future__ import print_function from plexapi.server import PlexServer, CONFIG import requests diff --git a/utility/plex_api_share.py b/utility/plex_api_share.py index f09a09e..4f4759a 100644 --- a/utility/plex_api_share.py +++ b/utility/plex_api_share.py @@ -98,6 +98,7 @@ Usage: - Shared [all libraries but Movies] with USER. """ +from __future__ import print_function from plexapi.server import PlexServer, CONFIG import time diff --git a/utility/plex_api_show_settings.py b/utility/plex_api_show_settings.py index 513398e..2220500 100644 --- a/utility/plex_api_show_settings.py +++ b/utility/plex_api_show_settings.py @@ -24,6 +24,7 @@ python plex_api_show_settings.py --libraries "TV Shows" --watched 7 python plex_api_show_settings.py --libraries "TV Shows" --unwatched -7 - Keep Episodesfrom the past 7 days """ +from __future__ import print_function import argparse import requests from plexapi.server import PlexServer, CONFIG diff --git a/utility/plex_dance.py b/utility/plex_dance.py index 720afe8..2916421 100644 --- a/utility/plex_dance.py +++ b/utility/plex_dance.py @@ -45,6 +45,7 @@ Script Dance moves Please use this script to update your Tautulli database with the new rating key https://gist.github.com/JonnyWong16/f554f407832076919dc6864a78432db2 """ +from __future__ import print_function from plexapi.server import PlexServer from plexapi.server import CONFIG diff --git a/utility/plex_imgur_dl.py b/utility/plex_imgur_dl.py index 47f4a94..6b59318 100644 --- a/utility/plex_imgur_dl.py +++ b/utility/plex_imgur_dl.py @@ -8,6 +8,7 @@ Pull poster images from Imgur and places them inside Shows root folder. Skips download if showname.jpg exists or if show does not exist. """ +from __future__ import print_function import requests import urllib diff --git a/utility/plex_popular_playlist.py b/utility/plex_popular_playlist.py index a2132b5..2506847 100644 --- a/utility/plex_popular_playlist.py +++ b/utility/plex_popular_playlist.py @@ -16,6 +16,7 @@ optional arguments: * LIBRARY_EXCLUDE are excluded from libraries choice. """ +from __future__ import print_function import requests diff --git a/utility/purge_removed_plex_friends.py b/utility/purge_removed_plex_friends.py index 23ab4e5..e00e96d 100644 --- a/utility/purge_removed_plex_friends.py +++ b/utility/purge_removed_plex_friends.py @@ -6,6 +6,7 @@ Author: DirtyCajunRice Requires: requests, plexapi, python3.6+ """ +from __future__ import print_function from requests import Session from plexapi.server import CONFIG diff --git a/utility/recently_added_collection.py b/utility/recently_added_collection.py index 5b429e7..92fc1d3 100644 --- a/utility/recently_added_collection.py +++ b/utility/recently_added_collection.py @@ -14,6 +14,7 @@ # * Recently Added: # --rating_key {rating_key} --collection "New Releases" --days 180 +from __future__ import print_function import argparse import os from datetime import datetime, timedelta diff --git a/utility/refresh_next_episode.py b/utility/refresh_next_episode.py index db169e8..d090a71 100644 --- a/utility/refresh_next_episode.py +++ b/utility/refresh_next_episode.py @@ -15,6 +15,7 @@ Check Tautulli's Watched Percent in Tautulli > Settings > General {show_name} {episode_num00} {season_num00} """ +from __future__ import print_function import requests import sys diff --git a/utility/remove_inactive_users.py b/utility/remove_inactive_users.py index 7576acb..b623e8f 100644 --- a/utility/remove_inactive_users.py +++ b/utility/remove_inactive_users.py @@ -7,6 +7,7 @@ Just run. Comment out `remove_friend(username)` and `unshare(username)` to test. """ +from __future__ import print_function from sys import exit from requests import Session from datetime import datetime diff --git a/utility/remove_watched_movies.py b/utility/remove_watched_movies.py index fd99190..11e3f32 100644 --- a/utility/remove_watched_movies.py +++ b/utility/remove_watched_movies.py @@ -5,6 +5,7 @@ Deletion is prompted """ +from __future__ import print_function import requests import sys diff --git a/utility/rename_seasons.py b/utility/rename_seasons.py index 7747044..c8d9891 100644 --- a/utility/rename_seasons.py +++ b/utility/rename_seasons.py @@ -5,6 +5,7 @@ # Author: /u/SwiftPanda16 # Requires: plexapi +from __future__ import print_function from plexapi.server import PlexServer diff --git a/utility/stream_limiter_ban_email.py b/utility/stream_limiter_ban_email.py index 1eccc2d..b3c36e5 100644 --- a/utility/stream_limiter_ban_email.py +++ b/utility/stream_limiter_ban_email.py @@ -49,6 +49,7 @@ Clear user history for banned video to remove violation counts and run manually Concurrent stream count is the trigger. Trigger can be anything you want. """ +from __future__ import print_function import requests diff --git a/utility/sync_watch_status.py b/utility/sync_watch_status.py index bdeee41..052a7e9 100644 --- a/utility/sync_watch_status.py +++ b/utility/sync_watch_status.py @@ -55,6 +55,7 @@ Taultulli > Settings > Notification Agents > New Script > Script Arguments: on selected servers. **Rating key must be a movie or episode. Shows and Seasons not support.... yet. """ +from __future__ import print_function import argparse from plexapi.myplex import MyPlexAccount from plexapi.server import PlexServer diff --git a/utility/tautulli_friendly_name_to_ombi_alias_sync.py b/utility/tautulli_friendly_name_to_ombi_alias_sync.py index b5c3de7..e3a0b6c 100644 --- a/utility/tautulli_friendly_name_to_ombi_alias_sync.py +++ b/utility/tautulli_friendly_name_to_ombi_alias_sync.py @@ -6,6 +6,7 @@ Author: DirtyCajunRice Requires: requests, python3.6+ """ +from __future__ import print_function from requests import Session from plexapi.server import CONFIG from urllib3 import disable_warnings