YTS API Status #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: YTS API Status | |
| on: | |
| schedule: | |
| - cron: "*/15 * * * *" # every 15 minutes | |
| workflow_dispatch: | |
| jobs: | |
| healthcheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check YTS API health | |
| run: | | |
| echo "Checking YTS API status..." | |
| RESPONSE=$(curl -fsS https://yts.lt/api/v2/list_movies.json) || { echo "Curl failed"; exit 1; } | |
| STATUS=$(echo "$RESPONSE" | jq -e -r '.status') || { echo "Invalid JSON"; echo "$RESPONSE"; exit 1; } | |
| if [ "$STATUS" != "ok" ]; then | |
| echo "❌ API status is NOT ok" | |
| echo "$RESPONSE" | |
| exit 1 | |
| fi | |
| echo "✅ API status is OK" |