import vk_api
vk = vk_api.VkApi(token="ТОКЕН")
def resolve_url(url):
# url - 'vk.com/durov'
screen_name = url.split('/')[-1]
# screen_name - 'durov'
id_ = vk.method('users.get', {'user_ids': screen_name})[0]['id']
# id_ - 1
return id_