Answer the question
In order to leave comments, you need to log in
How to access the vk API to save pictures?
I want to write a script to automatically save photos from a VK group to my "Saved Photos" album. Since I am a teapot, I ask someone to explain how this is done. From the documentation on GitHube, I downloaded the vk_api library and registered the login and password. But I have no idea how to make those requests.
Answer the question
In order to leave comments, you need to log in
https://vk.com/dev/photos.copy
then, in accordance with your module, you call this method with the necessary parameters, and the photos are in your pocket;)
Regarding VK: read the official documentation, and the documentation of the library that you downloaded.
Also, the photo can be downloaded to the computer:
import requests
image_url = '<image url here>'
filename = 'image.jpg'
r = requests.get(image_url)
with open(filename, 'wb') as f:
f.write(r.content())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question