avilash / TikTokAPI-Python

TikTok API Python Wrapper
http://avilashkumar.com/TikTokAPI-Python/
MIT License
443 stars 114 forks source link

adding offset to getVideosByHashTag count #26

Open DanilKonon opened 3 years ago

DanilKonon commented 3 years ago

The problem is I would like to download 100 videos by some hashtag. But I can only download about 35 in one function call. But if I call the function again I will get the same 35 tiktoks. How can I get next 35 (or more) tiktoks?

from TikTokAPI import TikTokAPI
import os

cookie = {
  "s_v_web_id": "",
  "tt_webid": ""
}

api = TikTokAPI(cookie=cookie)
# count = 20 works, but count = 100 doesn't work! 
retval = api.getVideosByHashTag("funny", count=20)

directory = "funny_hashtag"
if not os.path.isdir(directory):
  os.mkdir(directory)
print(retval)

for tiktok in retval['itemList']:
  video_data = api.downloadVideoById(str(tiktok['id']), f"{directory}/{tiktok['id']}.mp4")
Samuel-Rotbart commented 3 years ago

is there an update on this? I'm trying to do the same thing for the getVideosByUserName api as well! Thanks for this work it is really awesome!

mardecode commented 3 years ago

is there an update ? I have the same problem. At the final of the JSON I get this information'cursor': '35', 'hasMore': True but if I try with 36 it doesn't work and I get this {'statusCode': 10201, 'statusMsg': ''} I could move the cursor ? how can I do that ...

ItsToastmeal commented 2 years ago

I also have the same issue

liuhui244671426 commented 1 year ago

I also have the same issue