test_age_restriction.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:get-youtube-subtitle-url-node 作者: joegesualdo 项目源码 文件源码
def _download_restricted(url, filename, age):
    """ Returns true if the file has been downloaded """

    params = {
        'age_limit': age,
        'skip_download': True,
        'writeinfojson': True,
        'outtmpl': '%(id)s.%(ext)s',
    }
    ydl = YoutubeDL(params)
    ydl.add_default_info_extractors()
    json_filename = os.path.splitext(filename)[0] + '.info.json'
    try_rm(json_filename)
    ydl.download([url])
    res = os.path.exists(json_filename)
    try_rm(json_filename)
    return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号