from geturls import get_videourl from getcids import get_cid from getcomment import get_danmaku from count import count_danmu from word_cloud import make_wordcloud #获取视频url中的特殊元素 urlist = get_videourl() #获取视频cid值 cidlist = get_cid(urlist) #获取弹幕 danmaku_list = get_danmaku(cidlist) #把弹幕放在txt文件中 with open('paris_olympics_danmak.txt', 'w', encoding='utf-8') as f: for danmaku in danmaku_list: f.write(danmaku + '\n') #对有关ai的弹幕进行统计 count_danmu() #生成词云图 make_wordcloud()