test-video-direct.ps1 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Direct test: create video on open.kuaizi.co (bypassing relay)
  2. $appKey = "ZmNmOGRhNjYzZTAx"
  3. $appSecretB64 = "ZWFhMTIxNTRjMjQ4Y2FkOTE1OWE5ZDZlYThiZWRmNDY="
  4. $appSecret = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($appSecretB64))
  5. $timestamp = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds().ToString()
  6. $signStr = "$timestamp#$appSecret"
  7. $md5 = [System.Security.Cryptography.MD5]::Create()
  8. $signBytes = $md5.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($signStr))
  9. $sign = ($signBytes | ForEach-Object { $_.ToString("x2") }) -join ''
  10. $headers = @{
  11. "Content-Type" = "application/json"
  12. "APP-KEY" = $appKey
  13. "AUTH-TIMESTAMP" = $timestamp
  14. "AUTH-SIGN" = $sign
  15. }
  16. Write-Host "Auth headers ready: timestamp=$timestamp" -ForegroundColor Cyan
  17. # Use existing cover images as test materials
  18. $preId = $timestamp
  19. $body = @{
  20. account_id = "12859_117409"
  21. callback_url = "https://server.fmode.cn/api/functions/cut/onemerge"
  22. material_list = @(
  23. @{ type = "pic"; value = "https://img.kuaizi.co/video/12859/12172925/749/1080x1920_5000_96/b65038bd93c1214e3ffb99e964379a8a.jpg" },
  24. @{ type = "pic"; value = "https://img.kuaizi.co/video/12859/12172918/749/1080x1920_5000_96/71d10a2e42c548492410d3f1f466320b.jpg" },
  25. @{ type = "pic"; value = "https://img.kuaizi.co/video/12859/12172872/749/1080x1920_5000_96/70f54baeb92a44d35f022b31068311dd.jpg" }
  26. )
  27. tags = "test,openclaw"
  28. proportion = "9:16"
  29. video_duration = @{ min = 10; max = 15 }
  30. pre_id = $preId
  31. compose_number = 1
  32. ai_voice = 1
  33. ai_bgm = 1
  34. ai_flower = 1
  35. ai_subtitle = 0
  36. original_voice = 0
  37. } | ConvertTo-Json -Depth 3 -Compress
  38. # Test on open.kuaizi.co
  39. Write-Host "=== POST open.kuaizi.co/v2/video/vlog/create ===" -ForegroundColor Cyan
  40. try {
  41. $r = Invoke-RestMethod -Uri "https://open.kuaizi.co/v2/video/vlog/create" -Method POST -Headers $headers -Body $body -TimeoutSec 30
  42. Write-Host "Response:" -ForegroundColor Green
  43. $r | ConvertTo-Json -Depth 5
  44. } catch {
  45. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  46. if ($_.Exception.Response) {
  47. $reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream())
  48. $respBody = $reader.ReadToEnd()
  49. Write-Host "Body: $respBody" -ForegroundColor Yellow
  50. }
  51. }