Forum
airvpn.web.forum
For now this will be read-only.
Category
A top-level grouping of forums, fetched and cached on first access.
Attributes:
| Name | Type | Description |
|---|---|---|
session |
WebSession
|
The session used to fetch related resources. |
title |
str
|
The category's title. |
url |
str
|
The category's URL. |
forums |
list[Forum]
|
The forums in this category, fetched and cached lazily on first access. |
forums: list[Forum]
property
The forums in this category, fetching them on first access if not already loaded.
update(forums: Optional[list] = None)
Parse and (re)populate self.forums.
If forums (a list of forum
Comment
A single reply/post within a forum topic.
Attributes:
| Name | Type | Description |
|---|---|---|
user |
WebUser
|
The author of the comment. |
id |
int
|
The comment's unique content-comment id. |
content |
str
|
The comment's HTML content. |
Forum
A forum section, with lazily-paginated access to its topics and any sub-forums.
Attributes:
| Name | Type | Description |
|---|---|---|
session |
WebSession
|
The session used to fetch related resources. |
title |
str
|
The forum's title. |
url |
str
|
The forum's URL. |
description |
Optional[str]
|
The forum's description, if any. |
sub_forums |
list[Forum]
|
Any child forums nested under this one. |
pages |
ForumPagination
|
Lazily-loaded, paginated access to the forum's topics. |
ForumManager
Entry point for browsing the forum's categories.
Attributes:
| Name | Type | Description |
|---|---|---|
session |
WebSession
|
The session used to fetch related resources. |
categories |
list[Category]
|
The forum's top-level categories, fetched and cached lazily on first access. |
categories: list[Category]
property
The forum's top-level categories, fetching them on first access if not already loaded.
update()
Fetch the forum index page and (re)populate self.categories, each with its forums pre-loaded.
ForumPagination
Bases: BasePagination[Topic]
Lazily fetches and caches pages of topics for a forum.
Attributes:
| Name | Type | Description |
|---|---|---|
session |
WebSession
|
The session used to fetch pages. |
url |
str
|
The forum's base URL (inherited from BasePagination). |
pages |
dict[int, list[Topic]]
|
Cache of fetched pages, keyed by 0-indexed page number (inherited from BasePagination). |
__init__(session: WebSession, url: str)
Initialize pagination bound to a forum URL.
update(page: int = 1)
Fetch page (1-indexed) from the forum and store parsed topics as self.pages[page - 1].
Raises IndexError if page doesn't exist (the forum redirects back to its base URL).
Topic
A single forum topic/thread, with lazily-paginated access to its comments.
Attributes:
| Name | Type | Description |
|---|---|---|
session |
WebSession
|
The session used to fetch related resources. |
user |
WebUser
|
The user who started the topic. |
id |
int
|
The topic's unique id. |
url |
str
|
The topic's URL. |
title |
str
|
The topic's title. |
reply_count |
int
|
The number of replies in the topic. |
views |
int
|
The number of views the topic has received. |
max_page |
int
|
The total number of comment pages in the topic. |
pages |
TopicPagination
|
Lazily-loaded, paginated access to the topic's comments. |
TopicPagination
Bases: BasePagination[Comment]
Lazily fetches and caches pages of comments for a forum topic.
Attributes:
| Name | Type | Description |
|---|---|---|
session |
WebSession
|
The session used to fetch pages. |
max_page |
int
|
The total number of pages available for this topic. |
url |
str
|
The topic's base URL (inherited from BasePagination). |
pages |
dict[int, list[Comment]]
|
Cache of fetched pages, keyed by 0-indexed page number (inherited from BasePagination). |
__init__(session: WebSession, url: str, max_page: int)
Initialize pagination bound to a topic URL and its known max page count.
update(page: int = 1)
Fetch page (1-indexed) from the topic and store parsed comments as self.pages[page - 1].
Raises IndexError if page is at or beyond self.max_page.
WebUser
Represents an AirVPN member's public profile.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Display name of the user. |
id |
int
|
The user's ID. |
image |
str
|
URL of the user's profile image. |
profile_url |
str
|
Full URL to the user's profile page. |
content_count |
int | None
|
Number of content items (posts) the user has made. |
contacts |
Contacts | None
|
The user's contact information. |
followers |
int | None
|
Number of followers the user has. |
community_reputation |
int | None
|
The user's community reputation score. |
rank |
str | None
|
Display name of the user's rank, as shown in the profile header. |
joined |
datetime | None
|
Date and time the user joined. |
last_visited |
datetime | None
|
Date and time of the user's last visit. |
about |
About | None
|
The user's "About" information, including detailed rank data and birthday. |
gender |
str | None
|
The user's disclosed gender. |
location |
str | None
|
The user's disclosed location. |
interests |
str | None
|
The user's disclosed interests. |
about
property
About | None: The user's "About" information, including detailed rank data and birthday.
community_reputation
property
int | None: The user's community reputation score.
contacts
property
Contacts | None: The user's contact methods.
content_count
property
int | None: Number of content items (posts) the user has made.
followers
property
int | None: Number of followers the user has.
gender
property
str | None: The user's disclosed gender.
image
property
str: The user's profile picture.
interests
property
str | None: The user's disclosed interests.
joined
property
datetime | None: Date and time the user joined.
last_visited
property
datetime | None: Date and time of the user's last visit.
location
property
str | None: The user's disclosed location.
rank
property
str | None: Display name of the user's rank, as shown in the profile header.
follow() -> bool
Follow this member.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
unfollow() -> bool
Unfollow the user.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
update()
Force update attributes.