krypton-byte / tiktok-downloader

Tiktok Downloader/Scraper using requests & bs4
https://tiktok-dl.id
GNU General Public License v3.0
296 stars 82 forks source link

How can I get the best quality? #19

Closed sheldygg closed 1 year ago

sheldygg commented 2 years ago

Hi I am using code like this

from tiktok_downloader import snaptik

video_url = input('enter video url: ')

a = snaptik(video_url).get_media()[0].json
print(a)

And every time he randomly sends a link, with full HD quality or wors. How can I always get the best quality?

krypton-byte commented 2 years ago

x=sorted(snaptik(video_url).get_media(), key=lambda x:x.get_size()) hq = x[-1]

sheldygg commented 2 years ago

not work