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

V5.1.0 - Memory Improvement, Jupyter Support (on Linux), Hierarchical Exceptions, #860

Merged
merged 12 commits into from
Mar 20, 2022

Conversation

davidteather
Copy link
Owner

@davidteather davidteather commented Mar 20, 2022

New Suggested Usage

with TikTokApi() as api:
    pass

Although old way of TikTokApi() works as well.

Exceptions

  • Now all derived from TikTokException
  • Some naming changes

Jupyter Support

Improved Models

  • Throws an error if a sound has been removed
  • Video has a create_time & stats attribute (should probably add stats field to other models)

Current Problems

  • Hashtag.videos
  • Trending.videos
  • User.videos
  • All seem to be related to X-Bogus might be the new required thing.

pytest output

tests\test_hashtag.py F..
tests\test_integration.py F
tests\test_search.py ..
tests\test_sound.py ..
tests\test_trending.py F
tests\test_user.py .F.
tests\test_video.py ...

davidteather and others added 12 commits March 7, 2022 21:21
* Add Video().create_time and Video().stats
* Exception reorganization & renaming

Co-authored-by: Popesites <conner@popesites.tech>
Playwright is not threadsafe. (see https://playwright.dev/python/docs/intro#threading)

By creating the Playwright instance as a global variable,
it introduces a mess of conflicts with Playwright and its backend loop

This change ensures that the playwright instance created is thread-local, and exposes a `shutdown()` method to safely clean up the TikTokAPI instance.

The API instance can now be used as a context manager, guaranteeing safe cleanup of the instance.

```py
with TikTokApi() as api:
    for trending_video in api.trending.videos():
        # do something
```

Includes other maintenance items that should be self explanitory.

Signed-off-by: Montel Edwards <m@monteledwards.com>

Co-authored-by: David Teather <34144122+davidteather@users.noreply.github.com>
Also added @Popesites as co-author since PR wasn't picking them up despite #853

Co-Authored-By: ctalt <conner@popesites.tech>
@davidteather davidteather merged commit ca35f0f into master Mar 20, 2022
@davidteather davidteather deleted the v5.1.0 branch March 20, 2022 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants