-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathapple_bulletmessage.py
653 lines (580 loc) · 35.3 KB
/
apple_bulletmessage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
#coding=utf-8
__author__ = "Xu Tao"
from PA_runtime import *
import PA_runtime
import clr
clr.AddReference('System.Core')
clr.AddReference('System.Xml.Linq')
clr.AddReference('System.Data.SQLite')
try:
clr.AddReference('model_im')
clr.AddReference("bcp_im")
clr.AddReference("model_map")
except:
pass
del clr
import System
from System.Xml.Linq import *
from System.Data.SQLite import *
import model_im
import model_map
import json
CHAT_TYPE_FRIEND = 1 # 好友聊天
CHAT_TYPE_GROUP = 2 # 群聊天
CHAT_TYPE_SYSTEM = 3 # 系统消息
CHAT_TYPE_OFFICIAL = 4 # 公众号
CHAT_TYPE_SUBSCRIBE = 5 # 订阅号
CHAT_TYPE_SHOP = 6 # 商家
CHAT_TYPE_SECRET = 7 # 私密聊天
MESSAGE_TYPE_SYSTEM = 1
MESSAGE_TYPE_SEND = 2
MESSAGE_TYPE_RECEIVE = 3
MESSAGE_CONTENT_TYPE_TEXT = 1 # 文本
MESSAGE_CONTENT_TYPE_IMAGE = 2 # 图片
MESSAGE_CONTENT_TYPE_VOICE = 3 # 语音
MESSAGE_CONTENT_TYPE_VIDEO = 4 # 视频
MESSAGE_CONTENT_TYPE_EMOJI = 5 # 表情
MESSAGE_CONTENT_TYPE_CONTACT_CARD = 6 # 名片
MESSAGE_CONTENT_TYPE_LOCATION = 7 # 坐标
MESSAGE_CONTENT_TYPE_LINK = 8 # 链接
MESSAGE_CONTENT_TYPE_VOIP = 9 # 网络电话
MESSAGE_CONTENT_TYPE_ATTACHMENT = 10 # 附件
MESSAGE_CONTENT_TYPE_RED_ENVELPOE = 11 # 红包
MESSAGE_CONTENT_TYPE_RECEIPT = 12 # 转账
MESSAGE_CONTENT_TYPE_AA_RECEIPT = 13 # 群收款
MESSAGE_CONTENT_TYPE_CHARTLET = 14
MESSAGE_CONTENT_TYPE_SYSTEM = 99 # 系统
def convert_to_unixtime(timestamp):
try:
if len(str(timestamp)) == 13:
timestamp = int(str(timestamp)[0:10])
elif len(str(timestamp)) != 13 and len(str(timestamp)) != 10:
timestamp = 0
elif len(str(timestamp)) == 10:
timestamp = timestamp
return timestamp
except Exception as e:
pass
class bulletMessage(object):
def __init__(self, node, extractDeleted, extractSource):
self.root = node
self.extractDeleted = extractDeleted
self.extractSource = extractSource
self.bulletMessage = model_im.IM()
self.cache = ds.OpenCachePath("bulletMessage")
self.contact_list = {}
self.group_info = {}
def parse(self):
db_path = model_map.md5(self.cache, self.root.AbsolutePath)
self.bulletMessage.db_create(db_path)
self.get_user_friends()
self.get_messages()
self.get_feeds()
self.bulletMessage.db_close()
tmp_dir = ds.OpenCachePath("tmp")
# PA_runtime.save_cache_path("05005", db_path, tmp_dir)
im_models = model_im.GenerateModel(db_path).get_models()
# map_models = model_map.Genetate(db_path).get_models()
results = []
results.extend(im_models)
# results.extend(map_models)
return results
def get_user_friends(self):
account_nodes = self.root.Parent.Parent.Parent.GetByPath("/Documents/")
if account_nodes is None:
return
account_node_lists = account_nodes.Files
if account_node_lists is None:
return
for a_node in account_node_lists:
if a_node.Name.startswith("SMDataBase_") and a_node.Name.find("-") == -1:
account_id = a_node.Name[a_node.Name.find("_")+1:a_node.Name.find(".")]
self.get_account(a_node)
self.get_friends(a_node, account_id)
def get_messages(self):
messages_nodes = self.root.Parent.Parent.Parent.GetByPath("/Documents/NIMSDK/93b8bdf673198ce4bb42d4356e7ee5ba/Users/")
if messages_nodes is None:
return
message_node_lists = messages_nodes.Children
if message_node_lists is None:
return
for m_node in message_node_lists:
node = m_node.GetByPath("/message.db")
self.get_groups_name(node)
self.get_friends_message(node, m_node.Name)
self.get_chatroom(m_node.Name)
self.get_groups_message(node, m_node.Name)
def get_feeds(self):
feed_nodes = self.root.Parent.Parent.GetByPath("/Caches/com.bullet.message/FeedCache/")
if feed_nodes is None:
return
for node in feed_nodes:
if node.Name.startswith("moment_feed_") and node.Name.endswith("_all"):
self._get_user_feed(node)
def get_account(self, node):
db = SQLiteParser.Database.FromNode(node, canceller)
if db is None:
return
if 'ZUSER' not in db.Tables:
return
tbs = SQLiteParser.TableSignature("ZUSER")
for rec in db.ReadTableRecords(tbs, False):
if canceller.IsCancellationRequested:
return
try:
account = model_im.Account()
if rec.Deleted == DeletedState.Deleted:
account.deleted = 1
account.source = node.AbsolutePath
if "ZUSERNIMACCID" in rec and (not rec["ZUSERNIMACCID"].IsDBNull):
account.account_id = rec["ZUSERNIMACCID"].Value
if "ZUSERNAME" in rec and (not rec["ZUSERNAME"].IsDBNull):
account.nickname = rec["ZUSERNAME"].Value
self.contact_list[account.account_id] = account.nickname
if "ZUSERAVATAR" in rec and (not rec["ZUSERAVATAR"].IsDBNull):
account.photo = rec["ZUSERAVATAR"].Value
if "ZUSERPHONE" in rec and (not rec["ZUSERPHONE"].IsDBNull):
account.telephone = rec["ZUSERPHONE"].Value
if account.account_id:
self.bulletMessage.db_insert_table_account(account)
except Exception as e:
TraceService.Trace(TraceLevel.Info, e)
self.bulletMessage.db_commit()
def get_friends(self, node, account_id):
db = SQLiteParser.Database.FromNode(node, canceller)
if db is None:
return
if 'ZSMUSER' not in db.Tables:
return
tbs = SQLiteParser.TableSignature("ZSMUSER")
for rec in db.ReadTableRecords(tbs, False):
if canceller.IsCancellationRequested:
return
try:
friend = model_im.Friend()
friend.account_id = account_id
friend.type = 1
if rec.Deleted == DeletedState.Deleted:
friend.deleted = 1
friend.source = node.AbsolutePath
if "ZACCID" in rec and (not rec["ZACCID"].IsDBNull):
friend.friend_id = rec["ZACCID"].Value
if "ZNICKNAME" in rec and (not rec["ZNICKNAME"].IsDBNull):
friend.nickname = rec["ZNICKNAME"].Value
self.contact_list[friend.friend_id] = friend.nickname
if "ZAVATARURL" in rec and (not rec["ZAVATARURL"].IsDBNull):
friend.photo = rec["ZAVATARURL"].Value
if friend.account_id and friend.friend_id:
self.bulletMessage.db_insert_table_friend(friend)
except Exception as e:
TraceService.Trace(TraceLevel.Info, e)
self.bulletMessage.db_commit()
def get_friends_message(self, node, account_id):
db = SQLiteParser.Database.FromNode(node, canceller)
if db is None:
return
if 'session_table' not in db.Tables:
return
tbs = SQLiteParser.TableSignature("session_table")
for rec in db.ReadTableRecords(tbs, True, False):
if canceller.IsCancellationRequested:
return
try:
# 好友聊天
if "session_type" in rec and rec["session_type"].Value == 0:
table_name = None
talker_id = None
talk_name = None
if "session_id" in rec and (not rec["session_id"].IsDBNull):
talker_id = rec["session_id"].Value
if "name" in rec and (not rec["name"].IsDBNull):
table_name = rec["name"].Value
if rec["session_id"].Value in self.contact_list:
talk_name = self.contact_list[rec["session_id"].Value]
m_tbs = SQLiteParser.TableSignature(table_name)
for m_rec in db.ReadTableRecords(m_tbs, True, False):
try:
if canceller.IsCancellationRequested:
return
message = model_im.Message()
message.account_id = account_id
if m_rec.Deleted == DeletedState.Deleted:
message.deleted = 1
message.source = node.AbsolutePath
message.talker_id = talker_id
message.talker_name = talk_name
# 默认都是好友聊天
message.talker_type = CHAT_TYPE_FRIEND # 好友聊天
# send_id
if "msg_from_id" in m_rec and (not m_rec["msg_from_id"].IsDBNull):
message.sender_id = m_rec["msg_from_id"].Value
if m_rec["msg_from_id"].Value in self.contact_list:
message.sender_name = self.contact_list[m_rec["msg_from_id"].Value]
if m_rec["msg_from_id"].Value == account_id:
message.is_sender = 1
if "msg_id" in m_rec and (not m_rec["msg_id"].IsDBNull):
message.msg_id = m_rec["msg_id"].Value
if "msg_time" in m_rec and (not m_rec["msg_time"].IsDBNull):
message.send_time = convert_to_unixtime(m_rec["msg_time"].Value)
# 判断消息类型
if "msg_type" in m_rec and (not m_rec["msg_type"].IsDBNull):
# text
if m_rec["msg_type"].Value == 0:
message.type = MESSAGE_CONTENT_TYPE_TEXT
message.content = m_rec["msg_text"].Value
# img
elif m_rec["msg_type"].Value == 1:
message.type = MESSAGE_CONTENT_TYPE_IMAGE
try:
data = json.loads(m_rec["msg_content"].Value)
if "url" in data:
message.media_path = data["url"]
if "name" in data:
message.content = data["name"]
except Exception as e:
pass
# audio
elif m_rec["msg_type"].Value == 2:
message.type = MESSAGE_CONTENT_TYPE_VOICE
try:
data = json.loads(m_rec["msg_content"].Value)
if "url" in data:
message.media_path = data["url"]
except Exception as e:
pass
message.content = m_rec["msg_text"].Value
# video
elif m_rec["msg_type"].Value == 3:
message.type = MESSAGE_CONTENT_TYPE_VIDEO
try:
data = json.loads(m_rec["msg_content"].Value)
if "url" in data:
message.media_path = data["url"]
except Exception as e:
pass
message.content = m_rec["msg_text"].Value
# share location
elif m_rec["msg_type"].Value == 4:
message.type = MESSAGE_CONTENT_TYPE_LOCATION
try:
data = json.loads(m_rec["msg_content"].Value)
loc = model_im.Location()
if "lng" in data:
loc.longitude = data["lng"]
if "lat" in data:
loc.latitude = data["lat"]
if "title" in data:
message.content = data["title"]
loc.address = data["title"]
self.bulletMessage.db_insert_table_location(loc)
except Exception as e:
pass
# call
elif m_rec["msg_type"].Value == 5:
message.type = MESSAGE_CONTENT_TYPE_VOIP
try:
data = json.loads(m_rec["msg_content"].Value)
if "duration" in data:
message.content = "通话拨打时长 " + str(data["duration"]) + "s"
except Exception as e:
pass
# system messages
elif m_rec["msg_type"].Value == 10:
message.type = CHAT_TYPE_SYSTEM
message.content = m_rec["msg_text"].Value
# card
elif m_rec["msg_type"].Value == 100 and m_rec["client_type"].Value == 1:
message.type = MESSAGE_CONTENT_TYPE_CONTACT_CARD
try:
data = json.loads(m_rec["msg_content"].Value)
if "data" in data:
if "SMCardName" in data["data"]:
message.content = data["data"]["SMCardName"]
except Exception as e:
pass
# 红包
elif m_rec["msg_type"].Value == 100 and (not m_rec["push_content"].IsDBNull):
message.type = MESSAGE_CONTENT_TYPE_RED_ENVELPOE
message.content = m_rec["push_content"].Value
if message.account_id and message.talker_id:
self.bulletMessage.db_insert_table_message(message)
except Exception as e:
TraceService.Trace(TraceLevel.Info, e)
except Exception as e:
TraceService.Trace(TraceLevel.Info, e)
self.bulletMessage.db_commit()
def get_groups_message(self, node, account_id):
db = SQLiteParser.Database.FromNode(node, canceller)
if db is None:
return
if 'session_table' not in db.Tables:
return
tbs = SQLiteParser.TableSignature("session_table")
for rec in db.ReadTableRecords(tbs, True, False):
if canceller.IsCancellationRequested:
return
try:
# 群聊天
if "session_type" in rec and rec["session_type"].Value == 1:
table_name = None
talker_id = None
talk_name = None
if "session_id" in rec and (not rec["session_id"].IsDBNull):
talker_id = rec["session_id"].Value
if rec["session_id"].Value in self.group_info.keys():
talk_name = self.group_info[rec["session_id"].Value]
if "name" in rec and (not rec["name"].IsDBNull):
table_name = rec["name"].Value
m_tbs = SQLiteParser.TableSignature(table_name)
for m_rec in db.ReadTableRecords(m_tbs, True, False):
try:
if canceller.IsCancellationRequested:
return
message = model_im.Message()
message.account_id = account_id
if m_rec.Deleted == DeletedState.Deleted:
message.deleted = 1
message.source = node.AbsolutePath
message.talker_id = talker_id
message.talker_name = talk_name
# 默认都是好友聊天
message.talker_type = CHAT_TYPE_GROUP # 群聊天
# send_id
if "msg_from_id" in m_rec and (not m_rec["msg_from_id"].IsDBNull):
message.sender_id = m_rec["msg_from_id"].Value
if m_rec["msg_from_id"].Value in self.contact_list:
message.sender_name = self.contact_list[m_rec["msg_from_id"].Value]
if m_rec["msg_from_id"].Value == account_id:
message.is_sender = 1
if "msg_id" in m_rec and (not m_rec["msg_id"].IsDBNull):
message.msg_id = m_rec["msg_id"].Value
if "msg_time" in m_rec and (not m_rec["msg_time"].IsDBNull):
message.send_time = convert_to_unixtime(m_rec["msg_time"].Value)
# 判断消息类型
if "msg_type" in m_rec and (not m_rec["msg_type"].IsDBNull):
# text
if m_rec["msg_type"].Value == 0:
message.type = MESSAGE_CONTENT_TYPE_TEXT
message.content = m_rec["msg_text"].Value
# img
elif m_rec["msg_type"].Value == 1:
message.type = MESSAGE_CONTENT_TYPE_IMAGE
try:
data = json.loads(m_rec["msg_content"].Value)
if "url" in data:
message.media_path = data["url"]
if "name" in data:
message.content = data["name"]
except Exception as e:
pass
# audio
elif m_rec["msg_type"].Value == 2:
message.type = MESSAGE_CONTENT_TYPE_VOICE
try:
data = json.loads(m_rec["msg_content"].Value)
if "url" in data:
message.media_path = data["url"]
except Exception as e:
pass
message.content = m_rec["msg_text"].Value
# video
elif m_rec["msg_type"].Value == 3:
message.type = MESSAGE_CONTENT_TYPE_VIDEO
try:
data = json.loads(m_rec["msg_content"].Value)
if "url" in data:
message.media_path = data["url"]
except Exception as e:
pass
message.content = m_rec["msg_text"].Value
# share location
elif m_rec["msg_type"].Value == 4:
message.type = MESSAGE_CONTENT_TYPE_LOCATION
try:
data = json.loads(m_rec["msg_content"].Value)
loc = model_im.Location()
if "lng" in data:
loc.longitude = data["lng"]
if "lat" in data:
loc.latitude = data["lat"]
if "title" in data:
message.content = data["title"]
loc.address = data["title"]
self.bulletMessage.db_insert_table_location(loc)
except Exception as e:
pass
# call 或者系统消息
elif m_rec["msg_type"].Value == 5:
try:
message.type = MESSAGE_CONTENT_TYPE_VOIP
data = json.loads(m_rec["msg_content"].Value)
if "duration" in data:
message.content = "通话拨打时长 " + str(data["duration"]) + "s"
else:
message.type = MESSAGE_CONTENT_TYPE_SYSTEM
if "data" in data:
sysyem_data = data["data"]
# self.get_chatroom_info(m_rec["msg_content"].Value)
if "uinfos" in sysyem_data:
if len(sysyem_data["uinfos"]) == 1:
if "3" in sysyem_data["uinfos"][0]:
message.content = sysyem_data["uinfos"][0]["3"] + " 离开了群"
elif len(sysyem_data["uinfos"]) == 2:
if "3" in sysyem_data["uinfos"][0]:
message.content = sysyem_data["uinfos"][0]["3"] + " 进入了群"
except Exception as e:
pass
# system messages
elif m_rec["msg_type"].Value == 10:
message.type = CHAT_TYPE_SYSTEM
message.content = m_rec["msg_text"].Value
# card
elif m_rec["msg_type"].Value == 100 and m_rec["client_type"].Value == 1:
message.type = MESSAGE_CONTENT_TYPE_CONTACT_CARD
try:
data = json.loads(m_rec["msg_content"].Value)
if "data" in data:
if "SMCardName" in data["data"]:
message.content = data["data"]["SMCardName"]
except Exception as e:
pass
# 红包
elif m_rec["msg_type"].Value == 100 and (not m_rec["push_content"].IsDBNull):
message.type = MESSAGE_CONTENT_TYPE_RED_ENVELPOE
message.content = m_rec["push_content"].Value
if message.account_id and message.talker_id:
self.bulletMessage.db_insert_table_message(message)
except Exception as e:
TraceService.Trace(TraceLevel.Info, e)
except Exception as e:
TraceService.Trace(TraceLevel.Info, e)
self.bulletMessage.db_commit()
def get_groups_name(self,node):
db = SQLiteParser.Database.FromNode(node, canceller)
if db is None:
return
if 'session_table' not in db.Tables:
return
tbs = SQLiteParser.TableSignature("session_table")
for rec in db.ReadTableRecords(tbs, True, False):
if canceller.IsCancellationRequested:
return
try:
# 群聊天
if "session_type" in rec and rec["session_type"].Value == 1:
table_name = None
if "name" in rec and (not rec["name"].IsDBNull):
table_name = rec["name"].Value
m_tbs = SQLiteParser.TableSignature(table_name)
for m_rec in db.ReadTableRecords(m_tbs, True, False):
try:
# 判断消息类型
if "msg_type" in m_rec and (not m_rec["msg_type"].IsDBNull):
# call 或者系统消息
if m_rec["msg_type"].Value == 5:
try:
data = json.loads(m_rec["msg_content"].Value)
if "duration" in data:
pass
else:
if "data" in data:
sysyem_data = data["data"]
self.get_chatroom_info(m_rec["msg_content"].Value)
except Exception as e:
pass
except Exception as e:
TraceService.Trace(TraceLevel.Info, e)
except Exception as e:
TraceService.Trace(TraceLevel.Info, e)
def get_chatroom(self, account_id):
try:
for g_id, g_name in self.group_info.items():
chatroom = model_im.Chatroom()
chatroom.account_id = account_id
chatroom.chatroom_id = g_id
chatroom.name = g_name
chatroom.type = 1
try:
self.bulletMessage.db_insert_table_chatroom(chatroom)
except Exception as e:
pass
except Exception as e:
pass
self.bulletMessage.db_commit()
def get_chatroom_info(self, data):
try:
info = json.loads(data)
if "data" in info and "tinfo" in info["data"] and "1" in info["data"]["tinfo"] and "3" in info["data"]["tinfo"]:
if info["data"]["tinfo"]["1"] not in self.group_info:
self.group_info[info["data"]["tinfo"]["1"]] = info["data"]["tinfo"]["3"]
except Exception as e:
pass
def _get_user_feed(self, node):
account_id = node.Name[12:-4]
with open(node.PathWithMountPoint, "r") as f:
json_data = json.loads(f.read())
if "list" in json_data:
feed_lists = json_data["list"]
for item in feed_lists:
feed = model_im.Feed()
feed.source = node.AbsolutePath
feed.account_id = account_id
if "userAccid" in item:
feed.sender_id = item["userAccid"]
if "createTime" in item:
feed.send_time = convert_to_unixtime(item["createTime"])
if "text" in item:
feed.content = item["text"]
if "liked" in item and item["liked"] == True:
like_lists = item["likeList"]
for item_like in like_lists:
f1 = feed.create_like()
f1.send_id = item_like["userAccid"]
f1.sender_name = item_like["name"]
f1.create_time = convert_to_unixtime(item["createTime"])
feed.likecount += 1
if feed.likecount == 0:
feed.like_id = 0
if "location" in item:
loc = feed.create_location()
loc.address = item["location"]
if "longitude" in item:
loc.longitude = item["longitude"]
if "latitude" in item:
loc.longitude = item["latitude"]
loc.timestamp = convert_to_unixtime(item["createTime"])
if "commentList" in item:
comment_list = item["commentList"]
if comment_list:
for item_cmt in comment_list:
fc = feed.create_comment()
fc.sender_id = item_cmt["userAccid"]
fc.sender_name = item_cmt["sponsorName"]
fc.content = item_cmt["text"]
fc.create_time = convert_to_unixtime(item_cmt["createTime"])
feed.commentcount += 1
if feed.commentcount == 0:
feed.comment_id = 0
if item["feedType"] != "text":
resource_lists = item["images"]
if resource_lists:
urls = []
for item_res in resource_lists:
urls.append(item_res)
if len(urls) > 0:
if item["feedType"] == "image":
feed.image_path = ','.join(str(u) for u in urls)
else:
feed.video_path = ','.join(str(u) for u in urls)
feed.insert_db(self.bulletMessage)
self.bulletMessage.db_commit()
def analyze_bulletMessage(node, extractDeleted, extractSource):
TraceService.Trace(TraceLevel.Info,"正在分析苹果聊天宝...")
pr = ParserResults()
# pr.Categories = DescripCategories.bulletMessage
results = bulletMessage(node, extractDeleted, extractSource).parse()
if results:
pr.Models.AddRange(results)
pr.Build("聊天宝")
TraceService.Trace(TraceLevel.Info,"聊天宝分析完成!")
return pr