dfreelon / pyktok

A simple module to collect video, text, and metadata from Tiktok.
BSD 3-Clause "New" or "Revised" License
316 stars 44 forks source link

Update get_comments() #58

Closed maxcohen55 closed 1 month ago

maxcohen55 commented 1 month ago

In the get_comments() function's call to api.create_sessions(), I changed 'headless' to 'headless=headless'. This solved an error when using the save_tiktok_comments(): TypeError: TikTokApi.create_sessions() got multiple values for argument 'num_sessions' which then causes: AttributeError: 'TikTokApi' object has no attribute 'browser'.

By specifying 'headless=headless', it allows TikTokApi object to fall back on the default 'num_sessions' value instead of trying to use the 'headless' value.