[BUG] - After sending a api.clean_up() method, the script does not complete its work
See original GitHub issueAfter 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
- 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:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Checked Yes, if kwargs does not have a cert key, need to set this param to False )