H5 API 定义
Qzone API 端点定义。
此模块中的每个类定义一个 Qzone H5 API 端点 — 其 URL、HTTP 方法、请求参数类型和响应类型。QzoneApi 基类提供通用基础设施;具体子类连接特定端点。
-
class aioqzone.model.api.QzoneApi(**data)
下方所有 Qzone API 的基类。
-
host: ClassVar[str] = 'https://h5.qzone.qq.com'
-
http_method: ClassVar[Literal['GET', 'POST']]
-
path: ClassVar[str]
-
keep_alive: ClassVar[bool] = True
-
is_json: ClassVar[bool] = False
-
referer: str
-
attach_token: ClassVar[bool] = True
-
login_required: ClassVar[bool] = True
-
params: TyRequest
-
response: ClassVar[Type[TyResponse]]
-
property url: URL
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.IndexPageApi(**data)
H5 Qzone 首页 API。GET /mqzone/index。返回包含 qzonetoken 的 IndexPageResp。
-
response
IndexPageResp 的别名
-
http_method: ClassVar[Literal['GET', 'POST']] = 'GET'
-
path: ClassVar[str] = '/mqzone/index'
-
keep_alive: ClassVar[bool] = False
-
attach_token: ClassVar[bool] = False
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.UserProfileApi(**data)
用户个人资料页面 API。GET /mqzone/profile。返回 ProfilePagePesp。
-
response
ProfilePagePesp 的别名
-
http_method: ClassVar[Literal['GET', 'POST']] = 'GET'
-
path: ClassVar[str] = '/mqzone/profile'
-
keep_alive: ClassVar[bool] = False
-
attach_token: ClassVar[bool] = False
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.FeedPageApi(**data)
活跃 feed 分页 API。GET /mqzone_feeds/getActiveFeeds。返回 FeedPageResp。
-
response
FeedPageResp 的别名
-
http_method: ClassVar[Literal['GET', 'POST']] = 'GET'
-
path: ClassVar[str] = '/webapp/json/mqzone_feeds/getActiveFeeds'
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.ShuoshuoApi(**data)
Feed 详情(说说)API。GET /mqzone_detail/shuoshuo。返回 DetailResp。
-
response
DetailResp 的别名
-
http_method: ClassVar[Literal['GET', 'POST']] = 'GET'
-
path: ClassVar[str] = '/webapp/json/mqzone_detail/shuoshuo'
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.GetFeedsApi(**data)
用户 feed 分页 API。GET /get_feeds。返回 ProfileResp。
-
response
ProfileResp 的别名
-
http_method: ClassVar[Literal['GET', 'POST']] = 'GET'
-
host: ClassVar[str] = 'https://mobile.qzone.qq.com'
-
path: ClassVar[str] = '/get_feeds'
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.GetCountApi(**data)
新 feed 数/保活 API。GET /feeds/mfeeds_get_count。返回 FeedCount。
-
response
FeedCount 的别名
-
params: GetCountParams
-
http_method: ClassVar[Literal['GET', 'POST']] = 'GET'
-
host: ClassVar[str] = 'https://mobile.qzone.qq.com'
-
path: ClassVar[str] = '/feeds/mfeeds_get_count'
-
is_json: ClassVar[bool] = True
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.LikeApi(**data)
点赞 feed。POST /cgi-bin/likes/internal_dolike_app。返回 SingleReturnResp。
-
response
SingleReturnResp 的别名
-
http_method: ClassVar[Literal['GET', 'POST']] = 'POST'
-
path: ClassVar[str] = '/proxy/domain/w.qzone.qq.com/cgi-bin/likes/internal_dolike_app'
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.UnlikeApi(**data)
取消点赞 feed。POST /cgi-bin/likes/internal_unlike_app。继承 LikeApi。
-
path: ClassVar[str] = '/proxy/domain/w.qzone.qq.com/cgi-bin/likes/internal_unlike_app'
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
添加评论(JSON API)。POST /qzoneOperation/addComment。返回 AddCommentResp。
AddCommentResp 的别名
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.ListFriendApi(**data)
列出好友(预留,尚未接入)。GET /friend/mfriend_list。
-
http_method: ClassVar[Literal['GET', 'POST']] = 'GET'
-
host: ClassVar[str] = 'https://mobile.qzone.qq.com'
-
path: ClassVar[str] = '/friend/mfriend_list'
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.PublishMoodApi(**data)
发表说说。POST /mood/publish_mood。返回 PublishMoodResp。
-
response
PublishMoodResp 的别名
-
http_method: ClassVar[Literal['GET', 'POST']] = 'POST'
-
host: ClassVar[str] = 'https://mobile.qzone.qq.com'
-
path: ClassVar[str] = '/mood/publish_mood'
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.AddOperationApi(**data)
通用操作 API。POST /operation/operation_add。
-
response: Type[QzoneResponse]
-
http_method: ClassVar[Literal['GET', 'POST']] = 'POST'
-
host: ClassVar[str] = 'https://mobile.qzone.qq.com'
-
path: ClassVar[str] = 'operation/operation_add'
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.UploadPicApi(**data)
上传图片。POST /cgi-bin/upload/cgi_upload_pic_v2。返回 UploadPicResponse。
-
response
UploadPicResponse 的别名
-
http_method: ClassVar[Literal['GET', 'POST']] = 'POST'
-
host: ClassVar[str] = 'https://mobile.qzone.qq.com'
-
path: ClassVar[str] = '/up/cgi-bin/upload/cgi_upload_pic_v2'
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.PhotosPreuploadApi(**data)
发布前预上传照片。POST /cgi-bin/upload/cgi_upload_pic_v2。返回 PhotosPreuploadResponse。
-
response
PhotosPreuploadResponse 的别名
-
http_method: ClassVar[Literal['GET', 'POST']] = 'POST'
-
host: ClassVar[str] = 'https://mobile.qzone.qq.com'
-
path: ClassVar[str] = '/up/cgi-bin/upload/cgi_upload_pic_v2'
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
参数
Qzone API 请求参数模型。
定义 QzoneRequestParams 及其每个 API 端点的子类。每个子类携带该端点特有的字段,并提供 build_params() 用于序列化。
-
class aioqzone.model.api.request.QzoneRequestParams(**data)
-
uin_fields: ClassVar[Tuple[str, ...]] = ()
-
ts_fields: ClassVar[Tuple[str, ...]] = ()
-
build_params(uin, timestamp=None)
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.ActiveFeedsParams(**data)
-
attach_info: str
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.AvatarParams(**data)
-
hostuin: int
-
size: Literal[100, 640]
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.GetFeedsParams(**data)
-
hostuin: int
-
attach_info: str
-
res_type: int
-
refresh_type: int
-
format: str
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.ProfileParams(**data)
-
hostuin: int
-
start_time: float
-
ts_fields: ClassVar[Tuple[str, ...]] = ('starttime',)
-
ms(start_time)
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.ShuoshuoParams(**data)
-
fid: str
-
uin: int
-
appid: int
-
busi_param: str
-
format: str
-
count: int
-
refresh_type: int
-
subid: str
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.GetCountParams(**data)
-
format: str
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.DolikeParam(**data)
-
uin_fields: ClassVar[Tuple[str, ...]] = ('opuin',)
-
unikey: str
-
curkey: str
-
appid: int
-
opr_type: str
-
format: str
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.PublishMoodParams(**data)
-
uin_fields: ClassVar[Tuple[str, ...]] = ('res_uin',)
-
content: str
-
photos: List[PhotoData]
-
sync_weibo: int
-
ugc_right: UgcRight
-
opr_type: str
-
format: str
-
richval(photos)
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.DeleteUgcParams(**data)
-
uin_fields: ClassVar[Tuple[str, ...]] = ('res_uin',)
-
appid: int
-
fid: str
-
opr_type: str
-
real_del: int
-
format: str
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.UploadPicParams(**data)
-
uin_fields: ClassVar[Tuple[str, ...]] = ('uin',)
-
picture: bytes
-
hd_height: int
-
hd_width: int
-
hd_quality: int
-
base64: int
-
output_type: str
-
preupload: int
-
charset: str
-
output_charset: str
-
logintype: str
-
Exif_CameraMaker: str
-
Exif_CameraModel: str
-
Exif_Time: str
-
b64_picture(picture)
- 返回类型:
str
-
classmethod from_image(image_file, quality=70)
-
classmethod from_bytes(image_bytes, quality=70)
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.PhotosPreuploadParams(**data)
-
uin_fields: ClassVar[Tuple[str, ...]] = ('uin',)
-
upload_pics: List[UploadPicResponse]
-
cur_num: int
-
upload_hd: int
-
preupload: int
-
output_type: str
-
uploadtype: int
-
albumtype: int
-
big_style: int
-
op_src: int
-
charset: str
-
output_charset: str
-
refer: str
-
property uploadNum
-
build_params(uin, timestamp=None)
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.UgcRight(*values)
-
unknown = 0
-
all = 1
-
qq = 4
-
part = 16
-
self = 64
-
blacklist = 128
-
class aioqzone.model.api.request.PhotoData(**data)
-
albumid: str
-
lloc: str
-
sloc: str
-
type: str
-
height: int
-
width: int
-
origin_uuid: str
-
origin_height: int
-
origin_width: int
-
to_richval()
-
classmethod from_PicInfo(o)
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.request.SetTopParams(**data)
-
fid: str
-
set_top: bool
-
need_change: int
-
serialize_set_top(set_top)
- 返回类型:
str
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
响应
Qzone API 响应模型。
定义 QzoneResponse 基类及其每个 API 端点的子类。包含 from_response_object() 和 response_to_object() 工厂方法用于 HTTP 响应解析。
-
class aioqzone.model.api.response.QzoneResponse(**data)
-
classmethod from_response_object(obj)
解析从 Qzone API 接收的响应文本或对象。
- 参数:
obj (Dict[str, Any]) -- 解析后的响应对象,参见 .response_to_object
- 抛出:
aioqzone.exception.QzoneError -- 如果返回结果码 != 0
- 返回类型:
Self
- 返回:
Self
-
async classmethod response_to_object(response)
- 返回类型:
Dict[str, Any]
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
表示获取 feed 页面操作的响应。用于验证 aioqzone.api.h5.QzoneH5API.index() 和 aioqzone.api.h5.QzoneH5API.getActivateFeeds() 中的响应数据。
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.response.ProfileResp(**data)
-
vFeeds: List[ProfileFeedData]
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 返回类型:
Dict[str, Any]
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.response.ProfilePagePesp(**data)
-
info: QzoneInfo
-
feedpage: ProfileResp
-
qzonetoken: str
-
async classmethod response_to_object(response)
- 返回类型:
Dict[str, Any]
-
classmethod from_response_object(obj)
解析从 Qzone API 接收的响应文本或对象。
- 参数:
obj (Dict[str, Any]) -- 解析后的响应对象,参见 .response_to_object
- 抛出:
aioqzone.exception.QzoneError -- 如果返回结果码 != 0
- 返回类型:
Self
- 返回:
Self
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.response.DetailResp(**data)
-
hasmore: bool
-
attach_info: str
-
classmethod remove_prefix(v)
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.response.FeedCount(**data)
-
active_cnt: int
-
passive_cnt: int
-
gamebar_cnt: int
-
gift_cnt: int
-
visitor_cnt: int
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.response.SingleReturnResp(**data)
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
model_post_init(context, /)
此函数旨在模拟 BaseModel 方法来初始化私有属性。
它接受 context 作为参数,因为 pydantic-core 调用时会传递该参数。
- 返回类型:
None
- 参数:
self: BaseModel 实例。context: 上下文。
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
此函数旨在模拟 BaseModel 方法来初始化私有属性。
它接受 context 作为参数,因为 pydantic-core 调用时会传递该参数。
- 返回类型:
None
- 参数:
self: BaseModel 实例。context: 上下文。
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.response.PublishMoodResp(**data)
-
ret: int
-
msg: str
-
fid: str
-
undeal_info: FeedCount
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.response.DeleteUgcResp(**data)
-
ret: int
-
msg: str
-
undeal_info: FeedCount
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.response.UploadPicResponse(**data)
-
filelen: int
-
filemd5: str
-
async classmethod response_to_object(response)
- 返回类型:
Dict[str, Any]
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
model_post_init(context, /)
此函数旨在模拟 BaseModel 方法来初始化私有属性。
它接受 context 作为参数,因为 pydantic-core 调用时会传递该参数。
- 返回类型:
None
- 参数:
self: BaseModel 实例。context: 上下文。
-
class aioqzone.model.api.response.PhotosPreuploadResponse(**data)
-
photos: List[PicInfo]
-
async classmethod response_to_object(response)
- 返回类型:
Dict[str, Any]
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
model_post_init(context, /)
此函数旨在模拟 BaseModel 方法来初始化私有属性。
它接受 context 作为参数,因为 pydantic-core 调用时会传递该参数。
- 返回类型:
None
- 参数:
self: BaseModel 实例。context: 上下文。
-
class aioqzone.model.api.response.FeedData(**data)
-
like: LikeInfo
-
original: FeedOriginal | Share | None
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
operation: FeedOperation
-
visitor: Visitor
-
class aioqzone.model.api.response.PicInfo(**data)
-
pre: HttpUrl
-
url: HttpUrl
-
sloc: str
小图 id
-
lloc: str
大图 id
-
width: int
-
height: int
-
albumid: str
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
model_post_init(context, /)
此函数旨在模拟 BaseModel 方法来初始化私有属性。
它接受 context 作为参数,因为 pydantic-core 调用时会传递该参数。
- 返回类型:
None
- 参数:
self: BaseModel 实例。context: 上下文。
-
class aioqzone.model.api.response.ProfileFeedData(**data)
-
like: ProfileLikeInfo
-
original: ProfileFeedOriginal | Share | None
-
operation: FeedOperation
-
visitor: Visitor
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
class aioqzone.model.api.response.AvatarResponse(**data)
-
model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
model_post_init(context, /)
此函数旨在模拟 BaseModel 方法来初始化私有属性。
它接受 context 作为参数,因为 pydantic-core 调用时会传递该参数。
- 返回类型:
None
- 参数:
self: BaseModel 实例。context: 上下文。
-
avatar: bytes
-
async classmethod response_to_object(response)
- 返回类型:
Dict[str, Any]