Russell-Newton / TikTokPy

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

[BUG] ValidationError: 1 validation error for VideoPage #55

Closed stolenvw closed 1 year ago

stolenvw commented 1 year ago

not sure what causes it but i am seeing this alot

Failed: ValidationError: 1 validation error for VideoPage
itemInfo.itemStruct.music.playUrl
  Field required [type=missing, input_value={'authorName': '"removed"...itle': 'original sound'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.1.2/v/missing
Traceback (most recent call last):
  File "/home/user/TwitchBot/bot/modules/tiktok.py", line 27, in get_tiktoks
    async for video in user.videos:
  File "/home/user/.venv/lib/python3.10/site-packages/tiktokapipy/util/deferred_collectors.py", line 90, in __anext__
    await self._fetch_async()
  File "/home/user/.venv/lib/python3.10/site-packages/tiktokapipy/util/deferred_collectors.py", line 223, in _fetch_async
    self._collected_values.append(await self._api.video(video.id))
  File "/home/user/.venv/lib/python3.10/site-packages/tiktokapipy/async_api.py", line 163, in video
    response = VideoPage.model_validate(
  File "/home/user/.venv/lib/python3.10/site-packages/pydantic/main.py", line 480, in model_validate
    return cls.__pydantic_validator__.validate_python(
pydantic_core._pydantic_core.ValidationError: 1 validation error for VideoPage
itemInfo.itemStruct.music.playUrl
  Field required [type=missing, input_value={'authorName': '"removed"...itle': 'original sound'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.1.2/v/missing

"removed" after 'authorName': was me replacing the username with that the '...itle' is part of original output

Russell-Newton commented 1 year ago

This should be resolved in version 0.2.1.