S
S
socialcare2020-05-14 16:30:43
Python
socialcare, 2020-05-14 16:30:43

VK API How to download photo from vk dialog in original quality?

Using the messages.getById method, I get all the information about the message, including attachments with photo and urls with links to different sizes of this image. But the largest of them is 1280x720 at a resolution of the original picture in 4k. Is there a way to get a link to the original photo through the api that opens from the right click dialog -> open image in new tab. It also opens with a link like https://sun9-60.userapi.com/.../.jpg and its resolution is 4k there.
5ebd47bbba934659518035.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LXSTVAYNE, 2020-07-13
@lxstvayne

Try this:
import requests
r = requests.get('Link to your picture')
with open('photo.jpg', 'wb') as f:
f.write(r.content)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question