Skip to content

Commit

Permalink
Return video_id and owner_id when uploading a video (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdanilov committed Mar 23, 2020
1 parent 85e8f5c commit 7a23003
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vk_api/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,13 +369,15 @@ def video(self, video_file=None, link=None, name=None, description=None,
}

response = self.vk.video.save(**values)
url = response['upload_url']
url = response.pop('upload_url')

with FilesOpener(video_file or [], 'video_file') as f:
return self.http.post(
response.update(self.http.post(
url,
files=f or None
).json()
).json())
return response


def document(self, doc, title=None, tags=None, group_id=None,
to_wall=False, message_peer_id=None, doc_type=None):
Expand Down

0 comments on commit 7a23003

Please sign in to comment.