You've already forked Douyin_Web_Live
2022-05-19 修复改用wss协议后无法使用的问题
This commit is contained in:
BIN
messages/__pycache__/__init__.cpython-38.pyc
Normal file
BIN
messages/__pycache__/__init__.cpython-38.pyc
Normal file
Binary file not shown.
BIN
messages/__pycache__/base.cpython-38.pyc
Normal file
BIN
messages/__pycache__/base.cpython-38.pyc
Normal file
Binary file not shown.
BIN
messages/__pycache__/chat.cpython-38.pyc
Normal file
BIN
messages/__pycache__/chat.cpython-38.pyc
Normal file
Binary file not shown.
BIN
messages/__pycache__/gift.cpython-38.pyc
Normal file
BIN
messages/__pycache__/gift.cpython-38.pyc
Normal file
Binary file not shown.
BIN
messages/__pycache__/like.cpython-38.pyc
Normal file
BIN
messages/__pycache__/like.cpython-38.pyc
Normal file
Binary file not shown.
BIN
messages/__pycache__/member.cpython-38.pyc
Normal file
BIN
messages/__pycache__/member.cpython-38.pyc
Normal file
Binary file not shown.
BIN
messages/__pycache__/roomuserseq.cpython-38.pyc
Normal file
BIN
messages/__pycache__/roomuserseq.cpython-38.pyc
Normal file
Binary file not shown.
BIN
messages/__pycache__/social.cpython-38.pyc
Normal file
BIN
messages/__pycache__/social.cpython-38.pyc
Normal file
Binary file not shown.
BIN
messages/__pycache__/utils.cpython-38.pyc
Normal file
BIN
messages/__pycache__/utils.cpython-38.pyc
Normal file
Binary file not shown.
@ -1,6 +1,7 @@
|
||||
import os
|
||||
from protobuf import message_pb2
|
||||
|
||||
from protobuf import wss_pb2
|
||||
import gzip
|
||||
from messages.member import MemberMessage
|
||||
from messages.like import LikeMessage
|
||||
from messages.roomuserseq import RoomUserSeqMessage
|
||||
@ -22,13 +23,16 @@ init()
|
||||
|
||||
def unpackMsgBin(filepath):
|
||||
response = message_pb2.Response()
|
||||
|
||||
wss = wss_pb2.WssResponse()
|
||||
try:
|
||||
with open(filepath, 'rb') as f:
|
||||
response.ParseFromString(f.read())
|
||||
|
||||
path_content = f.read()
|
||||
wss.ParseFromString( path_content )
|
||||
decompressed = gzip.decompress(wss.data)
|
||||
response.ParseFromString(decompressed)
|
||||
decodeMsg(response.messages)
|
||||
except Exception as e:
|
||||
os.remove(filepath)
|
||||
pass
|
||||
finally:
|
||||
os.remove(filepath)
|
||||
|
Reference in New Issue
Block a user