Weverse
V1.1.3 Release Notes
| ❗在Naver获得Weverse后,不再维护该项目。他们完全切换了API,我没有时间制作另一个包装纸。 ❗ |
|---|
WEVERSE为用户在Weverse.io上遵循的社区创建内部缓存。
这是Weverse私有API的包装器,但可以称为此存储库中的API。
在这里可以找到一个WeversEnvers Discord机器人
在终端中,类型pip install weverse 。
从来源安装:
pip install git+https://github.com/MujyKun/Weverse.git
首先,需要您的帐户令牌(需要大约6个月的IIRC每6个月更新)。
请注意,现在可以使用无需令牌的用户名和密码登录。这将防止手动更新。
为了获得您的帐户令牌,请转到Weverse并检查元素(F12)。
然后转到Network选项卡,然后通过XHR过滤。然后刷新您的页面(F5),然后在XHR下me info 。
在标题下,向下滚动并查看请求标题。您想复制过去的所有authorization: Bearer 。
例如,您可能会看到(这只是一个示例):
authorization: Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZ
然后, ABCDEFGHIJKLMNOPQRSTUVWXYZ将成为您的身份验证。建议将auth令牌作为环境变量。
重要说明:并非所有韩国钥匙用语都可以跟踪。滚动到Weverse页面的底部
当您登录并单击“英语”以将帐户语言设置为英语。
# Asynchronous
import asyncio
import aiohttp
from Weverse . error import InvalidToken
from Weverse . weverseasync import WeverseClientAsync
# THERE IS A MORE DETAILED EXAMPLE IN THE EXAMPLES FOLDER
# https://github.com/MujyKun/Weverse/blob/main/examples/asynchronous.py
token = "fake_token" # REQUIRED
# THE EXAMPLE IN THE EXAMPLES FOLDER WILL SHOW YOU HOW TO LOGIN WITH A USERNAME AND PASSWORD AND SET UP HOOKS.
# It is advised to pass in your own web session as it is not closed in Weverse
web_session = aiohttp . ClientSession () # A session is created by default
weverse_client = WeverseClientAsync ( authorization = token , verbose = True , loop = asyncio . get_event_loop (),
web_session = web_session )
try :
# creates all the cache that is specified. If the create parameters are set to True, they will take a very long time.
await weverse_client . start ( create_old_posts = True , create_media = True )
except InvalidToken :
print ( "Invalid Token" )
# Synchronous
import requests
from Weverse . weversesync import WeverseClientSync
from Weverse . error import InvalidToken
# THERE IS A MORE DETAILED EXAMPLE IN THE EXAMPLES FOLDER
# https://github.com/MujyKun/Weverse/blob/main/examples/synchronous.py
token = "fake_token" # REQUIRED
# THE EXAMPLE IN THE EXAMPLES FOLDER WILL SHOW YOU HOW TO LOGIN WITH A USERNAME AND PASSWORD AND SET UP HOOKS.
# It is advised to pass in your own web session as it is not closed in Weverse
web_session = requests . Session () # A session is created by default
weverse_client = WeverseClientSync ( authorization = token , verbose = True )
try :
# creates all the cache that is specified. If the create parameters are set to True, they will take a very long time.
weverse_client . start ( create_old_posts = True , create_media = True )
except InvalidToken :
print ( "Invalid Token" )
# After calling the start method, you now have all the objects you would want to modify.
# The start method takes in parameters that can disable old posts from loading up
# if only the newer posts are wanted. More info on the documentation.更详细的异步示例
更详细的同步示例