#!/bin/bash

source /opt/scripts_local/shared_functions.sh

API_KEY="api-key: c716cbf5-bc99-4c2b-9c12-44ae41d1344c"
X_HEADER="http://vmx-apps.swallow-grue.ts.net:7878/api"
CONTENT_HEADER="Content-Type: application/json"

curl -d '[{"action":"update", "scope":{"name":"all"}},{"action":"scrape", "scope":{"name":"new"}}]' -H "$CONTENT_HEADER" -H "$API_KEY" -X POST "$X_HEADER/movies"
curl -d '[{"action":"update", "scope":{"name":"all"}},{"action":"scrape", "scope":{"name":"new"}}]' -H "$CONTENT_HEADER" -H "$API_KEY" -X POST "$X_HEADER/tvshow"
#curl -d '{"action":"update", "scope":{"name":"all"}}' -H "$CONTENT_HEADER" -H "$API_KEY" -X POST "$X_HEADER/tvshow" 

#curl -d '{"action":"scrape", "scope":{"name":"unscraped"}}' -H "$CONTENT_HEADER" -H "$API_KEY" -X POST "$X_HEADER/movies"
#curl -d '{"action":"scrape", "scope":{"name":"unscraped"}}' -H "$CONTENT_HEADER" -H "$API_KEY" -X POST "$X_HEADER/tvshow" 

#curl -d '{"action":"downloadSubtitle", "scope":{"name":"all"}, "args":{"language":"fr"}}' -H "$CONTENT_HEADER" -H "$API_KEY" -X POST "$X_HEADER/movies"
#curl -d '{"action":"downloadSubtitle", "scope":{"name":"all"}, "args":{"language":"fr"}}' -H "$CONTENT_HEADER" -H "$API_KEY" -X POST "$X_HEADER/tvshow"
