Files
Youtube2Feed/test_curl.sh
salvacybersec e52708cda9 ilginç
2025-11-13 13:18:42 +03:00

113 lines
4.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Test curl komutları - POST response debug için
# API key: demo_key_12345 (config/security.yaml'dan)
BASE_URL="http://localhost:5000"
API_KEY="demo_key_12345"
echo "=========================================="
echo "1. Health Check (API key gerekmez)"
echo "=========================================="
curl -X GET "${BASE_URL}/health" -v
echo -e "\n\n=========================================="
echo "2. Info Endpoint (API key gerekir)"
echo "=========================================="
curl -X GET "${BASE_URL}/info" \
-H "X-API-Key: ${API_KEY}" \
-v
echo -e "\n\n=========================================="
echo "3. Channel ID ile Feed (Atom format)"
echo "=========================================="
curl -X GET "${BASE_URL}/?channel_id=UC9h8BDcXwkhZtnqoQJ7PggA&format=Atom&max_items=5" \
-H "X-API-Key: ${API_KEY}" \
-v
echo -e "\n\n=========================================="
echo "4. Channel Handle ile Feed (@kurzgesagt)"
echo " Not: İlk istekte 404 alınabilir (transcript henüz işlenmemiş)"
echo "=========================================="
curl -X GET "${BASE_URL}/?channel=@kurzgesagt&format=Atom&max_items=5" \
-H "X-API-Key: ${API_KEY}" \
-v
echo -e "\n\n=========================================="
echo "5. Channel URL ile Feed"
echo " Not: İlk istekte 404 alınabilir (transcript henüz işlenmemiş)"
echo "=========================================="
curl -X GET "${BASE_URL}/?channel_url=https://www.youtube.com/@kurzgesagt&format=Atom&max_items=5" \
-H "X-API-Key: ${API_KEY}" \
-v
echo -e "\n\n=========================================="
echo "6. RSS Format ile Feed"
echo "=========================================="
curl -X GET "${BASE_URL}/?channel_id=UC9h8BDcXwkhZtnqoQJ7PggA&format=Rss&max_items=5" \
-H "X-API-Key: ${API_KEY}" \
-v
echo -e "\n\n=========================================="
echo "7. API Key olmadan (401 hatası beklenir)"
echo "=========================================="
curl -X GET "${BASE_URL}/?channel_id=UC9h8BDcXwkhZtnqoQJ7PggA&format=Atom" \
-v
echo -e "\n\n=========================================="
echo "8. Geçersiz API Key ile (401 hatası beklenir)"
echo "=========================================="
curl -X GET "${BASE_URL}/?channel_id=UC9h8BDcXwkhZtnqoQJ7PggA&format=Atom" \
-H "X-API-Key: invalid_key" \
-v
echo -e "\n\n=========================================="
echo "9. POST Response Debug Test (max_items=1, hızlı test)"
echo " Not: İlk istekte 404 alınabilir (transcript henüz işlenmemiş)"
echo "=========================================="
curl -X GET "${BASE_URL}/?channel_id=UCsXVk37bltHxD1rDPwtNM8Q&format=Atom&max_items=1" \
-H "X-API-Key: ${API_KEY}" \
-v \
-o /tmp/test_feed.xml
echo -e "\n\n=========================================="
echo "10. Brotli Decode Test (yeni video ile)"
echo " Not: İlk istekte 404 alınabilir (transcript henüz işlenmemiş)"
echo "=========================================="
curl -X GET "${BASE_URL}/?channel_id=UCsXVk37bltHxD1rDPwtNM8Q&format=Atom&max_items=1" \
-H "X-API-Key: ${API_KEY}" \
-v
echo -e "\n\n=========================================="
echo "11. Yeni Kanal Test (UCmGSJVG3mCRXVOP4yZrU1Dw)"
echo " Not: İlk istekte 404 alınabilir (transcript henüz işlenmemiş)"
echo "=========================================="
curl -X GET "${BASE_URL}/?channel_id=UCmGSJVG3mCRXVOP4yZrU1Dw&format=Atom&max_items=5" \
-H "X-API-Key: ${API_KEY}" \
-v
echo -e "\n\n=========================================="
echo "12. Yeni Kanal URL ile Test"
echo " Not: İlk istekte 404 alınabilir (transcript henüz işlenmemiş)"
echo "=========================================="
curl -X GET "${BASE_URL}/?channel_url=https://youtube.com/channel/UCmGSJVG3mCRXVOP4yZrU1Dw&format=Atom&max_items=5" \
-H "X-API-Key: ${API_KEY}" \
-v
echo -e "\n\n=========================================="
echo "Test tamamlandı!"
echo ""
echo "✅ Brotli desteği eklendi (requirements.txt)"
echo " YouTube response'ları artık otomatik decode edilecek"
echo ""
echo "POST response debug dosyaları: output/flaresolverr_debug/"
echo " - post_response_*.txt (her POST response)"
echo " - post_response_error_*.txt (JSONDecodeError durumunda)"
echo ""
echo "⚠️ Docker container'ı yeniden build etmeniz gerekiyor:"
echo " sudo docker compose down"
echo " sudo docker compose build --no-cache"
echo " sudo docker compose up -d"
echo "=========================================="