davidteather / TikTok-Api

The Unofficial TikTok API Wrapper In Python
https://davidteather.github.io/TikTok-Api
MIT License
4.91k stars 984 forks source link

[BUG] - Multiple Chromium process are stacking up #147

Closed yash-pro closed 4 years ago

yash-pro commented 4 years ago

Describe the bug When downloading multiple videos multiple chrome/chromium process are stacking in the task manager.The ratio is almost 4-5 times the number of videos.

The buggy code

c=1 
f=open("links.txt","r") # links.txt contains the links of videos to be downloaded. 
lines=f.readlines()
for x in lines:      
    x=x.strip()
    tiktokData = api.get_Video_No_Watermark(str(x), return_bytes=1)               
    with open("%d.mp4"%c, 'wb') as out:
        out.write(tiktokData)
   c=c+1

Expected behavior Chrome process should automatically close upon each download completion. Screenshots

Screenshot from 2020-06-13 01-43-17

Desktop

Additional context

My use of this code is on windows, same issue persist there too.

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.99. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

davidteather commented 4 years ago

Thanks for the bug report! The code is just missing a line to close the browser on that specific method. I’ll issue a patch later today.

davidteather commented 4 years ago

Just released an update to fix this.

pip install TikTokApi --upgrade