tikdataapi 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tikdataapi/__init__.py +8 -0
- tikdataapi/api/__init__.py +1 -0
- tikdataapi/api/account/__init__.py +1 -0
- tikdataapi/api/account/get_me.py +144 -0
- tikdataapi/api/billing/__init__.py +1 -0
- tikdataapi/api/billing/create_checkout.py +215 -0
- tikdataapi/api/billing/list_packs.py +144 -0
- tikdataapi/api/hashtags/__init__.py +1 -0
- tikdataapi/api/hashtags/get_hashtag.py +220 -0
- tikdataapi/api/hashtags/get_hashtag_videos.py +250 -0
- tikdataapi/api/music/__init__.py +1 -0
- tikdataapi/api/music/get_music.py +234 -0
- tikdataapi/api/music/get_music_videos.py +254 -0
- tikdataapi/api/playlists/__init__.py +1 -0
- tikdataapi/api/playlists/get_playlist_videos.py +258 -0
- tikdataapi/api/search/__init__.py +1 -0
- tikdataapi/api/search/search_hashtags.py +261 -0
- tikdataapi/api/search/search_live.py +258 -0
- tikdataapi/api/search/search_music.py +260 -0
- tikdataapi/api/search/search_users.py +276 -0
- tikdataapi/api/search/search_videos.py +260 -0
- tikdataapi/api/users/__init__.py +1 -0
- tikdataapi/api/users/get_user.py +222 -0
- tikdataapi/api/users/get_user_followers.py +266 -0
- tikdataapi/api/users/get_user_following.py +266 -0
- tikdataapi/api/users/get_user_live.py +236 -0
- tikdataapi/api/users/get_user_playlists.py +276 -0
- tikdataapi/api/users/get_user_reposts.py +266 -0
- tikdataapi/api/users/get_user_videos.py +254 -0
- tikdataapi/api/users/get_users.py +247 -0
- tikdataapi/api/users/get_users_videos.py +259 -0
- tikdataapi/api/videos/__init__.py +1 -0
- tikdataapi/api/videos/get_comment_replies.py +260 -0
- tikdataapi/api/videos/get_comments.py +258 -0
- tikdataapi/api/videos/get_related_videos.py +247 -0
- tikdataapi/api/videos/get_trending_videos.py +238 -0
- tikdataapi/api/videos/get_video.py +218 -0
- tikdataapi/api/videos/get_video_transcript.py +247 -0
- tikdataapi/api/videos/get_videos.py +235 -0
- tikdataapi/client.py +268 -0
- tikdataapi/errors.py +16 -0
- tikdataapi/models/__init__.py +117 -0
- tikdataapi/models/batch_error.py +104 -0
- tikdataapi/models/batch_error_code.py +15 -0
- tikdataapi/models/batch_meta.py +127 -0
- tikdataapi/models/batch_meta_cache.py +11 -0
- tikdataapi/models/comment.py +163 -0
- tikdataapi/models/comment_author.py +97 -0
- tikdataapi/models/comment_page.py +130 -0
- tikdataapi/models/create_checkout_body.py +63 -0
- tikdataapi/models/create_checkout_body_pack.py +11 -0
- tikdataapi/models/create_checkout_response_200.py +97 -0
- tikdataapi/models/error.py +78 -0
- tikdataapi/models/error_body.py +107 -0
- tikdataapi/models/error_body_code.py +22 -0
- tikdataapi/models/get_me_response_200.py +88 -0
- tikdataapi/models/get_users_body.py +61 -0
- tikdataapi/models/get_users_videos_body.py +72 -0
- tikdataapi/models/get_videos_body.py +61 -0
- tikdataapi/models/hashtag.py +124 -0
- tikdataapi/models/hashtag_response.py +122 -0
- tikdataapi/models/hashtag_summary.py +98 -0
- tikdataapi/models/hashtag_summary_page.py +130 -0
- tikdataapi/models/list_packs_response_200.py +103 -0
- tikdataapi/models/list_packs_response_200_data_item.py +88 -0
- tikdataapi/models/list_packs_response_200_rate_limits_item.py +70 -0
- tikdataapi/models/live_room.py +142 -0
- tikdataapi/models/live_room_author.py +90 -0
- tikdataapi/models/live_room_page.py +130 -0
- tikdataapi/models/live_room_response.py +124 -0
- tikdataapi/models/meta.py +108 -0
- tikdataapi/models/meta_cache.py +10 -0
- tikdataapi/models/music.py +107 -0
- tikdataapi/models/music_detail.py +172 -0
- tikdataapi/models/music_response.py +124 -0
- tikdataapi/models/music_summary.py +137 -0
- tikdataapi/models/music_summary_page.py +130 -0
- tikdataapi/models/not_found_reason.py +12 -0
- tikdataapi/models/playlist.py +114 -0
- tikdataapi/models/playlist_author.py +86 -0
- tikdataapi/models/playlist_page.py +130 -0
- tikdataapi/models/problem.py +131 -0
- tikdataapi/models/transcript.py +128 -0
- tikdataapi/models/transcript_response.py +124 -0
- tikdataapi/models/transcript_segment.py +77 -0
- tikdataapi/models/user.py +207 -0
- tikdataapi/models/user_batch.py +145 -0
- tikdataapi/models/user_page.py +130 -0
- tikdataapi/models/user_response.py +126 -0
- tikdataapi/models/user_summary.py +152 -0
- tikdataapi/models/user_summary_page.py +130 -0
- tikdataapi/models/user_videos.py +96 -0
- tikdataapi/models/user_videos_batch.py +145 -0
- tikdataapi/models/video.py +297 -0
- tikdataapi/models/video_batch.py +145 -0
- tikdataapi/models/video_page.py +130 -0
- tikdataapi/models/video_response.py +122 -0
- tikdataapi/models/video_type.py +9 -0
- tikdataapi/py.typed +1 -0
- tikdataapi/types.py +54 -0
- tikdataapi-0.1.0.dist-info/METADATA +148 -0
- tikdataapi-0.1.0.dist-info/RECORD +103 -0
- tikdataapi-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.error import Error
|
|
9
|
+
from ...models.get_users_body import GetUsersBody
|
|
10
|
+
from ...models.user_batch import UserBatch
|
|
11
|
+
from ...types import UNSET, Response, Unset
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: GetUsersBody,
|
|
17
|
+
fresh: bool | Unset = False,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
headers: dict[str, Any] = {}
|
|
20
|
+
|
|
21
|
+
params: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
params["fresh"] = fresh
|
|
24
|
+
|
|
25
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
26
|
+
|
|
27
|
+
_kwargs: dict[str, Any] = {
|
|
28
|
+
"method": "post",
|
|
29
|
+
"url": "/v1/users/batch",
|
|
30
|
+
"params": params,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_kwargs["json"] = body.to_dict()
|
|
34
|
+
|
|
35
|
+
headers["Content-Type"] = "application/json"
|
|
36
|
+
|
|
37
|
+
_kwargs["headers"] = headers
|
|
38
|
+
return _kwargs
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | UserBatch | None:
|
|
42
|
+
if response.status_code == 200:
|
|
43
|
+
response_200 = UserBatch.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_200
|
|
46
|
+
|
|
47
|
+
if response.status_code == 400:
|
|
48
|
+
response_400 = Error.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_400
|
|
51
|
+
|
|
52
|
+
if response.status_code == 401:
|
|
53
|
+
response_401 = Error.from_dict(response.json())
|
|
54
|
+
|
|
55
|
+
return response_401
|
|
56
|
+
|
|
57
|
+
if response.status_code == 402:
|
|
58
|
+
response_402 = Error.from_dict(response.json())
|
|
59
|
+
|
|
60
|
+
return response_402
|
|
61
|
+
|
|
62
|
+
if response.status_code == 429:
|
|
63
|
+
response_429 = Error.from_dict(response.json())
|
|
64
|
+
|
|
65
|
+
return response_429
|
|
66
|
+
|
|
67
|
+
if response.status_code == 500:
|
|
68
|
+
response_500 = Error.from_dict(response.json())
|
|
69
|
+
|
|
70
|
+
return response_500
|
|
71
|
+
|
|
72
|
+
if response.status_code == 503:
|
|
73
|
+
response_503 = Error.from_dict(response.json())
|
|
74
|
+
|
|
75
|
+
return response_503
|
|
76
|
+
|
|
77
|
+
if client.raise_on_unexpected_status:
|
|
78
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
79
|
+
else:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | UserBatch]:
|
|
84
|
+
return Response(
|
|
85
|
+
status_code=HTTPStatus(response.status_code),
|
|
86
|
+
content=response.content,
|
|
87
|
+
headers=response.headers,
|
|
88
|
+
parsed=_parse_response(client=client, response=response),
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def sync_detailed(
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient | Client,
|
|
95
|
+
body: GetUsersBody,
|
|
96
|
+
fresh: bool | Unset = False,
|
|
97
|
+
) -> Response[Error | UserBatch]:
|
|
98
|
+
"""Profiles by username, batch
|
|
99
|
+
|
|
100
|
+
Up to 100 profiles in one call, by username. 1 credit per profile found; inputs that do not exist
|
|
101
|
+
are
|
|
102
|
+
listed in `errors` and cost nothing. A banned account is a `not_found` with `reason: banned`, a
|
|
103
|
+
deleted
|
|
104
|
+
one with `reason: nonexistent`. Duplicates are folded, with no regard to case and to a leading `@`.
|
|
105
|
+
Results in input order.
|
|
106
|
+
Also `GET /v1/users/batch?usernames=tiktok,nba,espn`.
|
|
107
|
+
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
108
|
+
fetched.
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
fresh (bool | Unset): Default: False.
|
|
112
|
+
body (GetUsersBody):
|
|
113
|
+
|
|
114
|
+
Raises:
|
|
115
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
116
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
Response[Error | UserBatch]
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
kwargs = _get_kwargs(
|
|
123
|
+
body=body,
|
|
124
|
+
fresh=fresh,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
response = client.get_httpx_client().request(
|
|
128
|
+
**kwargs,
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
return _build_response(client=client, response=response)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def sync(
|
|
135
|
+
*,
|
|
136
|
+
client: AuthenticatedClient | Client,
|
|
137
|
+
body: GetUsersBody,
|
|
138
|
+
fresh: bool | Unset = False,
|
|
139
|
+
) -> Error | UserBatch | None:
|
|
140
|
+
"""Profiles by username, batch
|
|
141
|
+
|
|
142
|
+
Up to 100 profiles in one call, by username. 1 credit per profile found; inputs that do not exist
|
|
143
|
+
are
|
|
144
|
+
listed in `errors` and cost nothing. A banned account is a `not_found` with `reason: banned`, a
|
|
145
|
+
deleted
|
|
146
|
+
one with `reason: nonexistent`. Duplicates are folded, with no regard to case and to a leading `@`.
|
|
147
|
+
Results in input order.
|
|
148
|
+
Also `GET /v1/users/batch?usernames=tiktok,nba,espn`.
|
|
149
|
+
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
150
|
+
fetched.
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
fresh (bool | Unset): Default: False.
|
|
154
|
+
body (GetUsersBody):
|
|
155
|
+
|
|
156
|
+
Raises:
|
|
157
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
158
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
159
|
+
|
|
160
|
+
Returns:
|
|
161
|
+
Error | UserBatch
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
return sync_detailed(
|
|
165
|
+
client=client,
|
|
166
|
+
body=body,
|
|
167
|
+
fresh=fresh,
|
|
168
|
+
).parsed
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
async def asyncio_detailed(
|
|
172
|
+
*,
|
|
173
|
+
client: AuthenticatedClient | Client,
|
|
174
|
+
body: GetUsersBody,
|
|
175
|
+
fresh: bool | Unset = False,
|
|
176
|
+
) -> Response[Error | UserBatch]:
|
|
177
|
+
"""Profiles by username, batch
|
|
178
|
+
|
|
179
|
+
Up to 100 profiles in one call, by username. 1 credit per profile found; inputs that do not exist
|
|
180
|
+
are
|
|
181
|
+
listed in `errors` and cost nothing. A banned account is a `not_found` with `reason: banned`, a
|
|
182
|
+
deleted
|
|
183
|
+
one with `reason: nonexistent`. Duplicates are folded, with no regard to case and to a leading `@`.
|
|
184
|
+
Results in input order.
|
|
185
|
+
Also `GET /v1/users/batch?usernames=tiktok,nba,espn`.
|
|
186
|
+
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
187
|
+
fetched.
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
fresh (bool | Unset): Default: False.
|
|
191
|
+
body (GetUsersBody):
|
|
192
|
+
|
|
193
|
+
Raises:
|
|
194
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
195
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
196
|
+
|
|
197
|
+
Returns:
|
|
198
|
+
Response[Error | UserBatch]
|
|
199
|
+
"""
|
|
200
|
+
|
|
201
|
+
kwargs = _get_kwargs(
|
|
202
|
+
body=body,
|
|
203
|
+
fresh=fresh,
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
207
|
+
|
|
208
|
+
return _build_response(client=client, response=response)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
async def asyncio(
|
|
212
|
+
*,
|
|
213
|
+
client: AuthenticatedClient | Client,
|
|
214
|
+
body: GetUsersBody,
|
|
215
|
+
fresh: bool | Unset = False,
|
|
216
|
+
) -> Error | UserBatch | None:
|
|
217
|
+
"""Profiles by username, batch
|
|
218
|
+
|
|
219
|
+
Up to 100 profiles in one call, by username. 1 credit per profile found; inputs that do not exist
|
|
220
|
+
are
|
|
221
|
+
listed in `errors` and cost nothing. A banned account is a `not_found` with `reason: banned`, a
|
|
222
|
+
deleted
|
|
223
|
+
one with `reason: nonexistent`. Duplicates are folded, with no regard to case and to a leading `@`.
|
|
224
|
+
Results in input order.
|
|
225
|
+
Also `GET /v1/users/batch?usernames=tiktok,nba,espn`.
|
|
226
|
+
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
227
|
+
fetched.
|
|
228
|
+
|
|
229
|
+
Args:
|
|
230
|
+
fresh (bool | Unset): Default: False.
|
|
231
|
+
body (GetUsersBody):
|
|
232
|
+
|
|
233
|
+
Raises:
|
|
234
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
235
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
236
|
+
|
|
237
|
+
Returns:
|
|
238
|
+
Error | UserBatch
|
|
239
|
+
"""
|
|
240
|
+
|
|
241
|
+
return (
|
|
242
|
+
await asyncio_detailed(
|
|
243
|
+
client=client,
|
|
244
|
+
body=body,
|
|
245
|
+
fresh=fresh,
|
|
246
|
+
)
|
|
247
|
+
).parsed
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.error import Error
|
|
9
|
+
from ...models.get_users_videos_body import GetUsersVideosBody
|
|
10
|
+
from ...models.user_videos_batch import UserVideosBatch
|
|
11
|
+
from ...types import UNSET, Response, Unset
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: GetUsersVideosBody,
|
|
17
|
+
fresh: bool | Unset = False,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
headers: dict[str, Any] = {}
|
|
20
|
+
|
|
21
|
+
params: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
params["fresh"] = fresh
|
|
24
|
+
|
|
25
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
26
|
+
|
|
27
|
+
_kwargs: dict[str, Any] = {
|
|
28
|
+
"method": "post",
|
|
29
|
+
"url": "/v1/users/videos/batch",
|
|
30
|
+
"params": params,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_kwargs["json"] = body.to_dict()
|
|
34
|
+
|
|
35
|
+
headers["Content-Type"] = "application/json"
|
|
36
|
+
|
|
37
|
+
_kwargs["headers"] = headers
|
|
38
|
+
return _kwargs
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _parse_response(
|
|
42
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
43
|
+
) -> Error | UserVideosBatch | None:
|
|
44
|
+
if response.status_code == 200:
|
|
45
|
+
response_200 = UserVideosBatch.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
return response_200
|
|
48
|
+
|
|
49
|
+
if response.status_code == 400:
|
|
50
|
+
response_400 = Error.from_dict(response.json())
|
|
51
|
+
|
|
52
|
+
return response_400
|
|
53
|
+
|
|
54
|
+
if response.status_code == 401:
|
|
55
|
+
response_401 = Error.from_dict(response.json())
|
|
56
|
+
|
|
57
|
+
return response_401
|
|
58
|
+
|
|
59
|
+
if response.status_code == 402:
|
|
60
|
+
response_402 = Error.from_dict(response.json())
|
|
61
|
+
|
|
62
|
+
return response_402
|
|
63
|
+
|
|
64
|
+
if response.status_code == 429:
|
|
65
|
+
response_429 = Error.from_dict(response.json())
|
|
66
|
+
|
|
67
|
+
return response_429
|
|
68
|
+
|
|
69
|
+
if response.status_code == 500:
|
|
70
|
+
response_500 = Error.from_dict(response.json())
|
|
71
|
+
|
|
72
|
+
return response_500
|
|
73
|
+
|
|
74
|
+
if response.status_code == 503:
|
|
75
|
+
response_503 = Error.from_dict(response.json())
|
|
76
|
+
|
|
77
|
+
return response_503
|
|
78
|
+
|
|
79
|
+
if client.raise_on_unexpected_status:
|
|
80
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
81
|
+
else:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _build_response(
|
|
86
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
87
|
+
) -> Response[Error | UserVideosBatch]:
|
|
88
|
+
return Response(
|
|
89
|
+
status_code=HTTPStatus(response.status_code),
|
|
90
|
+
content=response.content,
|
|
91
|
+
headers=response.headers,
|
|
92
|
+
parsed=_parse_response(client=client, response=response),
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def sync_detailed(
|
|
97
|
+
*,
|
|
98
|
+
client: AuthenticatedClient | Client,
|
|
99
|
+
body: GetUsersVideosBody,
|
|
100
|
+
fresh: bool | Unset = False,
|
|
101
|
+
) -> Response[Error | UserVideosBatch]:
|
|
102
|
+
"""Latest videos of many accounts, batch
|
|
103
|
+
|
|
104
|
+
The newest videos of up to 20 accounts in one call, by username or sec_uid: `count` videos for each
|
|
105
|
+
account (1 to 16, default 3). Pinned videos first, then newest first, as on
|
|
106
|
+
`/v1/users/{user}/videos`.
|
|
107
|
+
1 credit per video returned. An account with no public videos, or a private one, is an entry with an
|
|
108
|
+
empty `videos` list and costs nothing. An account that could not be read is in `errors` and costs
|
|
109
|
+
nothing. Duplicates are folded. Results in input order.
|
|
110
|
+
The `next_cursor` of an entry continues that list on `/v1/users/{user}/videos`.
|
|
111
|
+
Also `GET /v1/users/videos/batch?users=tiktok,nba&count=3`.
|
|
112
|
+
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
113
|
+
fetched.
|
|
114
|
+
The limit counts `count` videos for each account.
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
fresh (bool | Unset): Default: False.
|
|
118
|
+
body (GetUsersVideosBody):
|
|
119
|
+
|
|
120
|
+
Raises:
|
|
121
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
122
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
Response[Error | UserVideosBatch]
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
kwargs = _get_kwargs(
|
|
129
|
+
body=body,
|
|
130
|
+
fresh=fresh,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
response = client.get_httpx_client().request(
|
|
134
|
+
**kwargs,
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
return _build_response(client=client, response=response)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def sync(
|
|
141
|
+
*,
|
|
142
|
+
client: AuthenticatedClient | Client,
|
|
143
|
+
body: GetUsersVideosBody,
|
|
144
|
+
fresh: bool | Unset = False,
|
|
145
|
+
) -> Error | UserVideosBatch | None:
|
|
146
|
+
"""Latest videos of many accounts, batch
|
|
147
|
+
|
|
148
|
+
The newest videos of up to 20 accounts in one call, by username or sec_uid: `count` videos for each
|
|
149
|
+
account (1 to 16, default 3). Pinned videos first, then newest first, as on
|
|
150
|
+
`/v1/users/{user}/videos`.
|
|
151
|
+
1 credit per video returned. An account with no public videos, or a private one, is an entry with an
|
|
152
|
+
empty `videos` list and costs nothing. An account that could not be read is in `errors` and costs
|
|
153
|
+
nothing. Duplicates are folded. Results in input order.
|
|
154
|
+
The `next_cursor` of an entry continues that list on `/v1/users/{user}/videos`.
|
|
155
|
+
Also `GET /v1/users/videos/batch?users=tiktok,nba&count=3`.
|
|
156
|
+
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
157
|
+
fetched.
|
|
158
|
+
The limit counts `count` videos for each account.
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
fresh (bool | Unset): Default: False.
|
|
162
|
+
body (GetUsersVideosBody):
|
|
163
|
+
|
|
164
|
+
Raises:
|
|
165
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
166
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
167
|
+
|
|
168
|
+
Returns:
|
|
169
|
+
Error | UserVideosBatch
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
return sync_detailed(
|
|
173
|
+
client=client,
|
|
174
|
+
body=body,
|
|
175
|
+
fresh=fresh,
|
|
176
|
+
).parsed
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
async def asyncio_detailed(
|
|
180
|
+
*,
|
|
181
|
+
client: AuthenticatedClient | Client,
|
|
182
|
+
body: GetUsersVideosBody,
|
|
183
|
+
fresh: bool | Unset = False,
|
|
184
|
+
) -> Response[Error | UserVideosBatch]:
|
|
185
|
+
"""Latest videos of many accounts, batch
|
|
186
|
+
|
|
187
|
+
The newest videos of up to 20 accounts in one call, by username or sec_uid: `count` videos for each
|
|
188
|
+
account (1 to 16, default 3). Pinned videos first, then newest first, as on
|
|
189
|
+
`/v1/users/{user}/videos`.
|
|
190
|
+
1 credit per video returned. An account with no public videos, or a private one, is an entry with an
|
|
191
|
+
empty `videos` list and costs nothing. An account that could not be read is in `errors` and costs
|
|
192
|
+
nothing. Duplicates are folded. Results in input order.
|
|
193
|
+
The `next_cursor` of an entry continues that list on `/v1/users/{user}/videos`.
|
|
194
|
+
Also `GET /v1/users/videos/batch?users=tiktok,nba&count=3`.
|
|
195
|
+
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
196
|
+
fetched.
|
|
197
|
+
The limit counts `count` videos for each account.
|
|
198
|
+
|
|
199
|
+
Args:
|
|
200
|
+
fresh (bool | Unset): Default: False.
|
|
201
|
+
body (GetUsersVideosBody):
|
|
202
|
+
|
|
203
|
+
Raises:
|
|
204
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
205
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
206
|
+
|
|
207
|
+
Returns:
|
|
208
|
+
Response[Error | UserVideosBatch]
|
|
209
|
+
"""
|
|
210
|
+
|
|
211
|
+
kwargs = _get_kwargs(
|
|
212
|
+
body=body,
|
|
213
|
+
fresh=fresh,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
217
|
+
|
|
218
|
+
return _build_response(client=client, response=response)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
async def asyncio(
|
|
222
|
+
*,
|
|
223
|
+
client: AuthenticatedClient | Client,
|
|
224
|
+
body: GetUsersVideosBody,
|
|
225
|
+
fresh: bool | Unset = False,
|
|
226
|
+
) -> Error | UserVideosBatch | None:
|
|
227
|
+
"""Latest videos of many accounts, batch
|
|
228
|
+
|
|
229
|
+
The newest videos of up to 20 accounts in one call, by username or sec_uid: `count` videos for each
|
|
230
|
+
account (1 to 16, default 3). Pinned videos first, then newest first, as on
|
|
231
|
+
`/v1/users/{user}/videos`.
|
|
232
|
+
1 credit per video returned. An account with no public videos, or a private one, is an entry with an
|
|
233
|
+
empty `videos` list and costs nothing. An account that could not be read is in `errors` and costs
|
|
234
|
+
nothing. Duplicates are folded. Results in input order.
|
|
235
|
+
The `next_cursor` of an entry continues that list on `/v1/users/{user}/videos`.
|
|
236
|
+
Also `GET /v1/users/videos/batch?users=tiktok,nba&count=3`.
|
|
237
|
+
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
238
|
+
fetched.
|
|
239
|
+
The limit counts `count` videos for each account.
|
|
240
|
+
|
|
241
|
+
Args:
|
|
242
|
+
fresh (bool | Unset): Default: False.
|
|
243
|
+
body (GetUsersVideosBody):
|
|
244
|
+
|
|
245
|
+
Raises:
|
|
246
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
247
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
248
|
+
|
|
249
|
+
Returns:
|
|
250
|
+
Error | UserVideosBatch
|
|
251
|
+
"""
|
|
252
|
+
|
|
253
|
+
return (
|
|
254
|
+
await asyncio_detailed(
|
|
255
|
+
client=client,
|
|
256
|
+
body=body,
|
|
257
|
+
fresh=fresh,
|
|
258
|
+
)
|
|
259
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|