跳过下载破折号manafest

时间:2015-09-02 06:41:39

标签: python youtube-dl

我正在尝试使用youtube-dl抓取youtube。我的目标是让它找到网址的缩略图并返回。不确定是否需要下载短划线。

这是我到目前为止所做的,但它仍然显示“Downloading dash manafest”

from __future__ import unicode_literals
import youtube_dl


class MyLogger(object):
    def debug(self, msg):
        print msg
        pass

    def warning(self, msg):
        print msg
        pass

    def error(self, msg):
        print(msg)


def my_hook(d):
    if d['status'] == 'finished':
        print('Done downloading, now converting ...')


ydl_opts = {
    'list_thumbnails:': True,
    '--youtube-skip-dash-manifest':True,
    'logger': MyLogger(),
    'progress_hooks': [my_hook],
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.extract_info('http://www.youtube.com/watch?v=BaW_jenozKc',  download=False, process=False)

1 个答案:

答案 0 :(得分:2)

正确的选项是'youtube_include_dash_manifest': False