Y
Y
y_o_l_k_i_n___e_g_o_r2021-05-07 12:27:29
Python
y_o_l_k_i_n___e_g_o_r, 2021-05-07 12:27:29

How can a VK bot in the community download photos on a PC?

The user sends an image in private messages to the VK bot, and you need to download this image.
How to do it?
PS. in the documentation I found only a method that works only with the user's access key.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kuznetsov, 2021-05-07
@dima9595

need to download this image
What do you mean by "downloading" a file? saving a file to local storage?
The user sends an image in private messages to the VK bot
in the documentation I found only a method that works only with the user's access key.
and what kind of data comes to the bot? if you receive a link to an image, then you already "download" it to yourself.

R
Roman Shavukhin, 2021-05-08
@x3ron

with open('myfile.png', 'wb') as f:
  f.write(requests.get(url).content)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question