From c68735df9791723df0331b7c3f5c6e67123537a5 Mon Sep 17 00:00:00 2001 From: SantaSpeen Date: Wed, 2 Apr 2025 17:46:28 +0300 Subject: [PATCH] [+] profile.objects.PROFILE [+] profile.objects.PROFILE_NICK_HISTORY --- anixart/__init__.py | 2 +- anixart/profile/__init__.py | 1 + anixart/profile/error_handler.py | 11 +++ anixart/profile/objects.py | 113 +++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 anixart/profile/__init__.py create mode 100644 anixart/profile/error_handler.py create mode 100644 anixart/profile/objects.py diff --git a/anixart/__init__.py b/anixart/__init__.py index 26a5e7b..b66c740 100644 --- a/anixart/__init__.py +++ b/anixart/__init__.py @@ -3,7 +3,7 @@ from .__meta__ import * from .api import AnixartAPI -from .auth import AnixartAccount, AnixartAccountToken, AnixartAccountSaved +from .auth import AnixartAccount, AnixartAccountGuest, AnixartAccountSaved from .endpoints import * diff --git a/anixart/profile/__init__.py b/anixart/profile/__init__.py new file mode 100644 index 0000000..83b1463 --- /dev/null +++ b/anixart/profile/__init__.py @@ -0,0 +1 @@ +from .objects import Profile, ProfileVote, ProfileRoles, ProfileHistory, ProfileFriendsPreview \ No newline at end of file diff --git a/anixart/profile/error_handler.py b/anixart/profile/error_handler.py new file mode 100644 index 0000000..3957d0f --- /dev/null +++ b/anixart/profile/error_handler.py @@ -0,0 +1,11 @@ +from enum import IntEnum + + +class AnixartProfileErrors(IntEnum): + """ Error codes for AnixartApi authentication.""" + PROFILE_NOT_FOUND = 2 + + +def errors_handler(error): + """Handle errors and return a JSON response.""" + pass diff --git a/anixart/profile/objects.py b/anixart/profile/objects.py new file mode 100644 index 0000000..6877a66 --- /dev/null +++ b/anixart/profile/objects.py @@ -0,0 +1,113 @@ +from dataclasses import dataclass + +@dataclass +class ProfileHistory: + # TODO: Надо ещё изучить релизы + pass + +@dataclass +class ProfileVote: + # TODO: Надо ещё изучить релизы + pass + +@dataclass +class ProfileRoles: + # TODO: Надо ещё изучить роли (У меня их нет(() + pass + +@dataclass +class ProfileFriendsPreview: + id: int + avatar: str + login: str + friend_count: int + friend_status: int + is_sponsor: bool + is_online: bool + is_verified: bool + is_social: bool + badge_id: None + badge_name: None + badge_type: None + badge_url: None + +@dataclass +class Profile: + id: int + login: str + avatar: str + status: str + rating_score: int + history: list[ProfileHistory] + votes: list[ProfileVote] + roles: list[ProfileRoles] + friends_preview: list[ProfileFriendsPreview] + collections_preview: list # TODO: Коллекции изучить + release_comments_preview: list # Тут вообще не понял + comments_preview: list # Тут типа превью к коментам + release_videos_preview: list # Тут вообще не понял + watch_dynamics: list # Тут вообще не понял + last_activity_time: int + register_date: int + vk_page: str + tg_page: str + inst_page: str + tt_page: str + discord_page: str + ban_expires: int + ban_reason: str + privilege_level: int + watching_count: int + plan_count: int + completed_count: int + hold_on_count: int + dropped_count: int + favorite_count: int + comment_count: int + collection_count: int + video_count: int + friend_count: int + subscription_count: int + watched_episode_count: int + watched_time: int + sponsorshipExpires: int + is_private: bool + is_sponsor: bool + is_banned: bool + is_perm_banned: bool + is_bookmarks_transferred: bool + is_sponsor_transferred: bool + is_vk_bound: bool + is_google_bound: bool + is_release_type_notifications_enabled: bool + is_episode_notifications_enabled: bool + is_first_episode_notification_enabled: bool + is_related_release_notifications_enabled: bool + is_report_process_notifications_enabled: bool + is_comment_notifications_enabled: bool + is_my_collection_comment_notifications_enabled: bool + is_my_article_comment_notifications_enabled: bool + is_verified: bool + is_blocked: bool + is_me_blocked: bool + is_stats_hidden: bool + is_counts_hidden: bool + is_social_hidden: bool + is_friend_requests_disallowed: bool + is_online: bool + badge: None + friend_status: None + + is_my_profile: bool = False + +class _login: + pos_id: int + id: int + newLogin: str + timestamp: int + +class ProfileLoginsHistory: + content: list[_login] + total_count: int + # total_page_count: int + # current_page: int \ No newline at end of file