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

重复尝试 3 次,上传快手视频时提示文件解析相关报错 #77

Closed
LeeDebug opened this issue Dec 29, 2024 · 3 comments
Closed

Comments

@LeeDebug
Copy link

已经获取到了快手的 cookie 信息,当执行 upload_video_to_kuaishou.py 文件时报错如下

(social-auto-upload) PS D:\Code\Python\LLM\LLMS\linyqh\social-auto-upload> python .\examples\upload_video_to_kuaishou.py
BASE_DIR:  D:\Code\Python\LLM\LLMS\linyqh\social-auto-upload
2024-12-29 23:17:39 | SUCCESS: [+] cookie 有效
get_title_and_hashtags > file_path:  D:\Code\Python\LLM\LLMS\linyqh\social-auto-upload\videos\demo.mp4
get_title_and_hashtags > file:  <_io.TextIOWrapper name='D:\\Code\\Python\\LLM\\LLMS\\linyqh\\social-auto-upload\\videos\\demo.mp4' mode='r' encoding='utf-8'>
Traceback (most recent call last):
  File "C:\_Edan\ProgramFiles\JetBrains\PyCharm 2024.2.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1570, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\_Edan\ProgramFiles\JetBrains\PyCharm 2024.2.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "D:\Code\Python\LLM\LLMS\linyqh\social-auto-upload\examples\upload_video_to_kuaishou.py", line 31, in <module>
    title, tags = get_title_and_hashtags(str(file))
  File "D:\Code\Python\LLM\LLMS\linyqh\social-auto-upload\utils\files_times.py", line 34, in get_title_and_hashtags
    return get_title_and_hashtags_from_content(content)
  File "D:\Code\Python\LLM\LLMS\linyqh\social-auto-upload\utils\files_times.py", line 18, in get_title_and_hashtags_from_content
    lines = content.split('\n')
TypeError: a bytes-like object is required, not 'str'
python-BaseException

随后,我查看了代码,把 get_title_and_hashtags 函数的读取文件处改成了 with open(file_path, 'rb') as file 后依旧报错

@dreammis
Copy link
Owner

有一个meta的文件,注意格式,第一行是标题,第二行是hashtag
这个日后你可以更改。最好先用demo程序跑一下,排查下是项目问题还是自己设置问题

@LeeDebug
Copy link
Author

是的,我就是在用 demo 跑的,目前就是遇到了这个问题

@LeeDebug
Copy link
Author

已自行解决

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

2 participants