我正在尝试在 python 中从 youtube 下载私人电影:
#!/usr/bin/python
import os
import youtube_dl
ydl = youtube_dl.YoutubeDL({'outtmpl': '%(id)s%(ext)s','username':'XYYXYX','password':'XXXXX'})
with ydl:
result = ydl.extract_info(
'https://www.youtube.com/watch?v=privatevideoid',
download=False # We just want to extract the info
)
if 'entries' in result:
# Can be a playlist or a list of videos
video = result['entries'][0]
else:
# Just a video
video = result
video_url = video['url']
但我得到的只是错误:这个视频是私人的。
怎么做?