-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5157017
commit 07529bb
Showing
7 changed files
with
1,030 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
""" | ||
This module contains the VideoQueries class for handling video-related API queries to the TikTok platform. | ||
""" | ||
|
||
from TikTok.ValidationModels import Video | ||
|
||
from TikTok.Queries.Common import QueryClass, RequestModel, ResponseModel | ||
|
||
|
||
class VideoQueries(QueryClass[RequestModel, ResponseModel]): | ||
""" | ||
A class to handle video-related API queries to the TikTok platform. | ||
This class inherits from QueryClass and provides methods to interact with the TikTok API | ||
for retrieving video information. | ||
""" | ||
|
||
async def search( | ||
self, | ||
request: Video.VideoQueryRequestModel, | ||
fields: list[Video.VideoQueryFields], | ||
) -> Video.VideoQueryResponseModel: | ||
""" | ||
Searches for videos based on the provided request parameters. | ||
Parameters: | ||
request (Video.VideoQueryRequestModel): The request parameters for the video search. | ||
fields (list[Video.VideoQueryFields]): A list of fields to include in the response. | ||
Returns: | ||
Video.VideoQueryResponseModel: The response model containing the video search results. | ||
""" | ||
return await self._fetch_data( | ||
url=self.query.endpoints.VideoSearchURL, | ||
request_model_class=Video.VideoQueryRequestModel, | ||
response_model_class=Video.VideoQueryResponseModel, | ||
params=self._build_params(fields), | ||
json_data=request.model_dump(by_alias=True, exclude_none=True), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.