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.更詳細的異步示例
更詳細的同步示例