为什么youtube不在我的PyCharm IDE中运行?

2024-10-04 11:29:00 发布

您现在位置:Python中文网/ 问答频道 /正文

import youtube_dl

youtube_dl 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

我试过这个密码。但我得到的只是一个语法错误。在


Tags: importcomhttp密码youtubewwwwatchdl
2条回答

您需要实例化YoutubeDL类,请尝试:

from __future__ import unicode_literals
import youtube_dl    
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download(url)

你可能想做点什么

import os

os.system("youtube_dl 'http://www.youtube.com/watch?v=P9pzm5b6FFY' ")

此调用将是blocking。在

相关问题 更多 >