totaldebug / pyarr Goto Github PK
View Code? Open in Web Editor NEWPython client for Servarr API's (Sonarr, Radarr, Readarr, Lidarr)
Home Page: https://docs.totaldebug.uk/pyarr
License: MIT License
Python client for Servarr API's (Sonarr, Radarr, Readarr, Lidarr)
Home Page: https://docs.totaldebug.uk/pyarr
License: MIT License
Get the root folder
Just installed like showed in you guide :
You need HACS installed and configured
Go to plugins tab
Search for Atomic Calendar Revive
If you use the Lovelace Editor then first go to your user provile and enable Advanced Mode
Now add the follwoing to Configuration -> Lovelace Dashboards -> Resources
/hacsfiles/atomic-calendar-revive/atomic-calendar-revive.js
Now i wanted to add it to my dashboard but this doesnt work
Cannot read property 'forEach' of undefined
type: 'custom:atomic-calendar-revive'
name: Calendar Card
enableModeChange: true
See title, maybe its useful to migrate from urllib
to requests
, utilizing a wider featureset, with more up-to-date robustness.
It'll probably also be useful if a library is used that works with async
/asyncio
, making this library useful in long-running programs, web backends, bots, and other functionality that works with asyncio
.
Movie path should be {root_dir}/{movie_title} instead of {root_dir}{movie_title} (notice the slash). I don't think that my Radarr is improperly setup, but maybe most people have the trailing slash included in their root dir. An easy fix would be to use os.path.join. This can easily be patched by just explicitly stating the root dir when calling the function though.
Also, using Radarr's "Movie Folder Format" setting (advanced option under Settings -> Media Management) would be ideal, but I'm not sure that Radarr's API could facilitate that.
As mentioned in the title, seems like after running pip install pyarr
, the import command from PyArr import SonarrAPI
no longer works. However, from pyarr import SonarrAPI
works.
Documentation needs to be updated to reflect these changes.
Convert the project to allow asynchronous tasks
Add a def for calendars
Hi
I get this error on the RadarrAPI
when calling .getMovie()
Traceback (most recent call last):
File "fetch_movies.py", line 9, in <module>
print(radarr.getMovie())
File "/home/slimcdk/.local/lib/python3.8/site-packages/pyarr/radarr_api.py", line 148, in getMovie
movieId = args[0]
IndexError: tuple index out of range
There is no issue with calling .getSeries()
on the SonarrAPI
Giving a first glance at this library, i can already give some suggestions to make library layout and code compatible with PEP 8 and similar widely spread python style guides;
snake_case
function namingPyArr
-> pyarr
)def func(id = null)
) arguments instead of *args
like here, which is non-pythonic and confuses auto-documentation and typing toolsability to rescan disk for movies
Add get and put episode
Ability to refresh movies data
Hi!
I tried to add this as a dependency but I can't manage to get it installed
C:\Windows\System32>pip install PyArr
ERROR: Could not find a version that satisfies the requirement PyArr (from versions: none)
ERROR: No matching distribution found for PyArr
Also from source it doesn't want to :
C:\Windows\System32>pip install -e https://github.com/marksie1988/PyArr.git#egg=PyArr
ERROR: https://github.com/marksie1988/PyArr.git#egg=PyArr is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with svn+, git+, hg+, or bzr+).
I am using python 3.7, any recommandations? Thanks!
GET
GET/{id}
DELETE/{id}
PUT/{id}
Build the api class
I've been informed that the Radarr team will be labeling the the v0.2 endpoints as depreciated within the upcoming months.
We have a few directions PyArr can go in. I've ranked them in order of what I believe is the best options available to us.
Wait for the official public release of v3, then remove all v0.2 RadarrAPI
functions for and replace them with new v3 functions.
(preferred, visually the cleanest method to code)
Have an initialization variable within RadarrAPI
called use_v3_api
that defaults to True
. If that is set to true, then define all V3 functions within the class. If the user sets it to false, then the v0.2 functions are defined instead.
(this will double the size of RadarrAPI
, but allows for backwards compatibility with minimal code refactoring)
Create a RadarrV3API
class, and keep the current RadarrAPI
class as is. Maintain both as necessary.
(may lead to confusion in the future where 0.2 becomes obsolete)
Have v0.2 and v3 functions all publicly available within the same class at the same time.
(will lead to incompatibility issues if the user is using v0.2)
I will develop the implementation we agree on whenever the Radarr team finishes their API docs. That's likely gonna be six months to a year from now, so we have a lot of time to discuss.
RequestAPI.request_get
method to correctly encode api params.
RequestAPI.request_get
currently makes a session GET using the following code:
if len(kwargs) >= 1:
encoded_params = requests.utils.quote(str(kwargs))
request_url = "{}?{}".format(request_url, encoded_params)
res = self.session.get(request_url, headers=headers, auth=self.auth)
Which causes arguments to be double encoded.
an example is SonarrAPI.get_episode_files_by_series_id(series_id)
currently the seriesId
argument is encoded once by us and a second time by requests.
Resulting in a bad url.
def request_get(self, path, **kwargs):
"""Wrapper on the session.get
Kwargs:
**kwargs: Any url attributes to add to the request.
Returns:
requests.models.Response: Response object form requests.
"""
headers = {"X-Api-Key": self.api_key}
request_url = "{url}{path}".format(url=self.host_url, path=path)
res = self.session.get(request_url, headers=headers, auth=self.auth, params=kwargs)
return res.json()
Pass any params as a dict to the params
arg of requests and let request encode the params.
from pyarr import SonarrAPI
sonarr_api = SonarrAPI(my_url, my_token)
episode_data = sonarr_api.get_episode_file_by_episode_id(id_of_an_episode)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.