TikTokPy: [BUG] Unable to do any kind of request
Describe the bug I am unable to do any kind of request. This error pops up: tiktokapipy.TikTokAPIError: Data scraping unable to complete in 30.0s (retries: 0)
To Reproduce Here is the code you can run:
from tiktokapipy.api import TikTokAPI
with TikTokAPI() as api:
video = api.video('https://www.tiktok.com/@ahormozi/video/7242371997324315946')
print(video)
Expected behavior
print out the scraped Video object
Version Information
pydantic==1.10.9
playwright==1.35.0
playwright==1.35.0
tiktokapipy==0.1.13.post1
Please include what versions of pydantic, playwright, and tiktokapipy you have installed (can be found with pip freeze).
Additional context Here is the full traceback:
Traceback (most recent call last):
File “C:\Users\path\venv\lib\site-packages\tiktokapipy\api.py”, line 430, in _scrape_data
data = self._extract_and_dump_data(content, extras_json, data_model)
File “C:\Users\path\venv\lib\site-packages\tiktokapipy\api.py”, line 469, in _extract_and_dump_data
parsed = data_model.parse_raw(data)
File “pydantic\main.py”, line 549, in pydantic.main.BaseModel.parse_raw
File “C:\Users\path\venv\lib\site-packages\tiktokapipy\models\raw_data.py”, line 130, in parse_obj
return super().parse_obj(obj)
File “pydantic\main.py”, line 526, in pydantic.main.BaseModel.parse_obj
File “pydantic\main.py”, line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for VideoResponse
VideoPage
field required (type=value_error.missing)
Traceback (most recent call last):
File “c:\Users\path\main.py”, line 11, in <module>
video = api.video(‘https://www.tiktok.com/@ahormozi/video/7242371997324315946’)
File “C:\Users\path\venv\lib\site-packages\tiktokapipy\api.py”, line 348, in video
response, api_extras = self._scrape_data(
File “C:\Users\path\venv\lib\site-packages\tiktokapipy\api.py”, line 445, in _scrape_data
raise TikTokAPIError(
tiktokapipy.TikTokAPIError: Data scraping unable to complete in 30.0s (retries: 0)
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 22 (11 by maintainers)
Commits related to this issue
- #47 - Login page redirection — committed to Russell-Newton/TikTokPy by Russell-Newton a year ago
- #47 - Block scripts from loading on user page Maybe helps prevent forced logins — committed to Russell-Newton/TikTokPy by Russell-Newton a year ago
@reddere it actually looks like tiktokapipy didn’t update properly because I didn’t set the versioning correctly in this branch. Try the install command from above again and make sure that tiktokapipy is set to version 0.2.0a1 afterwards