зеркало из
https://github.com/viginum-datalab/twscrape.git
synced 2025-10-29 21:16:25 +02:00
27 строки
524 B
Python
27 строки
524 B
Python
import httpx
|
|
|
|
# update this url on next run
|
|
url = "https://abs.twimg.com/responsive-web/client-web/api.f4ff3bfa.js"
|
|
script = httpx.get(url).text
|
|
|
|
ops = """
|
|
SearchTimeline
|
|
UserByRestId
|
|
UserByScreenName
|
|
TweetDetail
|
|
Followers
|
|
Following
|
|
Retweeters
|
|
Favoriters
|
|
UserTweets
|
|
UserTweetsAndReplies
|
|
ListLatestTweetsTimeline
|
|
"""
|
|
|
|
ops = [op.strip() for op in ops.split("\n") if op.strip()]
|
|
|
|
for x in ops:
|
|
idx = script.split(f'operationName:"{x}"')[0].split("queryId:")[-1]
|
|
idx = idx.strip('",')
|
|
print(f'OP_{x} = "{idx}/{x}"')
|