48 lines
2.8 KiB
YAML
48 lines
2.8 KiB
YAML
apiVersion: v1
|
|
data:
|
|
prowlarr_add_bulk_indexer.sh: |
|
|
#!/bin/sh
|
|
|
|
# install package with apk
|
|
apk add curl jq
|
|
# Base URL and API key
|
|
BASE_URL="https://tprowlarr.tryton.geeraert.eu"
|
|
API_KEY="c5655e0b915d46dbb68d80f40a2daae4"
|
|
|
|
APP_PROFILE_ID=1 # Set this to a valid App Profile Id
|
|
|
|
# Get the list of all available indexers
|
|
available_indexers=$(curl -s -X GET "$BASE_URL/api/v1/indexer/schema" \
|
|
-H "accept: application/json" \
|
|
-H "X-Api-Key: $API_KEY")
|
|
|
|
# Loop through each indexer and add it to Prowlarr
|
|
echo "$available_indexers" | jq -c '.[]' | while read -r indexer; do
|
|
indexer_name=$(echo "$indexer" | jq -r '.name')
|
|
indexer_settings=$(echo "$indexer" | jq -c '.')
|
|
|
|
# Add the AppProfileId to the indexer settings
|
|
indexer_settings=$(echo "$indexer_settings" | jq --argjson appProfileId "$APP_PROFILE_ID" '. + {AppProfileId: $appProfileId}')
|
|
|
|
echo "Adding indexer: $indexer_name"
|
|
|
|
curl -s -X POST "$BASE_URL/api/v1/indexer" \
|
|
-H "accept: application/json" \
|
|
-H "X-Api-Key: $API_KEY" \
|
|
-H "Content-Type: application/json" \
|
|
-d "$indexer_settings"
|
|
|
|
echo "Indexer $indexer_name added."
|
|
done
|
|
return 0
|
|
kind: ConfigMap
|
|
metadata:
|
|
annotations:
|
|
kubectl.kubernetes.io/last-applied-configuration: |
|
|
{"apiVersion":"v1","data":{"prowlarr_add_bulk_indexer.sh":"#!/bin/bash\n\n# Base URL and API key\nBASE_URL=\"https://prowlarr.tryton.geeraert.eu\"\nAPI_KEY=\"0cb77d794ab74f158daaae044ab850ee\"\n\nAPP_PROFILE_ID=1 # Set this to a valid App Profile Id\n\n# Get the list of all available indexers\navailable_indexers=$(curl -s -X GET \"$BASE_URL/api/v1/indexer/schema\" \\\n -H \"accept: application/json\" \\\n -H \"X-Api-Key: $API_KEY\")\n\n# Loop through each indexer and add it to Prowlarr\necho \"$available_indexers\" | jq -c '.[]' | while read -r indexer; do\n indexer_name=$(echo \"$indexer\" | jq -r '.name')\n indexer_settings=$(echo \"$indexer\" | jq -c '.')\n\n # Add the AppProfileId to the indexer settings\n indexer_settings=$(echo \"$indexer_settings\" | jq --argjson appProfileId \"$APP_PROFILE_ID\" '. + {AppProfileId: $appProfileId}')\n\n echo \"Adding indexer: $indexer_name\"\n\n curl -s -X POST \"$BASE_URL/api/v1/indexer\" \\\n -H \"accept: application/json\" \\\n -H \"X-Api-Key: $API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d \"$indexer_settings\"\n\n echo \"Indexer $indexer_name added.\"\ndone\n"},"kind":"ConfigMap","metadata":{"annotations":{},"creationTimestamp":null,"name":"prowlarr-add-bulk-indexer","namespace":"servarr"}}
|
|
creationTimestamp: "2025-02-24T14:53:38Z"
|
|
name: prowlarr-add-bulk-indexer
|
|
namespace: tservarr
|
|
resourceVersion: "101531049"
|
|
uid: daa8c869-779c-49f2-a2ca-bad2d6d77035
|