Russell-Newton / TikTokPy

Extract data from TikTok without needing any login information or API keys.
https://pypi.org/project/tiktokapipy/
MIT License
192 stars 24 forks source link

Allow missing title in ImagePost model #65

Closed amadejkastelic closed 11 months ago

amadejkastelic commented 11 months ago

There are slideshow posts with no title in their image post, which causes the async_api.video() method to fail:

ERROR:root:Failed downloading https://vm.tiktok.com/ZGJbx5C88/: 1 validation error for VideoPage
itemInfo.itemStruct.imagePost.title
Field required [type=missing, input_value={'cover': {'imageHeight':...]}, 'imageWidth': 1080}}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.1/v/missing

This PR makes that field optional and defaults it to None.

Russell-Newton commented 11 months ago

Thanks for the contribution!