Загрузка...

Script that removes dogs from VK friends

Thread in Python created by Lepong Mar 28, 2020. 340 views

  1. Lepong
    Lepong Topic starter Mar 28, 2020 Banned 27 Oct 30, 2019
    Скрипт на языке программирования Python.
    Скачать Python, запустить командную строку и написать команду pip3 install vk_api. Открыть скрипт через блокнот и вставить токен от своей страницы.
    Автор скрипта - https://vk.com/grishagoncharov1
    Code
    import vk_api
    from vk_api.longpoll import VkLongPoll, VkEventType

    def main():
    vk_session = vk_api.VkApi(token='токен') #можно узнать не vkhost.github.io
    api = vk_session.get_api()

    try:
    get = api.friends.get(count=1000, fields='deactivated')
    i = 0
    while i < get['count']:
    try:
    id = get['items'][i]['id']
    if get['items'][i]['deactivated'] == 'banned':
    api.friends.delete(user_id=id)
    print(f'{id} был удалён из друзей')
    i += 1
    elif get['items'][i]['deactivated'] == 'deleted':
    api.friends.delete(user_id=id)
    print(f'{id} был удалён из друзей')
    i += 1
    except:
    i += 1
    except Exception as error:
    print(error)


    main()
     
Loading...
Top