Skip to main content

哔哩哔哩

哔哩哔哩是中国最受喜爱的长视频网站之一。

这个加载器利用bilibili-apiBilibili视频中获取文本字幕。要有效使用这个加载器,必须获得sessdatabili_jctbuvid3的cookie参数。可以通过登录Bilibili,然后从浏览器的开发者工具中提取sessdatabili_jctbuvid3的值来获得这些参数。

如果选择将cookie参数留空,加载器仍然可以正常工作,但只能获取元数据的视频信息,无法获取字幕。

有关获取这些凭据的详细说明,请参阅这里的指南。

BiliBiliLoader提供了一个用户友好的界面,方便用户轻松访问Bilibili上所需视频内容的字幕,使其成为那些希望分析或利用这些媒体数据的人的宝贵工具。

%pip install --upgrade --quiet  bilibili-api-python
from langchain_community.document_loaders import BiliBiliLoader
SESSDATA = "<your sessdata>"
BUVID3 = "<your buvids>"
BILI_JCT = "<your bili_jct>"
loader = BiliBiliLoader(
[
"https://www.bilibili.com/video/BV1g84y1R7oE/",
],
sessdata=SESSDATA,
bili_jct=BILI_JCT,
buvid3=BUVID3,
)
docs = loader.load()
docs
[Document(page_content="视频标题:Let's Learn English on a Hike! 🍂🚶🏼🎒 【英文字幕】,描述:你曾经在大自然中学习英语吗?在这堂英语课上,我带你去我附近的一条远足小径,教你所有关于远足的词汇和短语,以便你能够进行关于远足的对话。\n\n在这堂免费的英语课上,你将学习到像:trail、path、treacherous、view、sign、observation deck、gear、hiking boots、dangerous animals、racoon、skunk等词汇和短语。\n\n你甚至会看到一只松鼠,并听到我说这个词,这个词据说是最难发音的英语单词之一!也许在那个时候暂停一下,试着跟着我说这个词(跟我重复一遍)。\n\n希望你喜欢这堂英语课,也希望你能找时间去远足!\n\n⌛ 记住:一定要观看两次视频。今天带着英文字幕观看一次,明天不带英文字幕观看一次。这样可以巩固你所学的英语!\n\n字幕:Let's learn English on a hike. (upbeat music) So I guess I should start this lesson by explaining the difference between going for a walk and going for a hike. When you go for a walk, it usually means that you are in the city or you are in town. You go for a walk along the road or on a sidewalk. You're somewhere where lots of people live. When you hike, when you go for a hike though, it usually means you're somewhere like this. You're somewhere out in nature where you can enjoy the sunshine, the trees, and just getting away from the busyness of city life or town life. Now, when you go for a hike, you don't just go into the woods and start walking, you usually look for a trail. Usually there is a path or trail, we use both words in English, and you can walk down that trail when you go for your hike. This is a very well maintained trail, it's very, very nice to walk on this trail. And there's a nice sign here that tells us about this trail, It's called the Lookout Trail, and it's about a kilometer long, it's just under a kilometer in length, and it should take about 25 minutes to walk this trail. So once again, when you go for a hike, you don't just walk into the woods willy-nilly. Do you know that word? You look for trails and you stay on the trails. It's important to stay on the trails, I'll tell you why in just a moment. It's important to stay on the trails for a couple of reasons. The first reason is that there are some plants in this part of Ontario, Canada, that aren't very good for you. There's something in particular called poison ivy. If you go off the path, so as we look here at the path, if you were to go off the path, eventually you might walk through some poison ivy and then you will be very itchy for a number of days. Poison ivy is not a nice thing to have touch your skin. So if you're wearing shorts, for sure, don't ever go off the path. The other thing is that you might encounter dangerous animals. There aren't many dangerous animals here, but in Northern Ontario and in other parts of Canada, if you're out for a hike, it's very important that you stick to the paths and trails because if you don't, you might encounter something like a bear or another dangerous animal. And then the third reason is it just helps nature to stay beautiful. If we were to all walk through the woods all the time, we would trample a lot of things that are growing there and it wouldn't stay beautiful. So the best way to enjoy nature is to stay on the paths and trails when you go on a hike and just appreciate the stuff that you're seeing. One of the coolest things about going on a hike is sometimes you're able to see wildlife. Now, I talked about wildlife that is dangerous, but some wildlife is not dangerous at all. This is a squirrel. This is probably the most common animal that you will see if you go on a hike in Ontario, Canada. You'll also see lots of birds, you'll see chipmunks, you might see a raccoon, you might even see a skunk. By the way, if you see a skunk, you should go the other direction. But one of the cool fun things about going for a hike is there's a good chance that you'll see some wildlife. Now, if you're just out for a quick hike like I am, you don't need any special gear. I'm just wearing normal running shoes. It's good to have appropriate footwear on when you go for a hike, but if you were more serious and if you were going for a longer hike, you might buy hiking boots. You might have walking sticks, you might bring a backpack with lots of supplies, like some food that you can eat for your hike. But I'm just out here for a simple hike. I'm not going for very long. I'm going for about as long as it takes to make this English lesson. So all I need is a nice pair of shoes and a sweatshirt, and I'm good to go. So hiking has a lot of benefits. I am a firm believer that people should get out of the city, that they should find somewhere where they can be in nature and that they should go for regular hikes. I think it's good for the mind, I think it's good for the soul, and it's also good exercise. So if you feel stuck in your apartment, if you're stuck in your house, and you just want to be happier, I highly suggest that you find somewhere beautiful to go for a hike. You can come to Canada if you want, but that's a little bit extreme. I'm sure if you go outside of your town or city, there's probably a place where you can go for a nice hike. You can breathe in the fresh air, you can get a little bit of exercise, and when you're done, you'll feel mentally and physically refreshed. So I waited until fall or what we also call autumn to make this English lesson about hiking. I waited because this is the best time of year in my opinion, to go hiking. You can see that the leaves have started to change color. You can see red leaves and brown leaves and orange leaves and yellow leaves, and still some green leaves, and there's even leaves on the ground already. This time of year, this season, in my opinion, is the best time to go hiking. The weather is cooler, the views in nature are amazing, and it's just a great time to be out in the forest. So sometimes you go on a hike to see specific things, sometimes it's just nature, maybe an old tree that fell in the forest. Maybe along the hiking trail, there's a beautiful waterfall. Sorry, there's no waterfalls on this hiking trail. But you also might hike to a point where there is a spectacular view. Behind me, you can see Lake Ontario. So one of the rewards of this hiking trail is that you can stand here and you can see Lake Ontario, you can see some of the beautiful fall colors, and you can see the town below. So sometimes you go on a hike for a very specific reason because there's just something awesome to see while you're hiking. So you do wanna be careful when you're hiking, there's always the possibility that something could go wrong. If you look down here, it's a little bit treacherous to walk along here. You could twist your ankle, you might slip and fall, and you want to just be really, really careful so that you don't hurt yourself. In addition, if you look over here, we are walking along the edge of a very sharp drop-off. I wouldn't call this a cliff, but you certainly wouldn't want to accidentally slip and fall down here. That would certainly hurt and would not be a good thing to have happen while you're out for a beautiful hike in nature. So one of the coolest things about this hiking trail is that there is an observation deck. I'm standing on this observation deck because if I show you what's on the other side of the camera, I think you'll really enjoy the view. So this would be another example of a spectacular view. I feel like it's so spectacular, I should just stop talking for a few seconds and let you enjoy it. Well, thank you so much for watching this English lesson and for coming on a little hike with me. I hope you were able to learn some new English words and phrases that you can use in your next English conversation. Remember, if this is your first time here, don't forget to click that red subscribe button, gimme a thumbs up, leave a comment. And as always, if you have a little bit of extra time, why don't you stick around and watch another English lesson. Bye. (upbeat music)", metadata={'bvid': 'BV1g84y1R7oE', 'aid': 620074163, 'videos': 1, 'tid': 208, 'tname': '校园学习', 'copyright': 1, 'pic': 'http://i2.hdslb.com/bfs/archive/49c2a3612efe1caad023973ca56d979aabc30922.jpg', 'title': "Let's Learn English on a Hike! 🍂🚶🏼🎒 【英文字幕】", 'pubdate': 1698108310, 'ctime': 1698108310, 'desc': "Have you ever learned English in nature? In this English lesson I take you to a hiking trail near me and teach you all of the words and phrases you'll need to know to have a conversation about hiking.\n\nIn this free English class you'll learn words and phrases like: trail, path, treacherous, view, sign, observation deck, gear, hiking boots, dangerous animals, racoon, skunk, and more.\n\nYou'll even see a squirrel and hear me say the word, which is supposed to be one of the hardest English words to pronounce! Maybe hit pause at that point and try to shadow me saying the word (repeat it after me).\n\nI hope you enjoy this English lesson and I hope you find time to go for a hike soon!\n\n⌛ Remember:\xa0Always watch the video two times.\xa0Once today with English subtitles on, and once tomorrow with the English subtitles off.\xa0This will reinforce the English you have learned!", 'desc_v2': [{'raw_text': "Have you ever learned English in nature? In this English lesson I take you to a hiking trail near me and teach you all of the words and phrases you'll need to know to have a conversation about hiking.\n\nIn this free English class you'll learn words and phrases like: trail, path, treacherous, view, sign, observation deck, gear, hiking boots, dangerous animals, racoon, skunk, and more.\n\nYou'll even see a squirrel and hear me say the word, which is supposed to be one of the hardest English words to pronounce! Maybe hit pause at that point and try to shadow me saying the word (repeat it after me).\n\nI hope you enjoy this English lesson and I hope you find time to go for a hike soon!\n\n⌛ Remember:\xa0Always watch the video two times.\xa0Once today with English subtitles on, and once tomorrow with the English subtitles off.\xa0This will reinforce the English you have learned!", 'type': 1, 'biz_id': 0}], 'state': 0, 'duration': 514, 'rights': {'bp': 0, 'elec': 0, 'download': 1, 'movie': 0, 'pay': 0, 'hd5': 1, 'no_reprint': 0, 'autoplay': 1, 'ugc_pay': 0, 'is_cooperation': 0, 'ugc_pay_preview': 0, 'no_background': 0, 'clean_mode': 0, 'is_stein_gate': 0, 'is_360': 0, 'no_share': 0, 'arc_pay': 0, 'free_watch': 0}, 'owner': {'mid': 3493297272130118, 'name': 'Bob-the-Canadian', 'face': 'https://i2.hdslb.com/bfs/face/4c0f76c9b1e052ba3889b619f5f9f8326b9c83ad.png'}, 'stat': {'aid': 620074163, 'view': 124151, 'danmaku': 284, 'reply': 310, 'favorite': 3671, 'coin': 2562, 'share': 495, 'now_rank': 0, 'his_rank': 0, 'like': 7100, 'dislike': 0, 'evaluation': '', 'argue_msg': '', 'vt': 0}, 'dynamic': '', 'cid': 1309256295, 'dimension': {'width': 3840, 'height': 2160, 'rotate': 0}, 'premiere': None, 'teenage_mode': 0, 'is_chargeable_season': False, 'is_story': False, 'is_upower_exclusive': False, 'is_upower_play': False, 'enable_vt': 0, 'vt_display': '', 'no_cache': False, 'pages': [{'cid': 1309256295, 'page': 1, 'from': 'vupload', 'part': "Let's Learn English on a Hike! 🍂🚶🏼🎒 【英文字幕】", 'duration': 514, 'vid': '', 'weblink': '', 'dimension': {'width': 3840, 'height': 2160, 'rotate': 0}, 'first_frame': 'http://i1.hdslb.com/bfs/storyff/n231024qn20mf49qfe3dogu27vu3hlee_firsti.jpg'}], 'subtitle': {'allow_submit': False, 'list': [{'id': 1341811271904868864, 'lan': 'en-US', 'lan_doc': '英语(美国)', 'is_lock': False, 'subtitle_url': '', 'type': 0, 'id_str': '1341811271904868864', 'ai_type': 0, 'ai_status': 0, 'author': {'mid': 0, 'name': '', 'sex': '', 'face': '', 'sign': '', 'rank': 0, 'birthday': 0, 'is_fake_account': 0, 'is_deleted': 0, 'in_reg_audit': 0, 'is_senior_member': 0}}, {'id': 1341824311585240576, 'lan': 'ai-zh', 'lan_doc': '中文(自动翻译)', 'is_lock': False, 'subtitle_url': '', 'type': 1, 'id_str': '1341824311585240576', 'ai_type': 1, 'ai_status': 1, 'author': {'mid': 0, 'name': '', 'sex': '', 'face': '', 'sign': '', 'rank': 0, 'birthday': 0, 'is_fake_account': 0, 'is_deleted': 0, 'in_reg_audit': 0, 'is_senior_member': 0}}, {'id': 1341824314462225408, 'lan': 'ai-en', 'lan_doc': '英语(自动生成)', 'is_lock': False, 'subtitle_url': '', 'type': 1, 'id_str': '1341824314462225408', 'ai_type': 0, 'ai_status': 2, 'author': {'mid': 0, 'name': '', 'sex': '', 'face': '', 'sign': '', 'rank': 0, 'birthday': 0, 'is_fake_account': 0, 'is_deleted': 0, 'in_reg_audit': 0, 'is_senior_member': 0}}]}, 'is_season_display': False, 'user_garb': {'url_image_ani_cut': ''}, 'honor_reply': {}, 'like_icon': '', 'need_jump_bv': False, 'disable_show_up_info': False, 'url': 'https://www.bilibili.com/video/BV1g84y1R7oE/'})
]

抱歉,我无法完成这项任务。


Was this page helpful?


You can leave detailed feedback on GitHub.