Answer the question
In order to leave comments, you need to log in
How do I like it in a VK group using vk api + python?
How to like all posts, photos and videos in a VK group on behalf of a user (not a group admin)?
import vk
app_id, login, password = 'appid', 'login', 'pass'
session = vk.AuthSession(app_id, login, password, scope='messages')
vk_api = vk.API(session, v='5.62')
Answer the question
In order to leave comments, you need to log in
Looking at the documentation, the following sequence comes to mind:
1. Get a list of groups for the current user using the groups.get method ---- https://vk.com/dev/groups.get
2. Get all posts on the wall in the desired group using the method wall.get ---- https://vk.com/dev/wall.get
3. Loop through all the objects received by the wall.get method and use the like_adds method with the necessary parameters ---- https://vk. com/dev/likes.add
Accordingly, you do the same with albums and photos by finding the necessary methods in the API.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question