From 6a2288a45dbec0da0cf9eb275e595c85f068f433 Mon Sep 17 00:00:00 2001
From: Jerry Yan <792602257@qq.com>
Date: Fri, 3 Jan 2020 09:48:16 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0README?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Demo/XiguaMessage.proto     |  8 +++-----
 Demo/新建文本文档.txt | 17 -----------------
 Model/DataBase.py           |  8 --------
 Model/Files.py              | 10 ----------
 README.md                   |  5 +++--
 api.py                      |  5 ++++-
 6 files changed, 10 insertions(+), 43 deletions(-)
 delete mode 100644 Demo/新建文本文档.txt
 delete mode 100644 Model/DataBase.py
 delete mode 100644 Model/Files.py

diff --git a/Demo/XiguaMessage.proto b/Demo/XiguaMessage.proto
index 43d4135..673e9e2 100644
--- a/Demo/XiguaMessage.proto
+++ b/Demo/XiguaMessage.proto
@@ -3,14 +3,12 @@ import "XiguaUser.proto";
 import "XiguaGift.proto";
 message Message {
 	required CommonInfo commonInfo = 1;
-	required bytes content2 = 2;
-	required bytes content3 = 3;
-	required bytes content4 = 4;
 }
 message FansClubMessage {
 	required CommonInfo commonInfo = 1;
-	// 0没有 1有且是本直播间
+	// 升级是1,加入是2
 	required int32 type = 2;
+	// 提示文字
 	required string content = 3;
 	required User user = 4;
 }
@@ -44,10 +42,10 @@ message GiftMessage {
 	// 可能是GroupId之类的东西
 //	required int32 UNKNOWN_INT = 3;
 	required int32 content4 = 4;
-	// 5,6 顺序可能不对
 	required int32 repeated = 5;
 	required int32 combo = 6;
 	optional User user = 7;
+	// 是否发完了,注:不可连击的也是没有发完的
 	optional bool isFinished = 9 [ default = false ];
 }
 // 样式
diff --git a/Demo/新建文本文档.txt b/Demo/新建文本文档.txt
deleted file mode 100644
index fa3a75b..0000000
--- a/Demo/新建文本文档.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-POST https://webcast3.ixigua.com/webcast/room/6776866251722459918/_fetch_message_polling/?webcast_sdk_version=1350&webcast_language=zh&webcast_locale=zh_CN&iid=97470633732&device_id=55714661189&ac=wifi&channel=xiaomi&aid=32&app_name=video_article&version_code=816&version_name=8.1.6&device_platform=android&ab_version=668859%2C999124%2C668855%2C941090%2C785218%2C668858%2C1046292%2C1073579%2C830454%2C956074%2C1402792%2C929436%2C797199%2C1135476%2C1179370%2C994679%2C900042%2C1113833%2C668854%2C1193963%2C901277%2C1043330%2C994822%2C1002058%2C1230687%2C1189797%2C1143356%2C1143441%2C1143501%2C1143698%2C1143713%2C1243997%2C1395695%2C1395486%2C1398858%2C668852%2C668856%2C668853%2C1186421%2C668851&ssmix=a&device_type=MI+8+SE&device_brand=Xiaomi&language=zh&os_api=28&os_version=9&openudid=70d6668d41512c39&manifest_version_code=416&resolution=1080*2029&dpi=480&update_version_code=81606&_rticket=1577867432094&cdid_ts=1577625556989&fp=a_fake_fp&tma_jssdk_version=1.29.1.1&rom_version=miui_V11_V11.0.3.0.PEBCNXM&cdid=778dbd7e-1536-475b-9624-95b13598ebd1&oaid=a625f466e0975d42 HTTP/1.1
-Host: webcast3.ixigua.com
-Connection: keep-alive
-Content-Length: 316
-Cookie: install_id=97470633732; ttreq=1$3f04d8c6f9873fc560ea72b7cf6172815f5d3e7a; _ga=GA1.2.108127775.1577766259; msh=tv_McCXsGpmOcfszgooF-zSdZrA; d_ticket=b11bc347dec250de4692d89482e9689c93530; sid_guard=ff580c5b8a39c05d9f26001f2a337b2a%7C1577853576%7C5184000%7CSun%2C+01-Mar-2020+04%3A39%3A36+GMT; uid_tt=a53fa4ca5af7097f3c8ffd63ec3ad058; sid_tt=ff580c5b8a39c05d9f26001f2a337b2a; sessionid=ff580c5b8a39c05d9f26001f2a337b2a; odin_tt=772ada2984c0695e52569ee34d11382821b2c684e498e00ee7392f982097eb3f61101a57cd929593f650770b863fb982; qh[360]=1
-X-Tt-Token: 00ff580c5b8a39c05d9f26001f2a337b2a56bd1d24d0c8c74431df91bf03927a736d9883ae06d9498a1249e6db08c3fb4426
-sdk-version: 1
-User-Agent: Dalvik/2.1.0 (Linux; U; Android 9; MI 8 SE MIUI/V11.0.3.0.PEBCNXM) VideoArticle/8.1.6 cronet/TTNetVersion:4df3ca9d 2019-11-25
-Content-Type: application/x-www-form-urlencoded; charset=UTF-8
-X-SS-STUB: 5AEDCEB8B350A716E6D12AD1B0B349DF
-X-SS-DP: 32
-x-tt-trace-id: 00-603a521609cf8da43457450e8e3b0020-603a521609cf8da4-01
-Accept-Encoding: gzip, deflate
-X-Khronos: 1577867432
-X-Gorgon: 040160c30000eee3b5b198cd094ba340a3d3bde1b658e75e8d97
-
-cursor={cursor}&resp_content_type=protobuf&last_rtt=138&live_id=3&user_id=0&identity=audience&recv_cnt=8&parse_cnt=8&internal_ext={internal_ext}
\ No newline at end of file
diff --git a/Model/DataBase.py b/Model/DataBase.py
deleted file mode 100644
index de475fd..0000000
--- a/Model/DataBase.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from flask import Flask
-from flask_sqlalchemy import SQLAlchemy
-
-app = Flask(__name__)
-app.config["SQLALCHEMY_DATABASE_URL"] = "sqlite://data.db"
-app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
-app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
-db = SQLAlchemy(app)
\ No newline at end of file
diff --git a/Model/Files.py b/Model/Files.py
deleted file mode 100644
index 3b6d595..0000000
--- a/Model/Files.py
+++ /dev/null
@@ -1,10 +0,0 @@
-from datetime import datetime
-from sqlalchemy import func
-from .DataBase import db
-
-
-class Files(db.Model):
-    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
-    filename = db.Column(db.String(50))
-    is_upload = db.Column(db.Integer(1), server_default=0, default=0)
-    create_time = db.Column(db.TIMESTAMP, server_default=func.now(), default=datetime.now())
diff --git a/README.md b/README.md
index 8dae1fc..4ca7456 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 # XiguaLiveDanmakuHelper
 
-### 因西瓜直播弹幕接口换成了ProtoBuf,没有对应proto文件没有办法进行解析
+### 因西瓜直播弹幕接口换成了ProtoBuf,已经尝试解析出了部分proto
+(旧版本仍可用就是带动画的礼物不显示而已)
 
 ### 西瓜直播弹幕助手--控制台版
 
@@ -8,7 +9,7 @@
 
 ### 西瓜直播弹幕接口```api.py```
 
-> - 西瓜直播的弹幕接口已经换成了ProtoBuf,有大佬可以去尝试解析一下
+> - 基于安卓8.1.6
 
 ### 西瓜直播弹幕助手--礼物端```WinMain.py```
 
diff --git a/api.py b/api.py
index 7f23819..e9c5d7d 100644
--- a/api.py
+++ b/api.py
@@ -371,12 +371,15 @@ class XiGuaLiveApi:
                 _gift = Gift(_each.raw)
                 if _gift.isAnimate() or _gift.isFinished:
                     self.onPresentEnd(_gift)
+                else:
+                    self.onPresent(_gift)
             elif _each.method == "WebcastChatMessage":
                 _chat = Chat(_each.raw)
-                # self.onChat(_chat)
+                self.onChat(_chat)
             elif _each.method == "WebcastFansclubMessage":
                 _fansClubMessage = FansClubMessage()
                 _fansClubMessage.ParseFromString(_each.raw)
+                # 升级是1,加入是2
                 if _fansClubMessage.type == 2:
                     _user = User(_fansClubMessage.user)
                     self.onJoin(_user)