Git Product home page Git Product logo

radarr_sonarr_watchmon's People

Contributors

fredhen avatar herjar avatar jrhbcn avatar sephrat 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

radarr_sonarr_watchmon's Issues

Authentication question

Hi Herjar and thanks a lot for this great tool! I've been using it from a bit of time with crontab and almost forgot about it, as I was testing it again I was told that the authentication was maybe out of date. I authenticated once again and got it working easily but I didn't know that it was supposed to happen.
Do you know how long the authentication is supposed to last ?
Is there an "official way" to get warned if the authentication is out of date ? (I can tinker a crontab way to get warned but if there is an official one, it might work better)
Keep up the good work!

[FEATURE_REQUEST] add tag instead of un-monitoring

Hey, do you think its possible to add an "watched"-tag instead of un-monitoring watched movies?

Would be great, because i am still holding most watched movies.
And of they where good enough, i am also willing for an upgrade.
Or otherwise, if i am running out of space, i could display all watched movies and could delete the worst by hand.

Error handling

Report exit codes 1, 2, 3 based on error.
or at least
Report exit code higher than 0 for any error.

Otherwise there's no way to know there was an error.
Thanks!

Add error message for if the Sonarr (or other) API key isn't working?

Hi there, just a thought, if it's possible, you might consider adding some kind of error message if the Sonarr (or other) API key isn't working. I noticed the script hadn't been working lately and was trying to figure out why - updated, re-authenticated with Trakt - before thinking to check my Sonarr API key. (I built a new PC recently, re-installing Sonarr along the way, but I hadn't thought to update the API key in my saved-from-before config.yml.)

The way it expressed itself was for the script to end with "Sonarr: Episodes found and changed monitored to False:" and then none were listed. Perhaps it might be possible to report back that the API key failed?

At any rate, thanks for sharing this script! Let me know if you have any PayPal, Venmo, etc. to accept donations!

No longer working?

Did the Trakt API change? Nothing's changed on my end, but it suddenly stopped working:

~/radarr_sonarr_watchmon$ venv/bin/python radarr_sonarr_watchmon.py 
Radarr:
 Trakt: movies watches in last 30 days:
Traceback (most recent call last):
  File "radarr_sonarr_watchmon.py", line 330, in <module>
    app.radarr(recent_days, radarr_address, radarr_apikey)
  File "radarr_sonarr_watchmon.py", line 95, in radarr
    movies_watched_recently_imdbids = self.trakt_get_movies(recent_days)
  File "radarr_sonarr_watchmon.py", line 86, in trakt_get_movies
    for movie in Trakt['sync/history'].movies(start_at=recent_date, pagination=True):
TypeError: 'NoneType' object is not iterable

File deletion?

First, thank you very much, I have been looking for this functionality to Sonarr for quite some time. I replied to you in your reddit thread, but I'll leave this here as well.

You mentioned there that you could add file deletion for the script. Are you still considering it?

Deleting watched, unmonitored files from both sonarr and radarr would be a great addition, I currently use emby and a script for it for this purpose only. The script I now use has an option "delete after x days of watching", I think that's the optimal way to do this.

It would of course be even better if I didn't need extra software like emby or plex to achieve this.

But even as is, the script is a nice upgrade to my config, thanks again!

Radarr returned status code 200

Radarr can return status code 200 however this has 2 problems:

  1. The movie is still not marked unmonitored.

  2. The error condition raises an error because r.json() is a list of all movies.

    Traceback (most recent call last):
      File "radarr_sonarr_watchmon.py", line 423, in <module>
        app.radarr(recent_days, radarr_address, radarr_apikey)
      File "radarr_sonarr_watchmon.py", line 130, in radarr
        print("   Error: "+str(r.json()["message"]))
    TypeError: list indices must be integers or slices, not str
    

Radarr Version: 3.2.2.5080

Still working?

Is anyone still using this?

It's stopped working for me, and I'm not sure it's a problem on my end or with an API. I have re-authed to make sure it's not just that.

(env) media@media:~/radarr_sonarr_watchmon$ python3 radarr_sonarr_watchmon.py
Movies:
 Trakt: Movies watched in last 5 days:

 Radarr:
  * Movies will be unmonitored in Radarr

  Movies found and changed in Radarr:
Traceback (most recent call last):
  File "/home/media/radarr_sonarr_watchmon/env/lib/python3.9/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/media/radarr_sonarr_watchmon/radarr_sonarr_watchmon.py", line 534, in <module>
    app.radarr()
  File "/home/media/radarr_sonarr_watchmon/radarr_sonarr_watchmon.py", line 202, in radarr
    movies = response.json()
  File "/home/media/radarr_sonarr_watchmon/env/lib/python3.9/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

(env) media@media:~/radarr_sonarr_watchmon$ pip3 install -r requirements.txt.orig
Requirement already satisfied: trakt.py~=3.0.0 in ./env/lib/python3.9/site-packages (from -r requirements.txt.orig (line 1)) (3.0.0)
Requirement already satisfied: requests in ./env/lib/python3.9/site-packages (from -r requirements.txt.orig (line 2)) (2.31.0)
Requirement already satisfied: pyyaml in ./env/lib/python3.9/site-packages (from -r requirements.txt.orig (line 3)) (6.0.1)
Requirement already satisfied: six in ./env/lib/python3.9/site-packages (from -r requirements.txt.orig (line 4)) (1.16.0)
Requirement already satisfied: arrow<1.0.0,>=0.10.0 in ./env/lib/python3.9/site-packages (from trakt.py~=3.0.0->-r requirements.txt.orig (line 1)) (0.17.0)
Requirement already satisfied: charset-normalizer<4,>=2 in ./env/lib/python3.9/site-packages (from requests->-r requirements.txt.orig (line 2)) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in ./env/lib/python3.9/site-packages (from requests->-r requirements.txt.orig (line 2)) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./env/lib/python3.9/site-packages (from requests->-r requirements.txt.orig (line 2)) (2.1.0)
Requirement already satisfied: certifi>=2017.4.17 in ./env/lib/python3.9/site-packages (from requests->-r requirements.txt.orig (line 2)) (2023.11.17)
Requirement already satisfied: python-dateutil>=2.7.0 in ./env/lib/python3.9/site-packages (from arrow<1.0.0,>=0.10.0->trakt.py~=3.0.0->-r requirements.txt.orig ()

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.