```
url = message.text
file = YouTube(url)
stream = file.streams.get_by_resolution(360)
stream.download(filename='qwe.mp4')

```

I know only two possible ways to download stream. I can get it by itag or by resolution(here its 360). But there is a problem, because sometimes the video I want to download do not have 360, maximum 240 or 120.

My question is: how can I download a file in its maximum available resolution, but not higher than 1080. Is it possible?

If its not, can i download the video by its first existing itag?