我正在尝试开发一个discord机器人,当我从discord收到一个特定的关键字时,我会使用google_images_download搜索它。然后,我想返回来自搜索结果的随机图像URL。
response = google_images_download.googleimagesdownload()
arguments = {"keywords":"yuzu figure skater","limit":10,"print_urls":True} #creating list of arguments
paths = response.download(arguments) #passing the arguments to the function
但是,这样做会下载图像。但是我只想要与图像关联的URL。不是图像本身。
我不熟悉google_images_download。任何指针表示赞赏。
您需要在参数中添加"no_download": True
。可能的参数的完整列表可以在here:
arguments = {"keywords":"yuzu figure skater","limit":10,"print_urls":True, "no_download": True}