Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

素材来源选Pexels时,视频生成失败 #491

Open
jinzhe516 opened this issue Sep 5, 2024 · 10 comments
Open

素材来源选Pexels时,视频生成失败 #491

jinzhe516 opened this issue Sep 5, 2024 · 10 comments

Comments

@jinzhe516
Copy link

确认网络没问题,pexels网站可以访问,api也正确,不知道为什么会提示网络问题,选pixabay可以用,但是Pixabay的素材太垃圾了,只有几个低质量的视频来回循环。

generating audio

2024-09-05 17:03:23 | INFO | "./app\services\voice.py:1057": azure_tts_v1 - start, voice name: en-US-EmmaNeural, try: 1
2024-09-05 17:03:27 | INFO | "./app\services\voice.py:1077": azure_tts_v1 - completed, output file: .\storage\tasks\6947e358-1ca6-4647-b653-6d993a189efb\audio.mp3
2024-09-05 17:03:27 | INFO | "./app\services\task.py:141": get_video_materials -

downloading videos from pexels

2024-09-05 17:03:27 | INFO | "./app\services\material.py:47": search_videos_pexels - searching videos: https://api.pexels.com/videos/search?query=love&per_page=20&orientation=portrait, with proxies: {}
2024-09-05 17:03:27 | ERROR | "./app\services\material.py:83": search_videos_pexels - search videos failed: Expecting value: line 1 column 1 (char 0)
2024-09-05 17:03:27 | INFO | "./app\services\material.py:208": download_videos - found 0 videos for 'love'
2024-09-05 17:03:27 | INFO | "./app\services\material.py:47": search_videos_pexels - searching videos: https://api.pexels.com/videos/search?query=lovers&per_page=20&orientation=portrait, with proxies: {}
2024-09-05 17:03:27 | ERROR | "./app\services\material.py:83": search_videos_pexels - search videos failed: Expecting value: line 1 column 1 (char 0)
2024-09-05 17:03:27 | INFO | "./app\services\material.py:208": download_videos - found 0 videos for 'lovers'
2024-09-05 17:03:27 | INFO | "./app\services\material.py:47": search_videos_pexels - searching videos: https://api.pexels.com/videos/search?query=landscape&per_page=20&orientation=portrait, with proxies: {}
2024-09-05 17:03:28 | ERROR | "./app\services\material.py:83": search_videos_pexels - search videos failed: Expecting value: line 1 column 1 (char 0)
2024-09-05 17:03:28 | INFO | "./app\services\material.py:208": download_videos - found 0 videos for 'landscape'
2024-09-05 17:03:28 | INFO | "./app\services\material.py:216": download_videos - found total videos: 0, required duration: 2 seconds, found duration: 0.0 seconds
2024-09-05 17:03:28 | SUCCESS | "./app\services\material.py:249": download_videos - downloaded 0 videos
2024-09-05 17:03:28 | ERROR | "./app\services\task.py:153": get_video_materials - failed to download videos, maybe the network is not available. if you are in China, please use a VPN.
2024-09-05 17:03:28 | ERROR | "./webui\Main.py:790": - 视频生成失败

@sc1entist
Copy link

我跟你是一样的问题,我打印日志看了是pexels的接口返回403了,但是我本地用postman是可以正常请求的,但是项目里请求就不行

@sc1entist
Copy link

我跟你是一样的问题,我打印日志看了是pexels的接口返回403了,但是我本地用postman是可以正常请求的,但是项目里请求就不行

header里面加上'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36'试试

@faycal-rakza
Copy link

I had the same issue. I tried to use pixabay api instead of pexels api and it works

@leyouaitools
Copy link

我跟你是一样的问题,我打印日志看了是pexels的接口返回403了,但是我本地用postman是可以正常请求的,但是项目里请求就不行

header里面加上'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36'试试

这个是有效的,请求头变化了

@aiguoxin
Copy link

我跟你是一样的问题,我打印日志看了是pexels的接口返回403了,但是我本地用postman是可以正常请求的,但是项目里请求就不行

header里面加上'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36'试试

这样会报500

b"500 Internal Server Error\nIf you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong."

@tinone2323
Copy link

同样的问题,求解决方案

@FangXxun
Copy link

'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'

加上这个请求头

@80981818qqcom
Copy link

Modify the app/services/material.py file and replace the following code line with:
headers = {"Authorization": api_key, 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; "(x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"}

@aiguoxin
Copy link

我跟你是一样的问题,我打印日志看了是pexels的接口返回403了,但是我本地用postman是可以正常请求的,但是项目里请求就不行

header里面加上'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36'试试

这样会报500

b"500 Internal Server Error\nIf you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong."

后来换了 VPN,可以正常下载了,还是和 VPN 有关

@gpblvai
Copy link

gpblvai commented Oct 29, 2024

我也遇到了同样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants