зеркало из
https://github.com/viginum-datalab/twscrape.git
synced 2025-10-30 05:26:20 +02:00
Get RT and QT when they are in objects of type TweetWithVisibilityResults
Этот коммит содержится в:
родитель
745bc59b66
Коммит
a1e60203ff
@ -189,10 +189,24 @@ class Tweet(JSONTrait):
|
|||||||
def parse(obj: dict, res: dict):
|
def parse(obj: dict, res: dict):
|
||||||
tw_usr = User.parse(res["users"][obj["user_id_str"]])
|
tw_usr = User.parse(res["users"][obj["user_id_str"]])
|
||||||
|
|
||||||
rt_id = _first(obj, ["retweeted_status_id_str", "retweeted_status_result.result.rest_id"])
|
rt_id = _first(
|
||||||
|
obj,
|
||||||
|
[
|
||||||
|
"retweeted_status_id_str",
|
||||||
|
"retweeted_status_result.result.rest_id",
|
||||||
|
"retweeted_status_result.result.tweet.rest_id"
|
||||||
|
]
|
||||||
|
)
|
||||||
rt_obj = get_or(res, f"tweets.{rt_id}")
|
rt_obj = get_or(res, f"tweets.{rt_id}")
|
||||||
|
|
||||||
qt_id = _first(obj, ["quoted_status_id_str", "quoted_status_result.result.rest_id"])
|
qt_id = _first(
|
||||||
|
obj,
|
||||||
|
[
|
||||||
|
"quoted_status_id_str",
|
||||||
|
"quoted_status_result.result.rest_id"
|
||||||
|
"quoted_status_result.result.tweet.rest_id"
|
||||||
|
]
|
||||||
|
)
|
||||||
qt_obj = get_or(res, f"tweets.{qt_id}")
|
qt_obj = get_or(res, f"tweets.{qt_id}")
|
||||||
|
|
||||||
doc = Tweet(
|
doc = Tweet(
|
||||||
|
|||||||
Загрузка…
x
Ссылка в новой задаче
Block a user