saermart / DouyinLiveWebFetcher

抖音直播间网页版的弹幕数据抓取(2024最新版本)
GNU Affero General Public License v3.0
526 stars 158 forks source link

关于如何把结构化数据转换为json的问题 #59

Closed FengFeng8888 closed 2 weeks ago

FengFeng8888 commented 1 month ago

ChatMessage(common=Common(method='WebcastChatMessage', msg_id=7398187696429519935, room_id=7398118612592053031, create_time=0, monitor=0, is_show_msg=True, describe='', fold_type=0, anchor_fold_type=0, priority_score=31000, log_id='', msg_process_filter_k='', msg_process_filter_v='', user=User(id=0, short_id=0, nick_name='', gender=0, signature='', level=0, birthday=0, telephone='', avatar_thumb=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), avatar_medium=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), avatar_large=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), verified=False, experience=0, city='', status=0, create_time=0, modify_time=0, secret=0, share_qrcode_uri='', income_share_percent=0, badge_image_list=[], follow_info=FollowInfo(following_count=0, follower_count=0, follow_status=0, push_status=0, remark_name='', follower_count_str='', following_count_str=''), pay_grade=PayGrade(total_diamond_count=0, diamond_icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), name='', icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), next_name='', level=0, next_icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), next_diamond=0, now_diamond=0, this_grade_min_diamond=0, this_grade_max_diamond=0, pay_diamond_bak=0, grade_describe='', grade_icon_list=[], screen_chat_type=0, im_icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), im_icon_with_level=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), live_icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), new_im_icon_with_level=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), new_live_icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), upgrade_need_consume=0, next_privileges='', background=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), background_back=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), score=0, buff_info=GradeBuffInfo(), grade_banner='', profile_dialog_bg=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), profile_dialog_bg_back=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[]))), fans_club=FansClub(data=FansClubData(club_name='', level=0, user_fans_club_status=0, badge=UserBadge(icons={}, title=''), available_gift_ids=[], anchor_id=0), prefer_data={}), special_id='', avatar_border=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), medal=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), real_time_icons_list=[], display_id='', sec_uid='', fan_ticket_count=0, id_str='', age_range=0), anchor_fold_type_v2=0, process_at_sei_time_ms=0, random_dispatch_ms=0, is_dispatch=False, channel_id=0, diff_sei2abs_second=0, anchor_fold_duration=0), user=User(id=105233347694, short_id=1632024613, nick_name='嫣然一笑', gender=2, signature='', level=0, birthday=0, telephone='', avatar_thumb=Image(url_list_list=['https://p26.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-i-0813_9c34d0e6a6d045af965bdd16589c7ead.jpeg?from=3067671334'], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), avatar_medium=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), avatar_large=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), verified=False, experience=0, city='', status=0, create_time=0, modify_time=0, secret=0, share_qrcode_uri='', income_share_percent=0, badge_image_list=[Image(url_list_list=['https://p3-webcast.douyinpic.com/img/webcast/new_user_grade_level_v1_14.png~tplv-obj.image'], uri='', height=16, width=32, avg_color='', image_type=1, open_web_url='', content=ImageContent(name='', font_color='', level=14, alternative_text='荣誉等级14级勋章'), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[]))], follow_info=FollowInfo(following_count=1671, follower_count=311, follow_status=1, push_status=0, remark_name='', follower_count_str='0', following_count_str='0'), pay_grade=PayGrade(total_diamond_count=0, diamond_icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), name='', icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), next_name='', level=14, next_icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), next_diamond=0, now_diamond=0, this_grade_min_diamond=0, this_grade_max_diamond=0, pay_diamond_bak=0, grade_describe='', grade_icon_list=[], screen_chat_type=0, im_icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), im_icon_with_level=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), live_icon=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), new_im_icon_with_level=Image(url_list_list=['https://p3-webcast.douyinpic.com/img/webcast/new_user_grade_level_v1_14.png~tplv-obj.image'], uri='', height=16, width=32, avg_color='', image_type=1, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), new_live_icon=Image(url_list_list=['https://p11-webcast.douyinpic.com/img/webcast/aweme_pay_grade_2x_10_14.png~tplv-obj.image'], uri='', height=12, width=12, avg_color='', image_type=1, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), upgrade_need_consume=0, next_privileges='', background=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), background_back=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), score=0, buff_info=GradeBuffInfo(), grade_banner='', profile_dialog_bg=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), profile_dialog_bg_back=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[]))), fans_club=FansClub(data=FansClubData(club_name='', level=0, user_fans_club_status=0, badge=UserBadge(icons={0: Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[]))}, title=''), available_gift_ids=[], anchor_id=0), prefer_data={}), special_id='', avatar_border=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), medal=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), real_time_icons_list=[], display_id='1632024613', sec_uid='MS4wLjABAAAAVkuUoPLkldmt7qynhGVv6Kujkz7F64Dh_AFhKbLjV7I', fan_ticket_count=0, id_str='', age_range=0), content='好听好听好听好听好', visible_to_sender=False, background_image=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), full_screen_text_color='', background_image_v2=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), public_area_common=PublicAreaCommon(user_label=Image(url_list_list=['https://p3-webcast.douyinpic.com/img/webcast/userlabel_new_chat.png~tplv-obj.image'], uri='', height=0, width=0, avg_color='#A37C96', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), user_consume_in_room=0, user_send_gift_cnt_in_room=0), gift_image=Image(url_list_list=[], uri='', height=0, width=0, avg_color='', image_type=0, open_web_url='', content=ImageContent(name='', font_color='', level=0, alternative_text=''), is_animated=False, flex_setting_list=NinePatchSetting(setting_list_list=[]), text_setting_list=NinePatchSetting(setting_list_list=[])), agree_msg_id=0, priority_level=0, landscape_area_common=LandscapeAreaCommon(show_head=False, show_nickname=False, show_font_color=False, color_value_list=[], comment_type_tags_list=[]), event_time=1722524804, send_review=False, from_intercom=False, intercom_hide_user_card=False, chat_by='', individual_chat_priority=0, rtf_content=Text(key='', default_patter='', default_format=TextFormat(color='', bold=False, italic=False, weight=0, italic_angle=0, font_size=0, use_heigh_light_color=False, use_remote_clor=False), pieces_list=[]))

这些是什么格式的?怎么让他们转换为json?????

saermart commented 2 weeks ago

https://zhuanlan.zhihu.com/p/37508470