Answer the question
In order to leave comments, you need to log in
How to download video from VK Python?
Hello! I have a question: how to download a video from VK? Tried with the requests library here is the code:
import requests
req = requests.get('https://vk.com/video-30316056_456326877')
with open('video.mp4', 'wb') as video:
video.write(req.content)
Answer the question
In order to leave comments, you need to log in
Use the youtube_dl library
import youtube_dl
ydl_opts = {}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://vk.com/video-30316056_456326877'])
# [vk] -30316056_456326877: Downloading JSON metadata
# [vk] -30316056_456326877: Downloading m3u8 information
# [hlsnative] Downloading m3u8 manifest
# [hlsnative] Total fragments: 2
# [download] Destination: webm--30316056_456326877.mp4
# [download] 100% of 7.31MiB in 00:01
# [ffmpeg] Fixing malformed AAC bitstream in "webm--30316056_456326877.mp4"
# 0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question