Skip to content

Commit

Permalink
Merge pull request #444 from davidteather/nightly
Browse files Browse the repository at this point in the history
V3.8.8
  • Loading branch information
davidteather authored Dec 24, 2020
2 parents d15fa62 + 2a8b456 commit 0d9fa3c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ test.txt
tests/__pycache__/*
*.pyc
acrawl.js
test2.py
test2.py
build
17 changes: 13 additions & 4 deletions TikTokApi/tiktok.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,13 @@ def bySound(self, id, count=30, offset=0, **kwargs) -> dict:

res = self.getData(url=api_url, **kwargs)

for t in res.get("itemList", []):
response.append(t)

try:
for t in res["items"]:
response.append(t)
except KeyError:
for t in res['itemList']:
response.append(t)

if not res["hasMore"]:
logging.info("TikTok isn't sending more TikToks beyond this point.")
Expand Down Expand Up @@ -849,8 +854,12 @@ def byHashtag(self, hashtag, count=30, offset=0, **kwargs) -> dict:
)
res = self.getData(url=api_url, **kwargs)

for t in res["itemList"]:
response.append(t)
try:
for t in res["items"]:
response.append(t)
except KeyError:
for t in res["itemList"]:
response.append(t)

if not res["hasMore"]:
logging.info("TikTok isn't sending more TikToks beyond this point.")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
setuptools.setup(
name="TikTokApi",
packages=["TikTokApi"],
version="3.8.7",
version="3.8.8",
license="MIT",
description="The Unofficial TikTok API Wrapper in Python 3.",
author="David Teather",
Expand Down

0 comments on commit 0d9fa3c

Please sign in to comment.