youtube.py 文件源码

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

项目:QProb 作者: quant-trade 项目源码 文件源码
def clean_video(video):
    text = []
    try:
        if len(video.description) > 0:
            sentence_tokens = sent_tokenize(video.description)

            for sentence in sentence_tokens:
                if not ('http' in sentence):
                    text.append("{0} ".format(sentence))

        video.description = "".join("{} ".format(s) for s in text)
        video.save()
        if settings.SHOW_DEBUG:
            print(colored.green("Cleaned video description saved to db: {0}".format(video.title)))
    except Exception as e:
        print(colored.red("At clean_video {}".format(e)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号