从python下载youtube-dl的私人电影?

时间:2015-01-07 13:26:12

标签: python youtube youtube-dl

我想在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']

但我得到的只是错误:此视频是私有的。

怎么做?

0 个答案:

没有答案