Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - TypeError: undefined is not a function | (user.videos) #1209

Open
Person-Account opened this issue Dec 21, 2024 · 2 comments
Open

[BUG] - TypeError: undefined is not a function | (user.videos) #1209

Person-Account opened this issue Dec 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Person-Account
Copy link

Bug:

Started getting this issue about a week ago and progressively it has gone worse. It cannot be replicated as it is random when and how the exception TypeError happens on sending the request and getting the resp action. Waiting intervals does not do anything or mouse movements. Does anyone have a solution please?

Things I tried:

  1. Updating to python 3.12
  2. Disabling stealth
  3. Adding a try except to resp
  4. Changing Client eg. webkit mozzilla
  5. Changing to the latest Playwright version webkit (It happend less)
  6. Rotation

Raises exception:

async for video in user.videos():

Full code:

from TikTokApi import TikTokApi
import asyncio
import os

ms_token = "my_token_pasted_in_manually"

async def user_example():
    async with TikTokApi() as api:
        await api.create_sessions(headless=True, ms_tokens=[ms_token], num_sessions=1, sleep_after=3)
        user = api.user("therock")
        vids = []
        async for video in user.videos():
            vids.append(video)
        # Do stuff...

if __name__ == "__main__":
    asyncio.run(user_example())

TypeError:

TypeError: undefined is not a function
    at b (https://lf16-tiktok-web.tiktokcdn-us.com/obj/tiktok-web-tx/webmssdk/2.0.0.295/webmssdk.js:1:46160)
    at Array.Ab (https://lf16-tiktok-web.tiktokcdn-us.com/obj/tiktok-web-tx/webmssdk/2.0.0.295/webmssdk.js:1:43974)
    at n (https://lf16-tiktok-web.tiktokcdn-us.com/obj/tiktok-web-tx/webmssdk/2.0.0.295/webmssdk.js:1:89436)
    at window.fetch (https://lf16-cdn-tos.tiktokcdn-us.com/obj/static-tx/secsdk/secsdk-lastest.umd.js:1036:38)
    at eval (eval at evaluate (:201:30), <anonymous>:3:21)
    at new Promise (<anonymous>)
    at eval (eval at evaluate (:201:30), <anonymous>:2:24)
    at UtilityScript.evaluate (<anonymous>:208:19)
    at UtilityScript.<anonymous> (<anonymous>:1:44)

Log:

name 'resp' is not defined
  • OS: Debian minimal distribution.
  • TikTokApi Version Latest Clone using the web URL.

Extra:

When I get the resp everyting works such as_dict etc

@Person-Account Person-Account added the bug Something isn't working label Dec 21, 2024
@madxion
Copy link

madxion commented Dec 22, 2024

had You tried it with python 3.10

@stirk1337
Copy link

Same random errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants