F
F
Fonker2022-03-11 17:27:01
YouTube
Fonker, 2022-03-11 17:27:01

Need to extract from this res. How to implement it?

stream = yt.streams.filter(only_video = True).order_by("resolution").last()

Stream: itag="315" mime_type="video/webm" res="2160p" fps="60fps" vcodec="vp9" progressive="False" type="video">

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kadabrov, 2022-03-11
@Kadabrov

For example, you can split the string by spaces, then display the desired parameter
; there are regular expressions, the re module, you can write a template to search for the desired parameter in the string

V
Vindicar, 2022-03-11
@Vindicar

This is omitted from the documentation, but if you look at the source , then instances of the Stream class have a resolution property.

A
AVKor, 2022-03-12
@AVKor

yt.streams.filter(only_video = True).order_by("resolution").last().resolution

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question