Answer the question
In order to leave comments, you need to log in
How to pull out owner_id and photo_id values?
Hello!! I'm writing a bot that needs to overlay text on a photo that I send to him.
Through the team
txt = vk.method('messages.getHistoryAttachments', {'peer_id': 2000000000 + 1, 'media_type': 'photo', 'count': 1})
{'items': [{'message_id': 477043, 'from_id': -172196983, 'attachment': {'type': 'photo', 'photo': {'album_id': -64, 'date': 1616517671, 'id': 457247112, 'owner_id': -172196983, 'has_tags': False, 'access_key': '2079596cc22587f762', 'sizes': [{'height': 67, 'url': 'https://sun9-24.userapi.com/impf/bbXLL5WFXfVctWFufHhD_eYv46IH..', 'type': 's', 'width': 75}, {'height': 117, 'url': 'https://sun9-24.userapi.com/impf/bbXLL5WFXfVctWFufHhD_eYv46IH..', 'type': 'm', 'width': 130}, {'height': 543, 'url': 'https://sun9-24.userapi.com/impf/bbXLL5WFXfVctWFufHhD_eYv46IH..', 'type': 'x', 'width': 604}, {'height': 725, 'url': 'https://sun9-24.userapi.com/impf/bbXLL5WFXfVctWFufHhD_eYv46IH..', 'type': 'y', 'width': 807}, {'height': 968, 'url': 'https://sun9-24.userapi.com/impf/bbXLL5WFXfVctWFufHhD_eYv46IH..', 'type': 'z', 'width': 1078}, {'height': 117, 'url': 'https://sun9-24.userapi.com/impf/bbXLL5WFXfVctWFufHhD_eYv46IH..', 'type': 'o', 'width': 130}, {'height': 180, 'url': 'https://sun9-24.userapi.com/impf/bbXLL5WFXfVctWFufHhD_eYv46IH..', 'type': 'p', 'width': 200}, {'height': 287, 'url': 'https://sun9-24.userapi.com/impf/bbXLL5WFXfVctWFufHhD_eYv46IH..', 'type': 'q', 'width': 320}, {'height': 458, 'url': 'https://sun9-24.userapi.com/impf/bbXLL5WFXfVctWFufHhD_eYv46IH..', 'type': 'r', 'width': 510}], 'text': '', 'user_id': 100}}}], 'next_from': '477043/1', 'groups': [{'id': 172196983, 'name': 'Парадокс Фарадея', 'screen_name': 'fara__228', 'is_closed': 0, 'type': 'page', 'photo_50': 'https://sun1.43222.userapi.com/s/v1/ig2/p7XJDEONgSfu33HYSzZFi..', 'photo_100': 'https://sun1.43222.userapi.com/s/v1/ig2/6slGdZYBNcqCBdhEUETPS..', 'photo_200': 'https://sun1.43222.userapi.com/s/v1/ig2/hKcBvv1ceIvinQeMUdzCQ..'}]}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question