question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] - After sending a api.clean_up() method, the script does not complete its work

See original GitHub issue

After sending a clean_up() method, the script does not complete its work.

import time
from collections import defaultdict
from random import uniform

from TikTokApi import TikTokApi


def tiktok_processing(users: list) -> dict:
    api = TikTokApi.get_instance()

    params = defaultdict(dict)
    for username in users:
        try:
            user = api.getUser(username)
            params[username].update(
                follower_count=user['userInfo']['stats']['followerCount'],
                verified=user['userInfo']['user']['verified']
            )
        except IndexError:
            print(f"Data does not received: {username}")

        except Exception as ex:
            print(f"Unknown exception: {ex}")

        time.sleep(uniform(5.0, 10.0))

    api.clean_up()
    # time.sleep(3)
    # api._TikTokApi__instance = None
    # time.sleep(3)

    return params    # this line of code is most often unreachable for a reason unknown to me


if __name__ == "__main__":
    users = [...]
    result = tiktok_processing(users)

The MS-Playwright remains a running process. I want to note that sometimes in debug mode the script terminates its work correctly in the 1-2 seconds. I cannot see the pattern of this behavior. What would you advise to do?

  • OS: Ubuntu 18.04 LTS image
  • TikTokApi Version 3.7.9 Note: version 3.8.1 does not suit me - after upgrading to the latest version, I receive only a captcha, despite the fact that I send request with a custom_verifyFp, taken from a chrome browser (at least, I have not found another way to get a valid value of this parameter). So I had to roll back to the last working version. I should note that the error made in the title of this post is also observed in version 3.8.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
issue-label-bot[bot]commented, Nov 29, 2020

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.99. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

0reactions
studio-salamandercommented, Dec 3, 2020

verify=kwargs.get(“cert”, True)

Checked Yes, if kwargs does not have a cert key, need to set this param to False )

Read more comments on GitHub >

github_iconTop Results From Across the Web

React useEffect causing: Can't perform a React state update ...
For me, clean the state in the unmount of the component helped. const [state, setState] = useState({}); useEffect(() => { myFunction(); ...
Read more >
Bug listing with status RESOLVED with resolution FIXED as at ...
Bug :2 - "How do I attach an ebuild. ... Bug:132 - "esound does not work here when compiled with alsa support" status:RESOLVED...
Read more >
React useEffect cleanup: How and when to use it
Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application....
Read more >
Service | Android Developers
startService() then the system will retrieve the service (creating it and calling its onCreate() method if needed) and then call its onStartCommand(Intent, ...
Read more >
How To Call Web APIs with the useEffect Hook in React
On many agile teams, front-end and API teams work on a problem in ... -p option so it won't conflict with the create-react-app...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found