I am currently working on creating a Discord Bot using the Discord.py library. One of the tasks the bot has is to use other APIs to check for the latest Youtube Video, TikTok, etc. For parsing through the Tiktok content I am using the TikTokApi. I have a scheduled task in my discord bot client that is going to run every 5 minutes:
def check_toks():
es_link = tktok.Tktok_catcher("ES")
en_link = tktok.Tktok_catcher("US")
print(es_link, en_link)
@tasks.loop(minutes=5)
async def check_platforms():
es_link = tktok.Tktok_catcher("ES")
Running the following code gives me the following error:
playwright._impl._api_types.Error: It looks like you are using Playwright Sync API inside the asyncio loop.
Please use the Async API instead.
Is there a workaround for this problem (a way to run the playwright sync API inside the Asyncio loop) or is there something I need to change in the library that I am using to get it to work?