mirror of
https://github.com/karl0ss/bazarr-ai-sub-generator.git
synced 2025-04-26 14:59:21 +01:00
25 lines
602 B
Python
25 lines
602 B
Python
import requests
|
|
import json
|
|
import configparser
|
|
config = configparser.RawConfigParser()
|
|
config.read('config.cfg')
|
|
|
|
token = config._sections['sonarr']['token']
|
|
base_url = config._sections['sonarr']['url']
|
|
|
|
def update_show_in_soarr(show_id):
|
|
url = f"{base_url}/api/v3/command"
|
|
|
|
payload = json.dumps({
|
|
"name": "RefreshSeries",
|
|
"seriesId": show_id
|
|
})
|
|
headers = {
|
|
'Content-Type': 'application/json',
|
|
'X-Api-Key': token,
|
|
}
|
|
|
|
response = requests.request("POST", url, headers=headers, data=payload)
|
|
|
|
if response.status_code != 404:
|
|
print("Updated show in Sonarr") |