Skip to main content

Weverse

What is it?

Weverse creates internal cache for the communities a user follows on weverse.io.
This is a wrapper for Weverse's private API, but may be referred to as an API on this repository.

API Documentation

Discord Support Server

A WEVERSE DISCORD BOT CAN BE FOUND HERE

Functionalities

  • Asynchronous and Synchronous Support
  • Receive all the posts the artists in your communities have made. This includes all images/videos/comments made by them.
  • Cache is split under a hierarchy directly under a community.
  • Keep track of notifications on your user account, you can easily create a loop to update your notification cache on updates. (Usage of this can be found in the examples folder)

Installation

In a terminal, type pip install weverse.

To install from source:
pip install git+https://github.com/MujyKun/Weverse.git

How to Use

First off, your account token is needed (Will need to be updated about every 6 months iirc).
Note that it is now possible to log-in using a username and password without a token. This will prevent manual updates.

In order to get your account token, go to Weverse and Inspect Element (F12).
Then go to the Network tab and filter by XHR. Then refresh your page (F5) and look for info or me under XHR.
Under Headers, scroll to the bottom and view the request headers. You want to copy everything past authorization: Bearer.

For example, you may see (This is just an example):
authorization: Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZ
Then ABCDEFGHIJKLMNOPQRSTUVWXYZ would be your auth token for Weverse. It is suggested to have the auth token as an environment variable.

IMPORTANT NOTE: Not all korean key-phrases may be kept track of. Scroll to the bottom of the Weverse page
when you are logged in and click "English" to set the account language to English.

CODE EXAMPLES

# 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.

More Detailed Asynchronous Example
More Detailed Synchronous Example

API Documentation

Release files for Weverse 1.1.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Weverse 1.1.8.2
File Size Uploaded
Weverse-1.1.8.2.tar.gz 30.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Weverse 1.1.8.2
File Interpreter ABI Platform
Weverse-1.1.8.2-py3-none-any.whl Python 3 none any Details

Total release size: 67.1 kB

Release files / Weverse-1.1.8.2.tar.gz

Download URL Weverse-1.1.8.2.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0d23e90ddbb75df3317de42eff603ffbacde865607ae6aeffb86009280b6d754
BLAKE2b-256 checksum
How to use checksums
dfc3acd84a7ad04f6214d2987cc9906dda41d5f956bd0f1ee8ca791da0c8e487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.6

Release files / Weverse-1.1.8.2-py3-none-any.whl

Download URL Weverse-1.1.8.2-py3-none-any.whl
Size 37.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17083ee94612b79f56f359775e3a387de9a3bd835a0e3e306cc397b100826718
BLAKE2b-256 checksum
How to use checksums
6d1da73020063a5d7335a961c470e64770346eb51d85487c257522c1e8ae0cc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.6

Release history Release notifications | RSS feed

This release

1.1.8.2 This release

2 release files

1.1.7

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page