Answer the question
In order to leave comments, you need to log in
Why can't I log in VK from the server?
I'm trying to log in to VKontakte (in the Standalone application) using the Python vk library via the sh console.
Answer the question
In order to leave comments, you need to log in
Sorry, I'm learning....
Get a token:
https://oauth.vk.com/authorize?client_id=12343547&...
Well, log in:
import vk
vkapi = vk.API(access_token='access_token')
I haven't seen anything like this yet, that they posted the text of errors with a screenshot of a piece of the screen ...
Post the full trace and your code, telepaths are on vacation!
The token is not bound to an IP. A token is a token, simply for authorizing an application that is currently running.
Here, for example, is my code for automatically uploading YouTube videos to a group.
vkapi = vk.API(access_token='здесь_токен')
def upload_video_vk(url, title, description):
"""Функция добавления видео с youtube(без загрузки)
на стену группы."""
# Добавляем видео в группу, но загрузка ещё не произошла
video1 = vkapi.video.save(group_id='77097637', link=url, wallpost=1, name=title,
description=description)
# Видео еще не загрузилось, оно только приготовилось,
# а для загрузки надо открыть урл из video.
urllib.urlopen(video1['upload_url'])
attach = 'video%s_%s' % (video1['owner_id'], video1['video_id'])
# Публикуем видео на стене группы(from_group=1)
post_group = vkapi.wall.post(owner_id='здесь_ID_группы_с минусом_впереди',
from_group=1, message=description, attachments=attach)
# И возвращает ID поста
return post_group['post_id']
# Теперь загрузим
video_description="Описание"
video_title = 'Название'
video_url = 'ссылка на видео на ютубе'
video_on_vk = upload_video_vk(video_url, video_title, video_description)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question