gpt4 book ai didi

python - 不和谐重写和YouTube搜索出现问题

转载 作者:行者123 更新时间:2023-12-03 05:52:42 24 4
gpt4 key购买 nike

@bot.command(pass_context=True, aliases=['p', 'pla'])
async def play(ctx, term):
search_result = yt.search(term, sMax=1, sType="video")
print(search_result.videoId[0])
我在这里有此代码,它应该给我视频的ID。它像3个月前一样运作良好,但现在看来,该词只包含第一个单词。
例如,如果我去!玩永不放弃,术语将为“从不”。
有什么办法可以使我说得很对吗?

最佳答案

@bot.command(pass_context=True, aliases=['p', 'pla'])
async def play(ctx, *, term):
search_result = yt.search(term, sMax=1, sType="video")
print(search_result.videoId[0])
只需在 *之前添加 term参数。

关于python - 不和谐重写和YouTube搜索出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63552307/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com