Answer the question
In order to leave comments, you need to log in
Direct link to vk ptyhon image?
Any request to vk returns for some reason a link to the album
photo = atch['photo']
# 1 вариант
photo = atch['photo']
url = photo['sizes'][-1]['url']
# 2 (костыльный)
d = [photo['owner_id'], photo['id'], photo['access_key']]
d = [str(i) for i in d]
n = '_'.join(d)
n = tr.photos.getById(photos=n)
Answer the question
In order to leave comments, you need to log in
I used it in my project, try this
message_id = event.message['id']
msg = vk.messages.getById(message_ids=message_id)
owner_id = event.message['from_id']
access_key = msg['items'][0]['attachments'][0]['photo']['access_key']
photo_id = msg['items'][0]['attachments'][0]['photo']['id']
photo = f'photo{owner_id}_{photo_id}_{access_key}'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question