Video
- pydantic model Video[source]
Video model
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.
- Fields:
- field desc: str [Required]
- field diversification_labels: Optional[List[str]] = None
- field challenges: Optional[List[LightChallenge]] = None
- field video: VideoData [Required]
- field music: MusicData [Required]
- field digged: bool [Required]
- field item_comment_status: int [Required]
- field author: Union[LightUser, str] [Required]
- field image_post: Optional[ImagePost] = None
The images in the video if the video is a slideshow
- property comments: DeferredCommentIterator
- property tags: DeferredChallengeIterator
- property creator: DeferredUserGetterAsync | DeferredUserGetterSync
- property url: str
- download(**yt_dlp_params)[source]
Downloads this video, returning the relative filepath where it was stored. Requires yt-dlp installed (
pip install yt-dlp
orpip install tiktokapipy[download]
)- Parameters:
yt_dlp_params – additional parameters to pass to
yt_dlp.YoutubeDL()
. See The documentation for more details. By default, theformat_sort
field is set to["codec:h264"]
to ensure the downloaded video isn’t in the HEVC format.- Return type:
str
- field id: int [Required]
- field stats: VideoStats [Required]
- field create_time: datetime [Required]