Giter Club home page Giter Club logo

purgeomatic's Introduction

purgeomatic - Seek out and delete content nobody is watching.

๐Ÿ’ฃ This software will delete your data! ๐Ÿ’ฃ

Python Code style: black License: GPL v3

Introduction

Features

  • Compatible with cron
  • Delete unwatched movies & tv series
  • Delete a single movie from Radarr/Tautulli/Overseerr using delete.movie.py
  • Supports a 'dry run' mode so you can test it
  • Supports a whitelist of content that should never be deleted using TMDB/TVDB IDs in the protected file

Summary

I could never get the JBOPS scripts to work, and disk utilization has been a problem that crops up every few months for several years running, so I finally sat down and wrote my own script. It relies on being able to access an API for tautulli/radarr/sonarr, and it will also delete the media entry from overseerr if you use it.

The gist of the code is that it uses Tautulli's API to list all of the media in the media_info table for Tautulli's movie & tv sections (in my case those are "section_id=1" for movies and "section_id=2" for tv). Then it steps through every media item it finds and checks if it's been watched in a while. If it hasn't, it gets deleted!

The delete is accomplished by it looking up the item using Radarr/Sonarr's API. It also connects to Overseerr's API and deletes the movie based on the TMDB/TVDB ID it pulls from Radarr/Sonarr's entry.

How to use

Requirements

  • Tautulli
  • Radarr (if deleting movies)
  • Sonarr (if deleting TV)
  • Overseerr (optional: the script will work without an overseer configuration)

Please note: these scripts rely on Plex's metadata to supply TMDB/TVDB IDs. Please take a moment to refresh the metadata in your Plex libraries before running them.

Scripts

There are three main scripts in this package:

  • delete.movies.unwatched.py: For bulk-deleting movies that nobody has watched in a while.
  • delete.tv.unwatched.py: For bulk-deleting entire TV series that nobody has watched in a while.
  • delete.movie.py: For deleting a single movie from Radar/Overseerr/Tautulli.

Usage

The easiest way to use this software is via the published container image. You can either pass all of the variables on the command line (-e VARIABLE) or use a local .env file, which I recommend. You can pull the .env.example file from this project and rename it to .env to start.

There are defaults for nearly every setting. You'll absolutely need to set the API keys for your Radarr/Sonarr/Overseerr/Tautulli applications. Anything commented out in that example file is the default setting. If it works for you, you don't need to set it!

If your *arr applications are running on the same machine you're using to run these scripts, you'll need to use the --network=host configuration flag, or the container won't be able to talk to localhost.

Once you've got your .env file configured, call it with:

docker run --rm -it --env-file .env --network=host ghcr.io/ask-me-about-loom/purgeomatic:latest python delete.movies.unwatched.py

Example output:

$ docker run --rm -it --env-file .env --network=host ghcr.io/ask-me-about-loom/purgeomatic:latest python delete.movies.unwatched.py
DRY_RUN enabled!
--------------------------------------
2023-08-25T12:40:57.288608
DRY RUN: Chaos Walking | Radarr ID: 1445 | TMDB ID: 412656
DRY RUN: Captain Marvel | Radarr ID: 885 | TMDB ID: 299537
DRY RUN: Captain America: Civil War | Radarr ID: 1768 | TMDB ID: 271110
DRY RUN: Black Widow | Radarr ID: 1517 | TMDB ID: 497698
DRY RUN: Birds of Prey (and the Fantabulous Emancipation of One Harley Quinn) | Radarr ID: 1092 | TMDB ID: 495764
DRY RUN: Bill & Ted's Excellent Adventure | Radarr ID: 1777 | TMDB ID: 1648
DRY RUN: Bill & Ted's Bogus Journey | Radarr ID: 1778 | TMDB ID: 1649
DRY RUN: Big Hero 6 | Radarr ID: 71 | TMDB ID: 177572
DRY RUN: Big | Radarr ID: 71 | TMDB ID: 177572
DRY RUN: Batman Begins | Radarr ID: 1745 | TMDB ID: 272
DRY RUN: Assault on Precinct 13 | Radarr ID: 1212 | TMDB ID: 17814
DRY RUN: 21 Jump Street | Radarr ID: 1096 | TMDB ID: 64688
Total space reclaimed: 164.88GB

Protected items

If you like, you can protect items from deletion. Create a file called protected and put the TMDB or TVDB IDs you never want to delete in it, one per line. When you invoke the script, volume mount the protected file into /app/protected and any specific media IDs found in the file will be ignored, even in dry run mode.

Example command:

docker run --rm -it --env-file .env --network=host -v /home/user/protected:/app/protected ghcr.io/ask-me-about-loom/purgeomatic:latest python delete.movies.unwatched.py

An example of the contents of a protected file:

4011
278
238
10386

Note: because the protected file uses TMDB & TVDB IDs, there is a possibility of overlap. If you're concerned about this, I suggest you create separate files for running with the TV and movie deletes, i.e. -v /home/user/protectedtv:/app/protected and -v /home/user/protectedmovies:/app/protected.

Alternate usage

If you wish, you can also run the python code yourself. This code has been tested on python 3.10 and 3.11.

Example steps (may vary depending on your environment):

  1. Clone the repo:
git clone https://github.com/ASK-ME-ABOUT-LOOM/purgeomatic.git
  1. Update your .env file:
cd purgeomatic
mv .env.example .env
  1. Create your venv:
make venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Run the code:
python delete.movies.unwatched.py

Configuration

The scripts use the following environment variables for configuration:

  • RADARR: The URL & port of your Radarr installation, e.g. http://localhost:7878

  • RADARR_API: The API key for accessing your Radarr installation

  • TAUTULLI: The URL & port of your Tautulli installation, e.g. http://localhost:8181

  • TAUTULLI_API: The API key for accessing your Tautulli installation

  • SONARR: The URL & port of your Sonarr installation, e.g. http://localhost:8989

  • SONARR_API: The API key for accessing your Sonarr installation

  • OVERSEERR: The URL & port of your Overseerr installation, e.g. http://localhost:5055

  • OVERSEERR_API: The API key for accessing your Overseerr installation. Be sure to comment out the Overseerr connection variables in your .env file if you don't use Overseerr. It will keep your logs neat.

  • TAUTULLI_MOVIE_SECTIONID: Default: 1. The section ID in Tautulli containing watch history metadata of movies. You can get this by going to Tautulli, clicking "Libraries," then clicking the library you want to use. Look at the URL bar and you'll see "library?section_id=". You want the number after "section_id=".

  • TAUTULLI_TV_SECTIONID: Default: 2. The section ID in Tautulli containing watch history metadata of TV shows. You can get this by going to Tautulli, clicking "Libraries," then clicking the library you want to use. Look at the URL bar and you'll see "library?section_id=". You want the number after "section_id=".

  • TAUTULLI_NUM_ROWS: Default: 3000. The maximum number of rows to fetch from Tautulli. This is required by the API call. Do you have more than 3000 media items? Increase the number. Otherwise the default will do just fine.

  • DAYS_SINCE_LAST_WATCH: Default: 500. The default of 500 means that if it has been 500 days since anybody watched this media item, the script should delete it.

  • DAYS_WITHOUT_WATCH: Default: 60. Sometimes people add media, but never watch it. The default of 60 means that if media got added, but nobody has watched it in 60 days, it gets purged. Set this to 0 to disable.

  • DRY_RUN: Default: off. Enabling dry run mode means none of these scripts will execute a delete. The very existence of this variable enables dry run mode - setting it to nothing or "" or even to "false" will still enable it. Disable it by commenting it out from your .env file or removing it entirely.

Examples

delete.movies.unwatched.py

$ docker run --rm -it --env-file .env --network=host ghcr.io/ask-me-about-loom/purgeomatic:latest python delete.movies.unwatched.py
--------------------------------------
2023-08-25T13:08:48.093402
DELETED: Willard | Radarr ID: 1906 | TMDB ID: 42532
DELETED: Up | Radarr ID: 908 | TMDB ID: 14160
DELETED: Super Mario Bros. | Radarr ID: 2133 | TMDB ID: 9607
DELETED: Spider-Man | Radarr ID: 997 | TMDB ID: 429617
DELETED: Predator | Radarr ID: 1982 | TMDB ID: 106
DELETED: Plane | Radarr ID: 2067 | TMDB ID: 646389
DELETED: Fall | Radarr ID: 2025 | TMDB ID: 985939
DELETED: Dune | Radarr ID: 1613 | TMDB ID: 841
DELETED: Dog | Radarr ID: 1837 | TMDB ID: 626735
Total space reclaimed: 158.70GB

delete.tv.unwatched.py

$ docker run --rm -it --env-file .env --network=host ghcr.io/ask-me-about-loom/purgeomatic:latest python delete.tv.unwatched.py
--------------------------------------
2023-08-25T13:12:54.044326
DELETED: Tiny Beautiful Things | Sonarr ID: 566 | TVDB ID: 420985
DELETED: National Treasure: Edge of History | Sonarr ID: 539 | TVDB ID: 382210
DELETED: American Idol | Sonarr ID: 520 | TVDB ID: 70814
Total space reclaimed: 117.63GB

delete.movie.py

$ docker run --rm -it --env-file .env --network=host ghcr.io/ask-me-about-loom/purgeomatic:latest python delete.movie.py --title "Harry Potter"
[0] Delete nothing
[1] Harry Potter and the Sorcerer's Stone (2001)
[2] Harry Potter and the Prisoner of Azkaban (2004)
[3] Harry Potter and the Order of the Phoenix (2007)
[4] Harry Potter and the Goblet of Fire (2005)
[5] Harry Potter and the Deathly Hallows: Part 2 (2011)
[6] Harry Potter and the Deathly Hallows: Part 1 (2010)
[7] Harry Potter and the Chamber of Secrets (2002)
*** The selected movie will be deleted ***
Choose a movie to delete [0]: 7
DELETED: Harry Potter and the Chamber of Secrets | Radarr ID: 2292 | TMDB ID: 672
Total space reclaimed: 17.03GB

Transmission

If you're looking for support for Transmission, this project doesn't have it, but you can find a fork here which does: https://github.com/ronilaukkarinen/purgeomatic

Thanks ronilaukkarinen!

Synology

Here's a great writeup for getting this project working on your Synology box if you're just getting started. Credit to /u/OkBoomerEh on reddit.

Common Problems

I'm getting this weird Python error about JSON / connection string / whatever. What am I doing wrong?

Before opening an issue, please double-check your connection settings in your .env file or the environment variables! Nearly every time, the problem has been a typo in the API key or connection string, or it's been that the Section IDs are not correct.

As a reminder, to get the correct section ID for a given library, go to Tautulli, click "Libraries," then click the library you want to use. Look at the URL bar and you'll see "library?section_id=". You want the number after "section_id=".

I get the error "the input device is not a TTY" when I run the script with cron.

Make sure to remove the -it from the command line, which indicates to Docker that you'd like an interactive shell.

Contributors

HitCount

purgeomatic's People

Contributors

ask-me-about-loom avatar jamsrepos avatar petergreen86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

purgeomatic's Issues

Script seems to crash at variable times. Also get error message with each movie or TV show.

Output below. I am running this in Docker.

sudo docker run --rm -it --env-file environment.env ghcr.io/ask-me-about-loom/purgeomatic:latest python delete.tv.unwatched.py
DRY_RUN enabled!

2023-09-12T06:28:03.563757
ERROR: The Young Ones: Extra data: line 1 column 5 (char 4)
ERROR: Years and Years: Extra data: line 1 column 5 (char 4)
ERROR: Wonders of the Universe: Extra data: line 1 column 5 (char 4)
ERROR: Wolf Pack: Extra data: line 1 column 5 (char 4)
ERROR: Wolf Like Me: Extra data: line 1 column 5 (char 4)
ERROR: The Witcher: Extra data: line 1 column 5 (char 4)
ERROR: Will & Grace: Extra data: line 1 column 5 (char 4)
ERROR: Wild Wild Country: Extra data: line 1 column 5 (char 4)
ERROR: When They See Us: Extra data: line 1 column 5 (char 4)
ERROR: Wayne: Extra data: line 1 column 5 (char 4)
ERROR: WandaVision: Extra data: line 1 column 5 (char 4)
ERROR: Vikings: Valhalla: Extra data: line 1 column 5 (char 4)
ERROR: Vikings: Extra data: line 1 column 5 (char 4)
ERROR: Vigil: Extra data: line 1 column 5 (char 4)
ERROR: Upright: Extra data: line 1 column 5 (char 4)
ERROR: The Unicorn: Extra data: line 1 column 5 (char 4)
ERROR: The Undoing: Extra data: line 1 column 5 (char 4)
ERROR: The Twilight Zone (2019): Extra data: line 1 column 5 (char 4)
ERROR: The Twelve (AU): Extra data: line 1 column 5 (char 4)
ERROR: Turning Point: 9/11 and the War on Terror: Extra data: line 1 column 5 (char 4)
ERROR: Treasures of Ancient Egypt: Extra data: line 1 column 5 (char 4)
ERROR: Top Gear: Extra data: line 1 column 5 (char 4)
ERROR: Tiger King: Extra data: line 1 column 5 (char 4)
ERROR: The Terror: Extra data: line 1 column 5 (char 4)
ERROR: Tell Me Lies: Extra data: line 1 column 5 (char 4)
ERROR: A Teacher: Extra data: line 1 column 5 (char 4)
ERROR: Tales from the Loop: Extra data: line 1 column 5 (char 4)
ERROR: The Super Switch: Extra data: line 1 column 5 (char 4)
ERROR: Strike Back: Extra data: line 1 column 5 (char 4)
ERROR: The Stranger (2020): Extra data: line 1 column 5 (char 4)
ERROR: Stephen Fry: Out There: Extra data: line 1 column 5 (char 4)
ERROR: Stay Close: Extra data: line 1 column 5 (char 4)
ERROR: StartUp (2016): Extra data: line 1 column 5 (char 4)
ERROR: StarTalk with Neil deGrasse Tyson: Extra data: line 1 column 5 (char 4)
ERROR: Squid Game: Extra data: line 1 column 5 (char 4)
ERROR: Soul Mates: Extra data: line 1 column 5 (char 4)
ERROR: Solar Opposites: Extra data: line 1 column 5 (char 4)
ERROR: The Sinner: Extra data: line 1 column 5 (char 4)
ERROR: The Simpsons: Extra data: line 1 column 5 (char 4)
ERROR: Silicon Valley: Extra data: line 1 column 5 (char 4)
ERROR: The Silent Sea: Extra data: line 1 column 5 (char 4)
ERROR: Sick of It: Extra data: line 1 column 5 (char 4)
ERROR: The Shop: Uninterrupted: Extra data: line 1 column 5 (char 4)
ERROR: Shark Wranglers: Extra data: line 1 column 5 (char 4)
ERROR: Shameless (US): Extra data: line 1 column 5 (char 4)
ERROR: Shadow and Bone: Extra data: line 1 column 5 (char 4)
ERROR: Seinfeld: Extra data: line 1 column 5 (char 4)
ERROR: Schitt's Creek: Extra data: line 1 column 5 (char 4)
ERROR: Santa Clarita Diet: Extra data: line 1 column 5 (char 4)
ERROR: Samurai Champloo: Extra data: line 1 column 5 (char 4)
ERROR: Russian Doll: Extra data: line 1 column 5 (char 4)
ERROR: RUN (2020): Extra data: line 1 column 5 (char 4)
ERROR: Round the Twist: Extra data: line 1 column 5 (char 4)
ERROR: The Responder: Extra data: line 1 column 5 (char 4)
ERROR: Real Husbands of Hollywood: More Kevin, More Problems: Extra data: line 1 column 5 (char 4)
ERROR: Real Husbands of Hollywood: Extra data: line 1 column 5 (char 4)
ERROR: Ray Donovan: Extra data: line 1 column 5 (char 4)
ERROR: Raised by Wolves (2020): Extra data: line 1 column 5 (char 4)
ERROR: Quiz: Extra data: line 1 column 5 (char 4)
ERROR: The Queen's Gambit: Extra data: line 1 column 5 (char 4)
ERROR: Pretty Little Liars: Extra data: line 1 column 5 (char 4)
ERROR: Pose: Extra data: line 1 column 5 (char 4)
ERROR: Pororo the Little Penguin: Extra data: line 1 column 5 (char 4)
ERROR: The Planets (2019): Extra data: line 1 column 5 (char 4)
ERROR: Planet Earth II: Extra data: line 1 column 5 (char 4)
ERROR: Patriot (2017): Extra data: line 1 column 5 (char 4)
ERROR: The Pacific: Extra data: line 1 column 5 (char 4)

Support for multiple Radarr and Sonarr instances

Hi!
First, this is a godsend as I have tons of media downloaded, thank you!
I share my Plex servers with friends and family, but they are not tech-savvy, so I only allow them to download up to Full HD quality. But I allow myself to download 4K too.
I could only solve this by having 2 Radarr and Sonarr containers running. One for 4K, one for Full HD cutoff.

I want to prune all 4 of my libraries, but cannot really configure 2 Radarr and Sonarr instances in the .env file as the second one overwrites the first.

Do you plan to support multiple instances of the same type?

delete.tv.unwatched.py deleting same series with longer name

First of all, great tool, thank you very much for creating it.

One small bug report that I discovered while using it:
When I was trying to delete a series (in this case "The office"), the script automatically deleted the series with the same name, but longer (in this case "The Office (US)"), the one that should have been deleted stayed at the location.
I assume there might be an issue with the name recognition.

The exact steps I took to arrive at this conclusion:

  • ran the delete.tv.unwatched.py with dry-run (here "The Office" was included)
  • ran the script and it confirmed "DELETED: The Office"
  • after I ran it again to confirm everything was deleted, "The Office" was still included in the dry-run
  • I checked my sonarr, plex and tautulli pages and can confirm, "The Office (US)" was deleted and "The Office" was still there.

Overseerr Connection

Hey, I don't use overseerr. I see that it's an optional parameter, so i've commented it out of my .env. I am assuming that because it has defaults set, that's the reason why i'm getting my logs spammed by connection errors to overseerr? Is it possible to toggle this off so I only see log messages? Kinda hard to read my dry log.

issues in running in linux container

Issue:

/opt/purgeomatic# python3.9 ./delete.movies.unwatched.py 
DRY_RUN enabled!
--------------------------------------
2023-09-10T17:52:01.325669
Traceback (most recent call last):
  File "/opt/purgeomatic/./delete.movies.unwatched.py", line 89, in <module>
    movies = json.loads(r.text)
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

ENV:

# Config for all scripts. Defaults are commented out.

RADARR=http://192.168.1.redacted:7878
RADARR_API=redacted

TAUTULLI=http://192.168.1.redacted:8181
TAUTULLI_API=redacted

SONARR=http://192.168.1.redacted:8989
SONARR_API=redacted

#OVERSEERR=http://localhost:5055 # not using it
#OVERSEERR_API=abcdefghijklmnopqrstuvwxyz987654=

TAUTULLI_MOVIE_SECTIONID=10 # yes i checked
TAUTULLI_TV_SECTIONID=11 # this one too

# Number of rows to pull from Tautulli's media table.
TAUTULLI_NUM_ROWS=3000

# Delete movies/series that haven't been watched in this many days.
DAYS_SINCE_LAST_WATCH=730

# For deleting movies/series that have been added, but nobody ever watched.
# Set to 0 to disable.
DAYS_WITHOUT_WATCH=730

# This is off by default! If you set this to any value, it will be on.
# Even the mere existence of this environment variable, set to nothing/blank, and it will be on.
# Turn it on to disable the delete action. The script will only report what it would do.
DRY_RUN=on
pip install -r requirements.txt
Requirement already satisfied: jq==1.4.1 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 1)) (1.4.1)
Requirement already satisfied: python-dotenv==1.0.0 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 2)) (1.0.0)
Requirement already satisfied: requests==2.31.0 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 3)) (2.31.0)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3/dist-packages (from requests==2.31.0->-r requirements.txt (line 3)) (1.26.5)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.9/dist-packages (from requests==2.31.0->-r requirements.txt (line 3)) (3.2.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests==2.31.0->-r requirements.txt (line 3)) (2020.6.20)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests==2.31.0->-r requirements.txt (line 3)) (2.10)

Running this in he same LXC that I run tautulli on.

Any ideas?

Make script check TMDB and the TVDB for ratings before deleting.

Hey! Firstly, The project looks awesome!

So, this isn't an issue, but not sure where else to ask this... is it possible to make this script have certain critera. E.g. Movies and/or tv series not watched in 12 months with a rating below 55% will be automatically deleted.

This would be good as it'll just really clear out the junk. You could pretty safely just let that run on its own if setup correctly.

Anyway, hope you like my idea. Keep up the good work!

Not an issue: some ideas / feature request

Hi!

Thanks for your work, it looks very promising.

I've found your repo while searching for something special:
I use Ombi and i wanted to look for something that may find and delete movie requested by users some times after the download, leaving everything elses "administrator managed" safe.

i think this can be a cool feature!

Days without Watch logic

Sorry if this is the wrong avenue. I have a question about the "Days without Watch" logic.

It looks like it takes the date from Tautulli for when the media was "added" to use for the DAYS_WITHOUT_WATCH.

I started using Tautulli after my library was already pretty large, I think a feature to parse "Added via Overseerr request and not watched within X days" would also be useful.

If that is already part of the logic, please disregard.

Excellent script, BTW!!! So useful!

Docker-Compose

Hi,

First I'd like to thank you for this project. I have been looking for something like this for a long time to keep my library well maintained. This is exactly what I needed.

I am sorry if I did not put this in the right place. I think this is a feature request, but I dunno where to make that.

I can see that docker is supported, however, I was unable to see any instructions for docker-compose. Is it possible to pass these variables using a docker-compose file?

Thanks,

Size of every result while running?

Hi! Amazing work!!
It would be great to know also the size of every result, it could be useful to decide if a movie should stay or not ๐Ÿ˜ƒ
something like:
DRY RUN: Ad astra | Radarr ID: 1087 | TMDB ID: 419704 | 9.38GB

Sorry if it's an unappropriate request

Thank you!

Transmission support

First of all, thank you for the script, it's awesome. Been looking for something like this for a while. Everything works perfectly, but what I'm missing is Transmission cleanup support, the files/torrents are left there. Can you add this? Thanks!

Error Running Dry Run

Python V3.11

Tried using localhost or ip via the .env as well as testing it through docker but both ways showing same error even when trying to run delete.movies.unwatched.py.

Any help or advice would be appreciated.

python delete.tv.unwatched.py
DRY_RUN enabled!
--------------------------------------
2023-09-29T00:02:48.434880
Traceback (most recent call last):
  File "/home/seed/purgeomatic/delete.tv.unwatched.py", line 93, in <module>
    shows = json.loads(r.text)
            ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Possible to clean multiple libraries at once or setup different .env configs

I love this script. Makes cleaning up my library easier. I have multiple libraries. Is there a way to have it clean multiple libraries at once?
I don't know if its as simple as just putting the ID,ID,ID in the .env
or is there a way to run it and have it reference a different env for each library?
My goal is to be able to set this as a cron job, and have it clean up my libraries once a week.

Thanks

delete.movies.unwatched.py list index out of range

ERROR: There was a problem connecting to Tautulli/Radarr/Overseerr. Please double-check that your connection settings and API keys are correct.

Error message:
list index out of range

The script runs for a while correctly, and then just crashes with that error. I increased the list TAUTULLI_NUM_ROWS=50000 but it doesn't seem to make a difference. I tried refreshing all metadata for that library, and it still fails with that error.

Possible to Use Tags

Just discovered this on my journey to keep my library tidy. I have Overseerr tag requested movies accordingly and was wanting to see if this is able to look at and apply only to a specific tag? My brother requests a lot of old movies and TV shows that only he will watch so I have to manually clean those up all the time. I am trying to find a way to auto clean those up based on the tag "overseer" (or his username that overseer tags) and greater than 180 days. From what I can tell, this isn't currently possible without some tweaking, correct? Thanks!

Matching on movie titles isn't reliable

I've come across some issues matching on title exactly. I know you were dealing with title matching in #9 and touched on using tmdbids but decided against it. Would it be possible to have both? How do you get the tmdb id from tautulli anyway? I can't find any information in the docs :P

Here's an example.
In Radarr: Star Wars: The Last Jedi
In Plex/Tautulli: Star Wars: Episode VIII - The Last Jedi

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.