| Naver가 Weverse를 인수 한 후에이 프로젝트는 더 이상 유지되지 않습니다. 그들은 API를 완전히 바꾸었고 다른 래퍼를 만들 시간이 없습니다. ❗ |
|---|
Weverse는 사용자가 Weverse.io에서 따르는 커뮤니티에 대한 내부 캐시를 만듭니다.
이것은 Weverse의 개인 API를위한 래퍼 이지만이 저장소에서 API라고 할 수 있습니다.
Weverse Discord 봇은 여기에서 찾을 수 있습니다
터미널에서 pip install weverse .
소스에서 설치하려면 :
pip install git+https://github.com/MujyKun/Weverse.git
먼저, 귀하의 계정 토큰이 필요합니다 (약 6 개월마다 IIRC마다 업데이트해야 함).
이제 토큰없이 사용자 이름과 비밀번호를 사용하여 로그인 할 수 있습니다. 이렇게하면 수동 업데이트가 방지됩니다.
계정 토큰을 얻으려면 Weverse로 이동하여 요소 (F12)를 검사하십시오.
그런 다음 XHR 의 Network 탭과 필터로 이동하십시오. 그런 다음 페이지 (F5)를 새로 고치고 XHR 에서 info 또는 me 찾으십시오.
헤더 아래에서 하단으로 스크롤하여 요청 헤더를 봅니다. 당신은 과거의 모든 authorization: Bearer 복사하고 싶습니다.
예를 들어, 당신은 볼 수 있습니다 (이것은 단지 예일뿐입니다).
authorization: Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZ
그런 다음 ABCDEFGHIJKLMNOPQRSTUVWXYZ weverse의 인증 토큰이 될 것입니다. 환경 변수로 인증 토큰을 갖는 것이 좋습니다.
중요한 참고 사항 : 모든 한국의 키 프레이즈가 추적 될 수있는 것은 아닙니다. 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. 보다 상세한 비동기 예제
보다 자세한 동기 예제