From 91a2921d79d26e9572da5666e11dfb4b1886cca6 Mon Sep 17 00:00:00 2001 From: piw4f8lbj <1836196924@qq.com> Date: Wed, 18 Sep 2024 23:02:04 +0800 Subject: [PATCH] ADD file via upload --- main.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..a04b205 --- /dev/null +++ b/main.py @@ -0,0 +1,22 @@ +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() + +