test-video-api.ps1 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Test video-creation skills connectivity
  2. # 1. Test kuaizi-video-library (list)
  3. Write-Host "=== Test kuaizi-video-library (list) ===" -ForegroundColor Cyan
  4. $body1 = @{
  5. id = "sWvRr8RvPT"
  6. _ApplicationId = "ncloudmaster"
  7. action = "list"
  8. page = 1
  9. pageSize = 3
  10. } | ConvertTo-Json -Compress
  11. try {
  12. $r1 = Invoke-RestMethod -Uri "https://server.fmode.cn/api/functions" -Method POST -ContentType "application/json" -Body $body1 -TimeoutSec 15
  13. Write-Host "Response:" -ForegroundColor Green
  14. $r1 | ConvertTo-Json -Depth 5
  15. } catch {
  16. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  17. }
  18. Write-Host ""
  19. # 2. Test kuaizi-video-query (with a dummy taskId)
  20. Write-Host "=== Test kuaizi-video-query ===" -ForegroundColor Cyan
  21. $body2 = @{
  22. id = "sWvRr8RvPT"
  23. _ApplicationId = "ncloudmaster"
  24. action = "query"
  25. taskId = "test123"
  26. } | ConvertTo-Json -Compress
  27. try {
  28. $r2 = Invoke-RestMethod -Uri "https://server.fmode.cn/api/functions" -Method POST -ContentType "application/json" -Body $body2 -TimeoutSec 15
  29. Write-Host "Response:" -ForegroundColor Green
  30. $r2 | ConvertTo-Json -Depth 5
  31. } catch {
  32. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  33. }
  34. Write-Host ""
  35. # 3. Test kuaizi-video-create relay endpoint (dry ping, no real materials)
  36. Write-Host "=== Test kuaizi-video-create relay endpoint ===" -ForegroundColor Cyan
  37. $body3 = @{
  38. action = "ping"
  39. } | ConvertTo-Json -Compress
  40. try {
  41. $r3 = Invoke-RestMethod -Uri "https://server.fmode.cn/api/functions/cut/onemerge" -Method POST -ContentType "application/json" -Body $body3 -TimeoutSec 15
  42. Write-Host "Response:" -ForegroundColor Green
  43. $r3 | ConvertTo-Json -Depth 5
  44. } catch {
  45. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  46. }