Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: seu230 en 21 Julio 2022, 00:06 am



Título: bajar videos con youtube-dl todo a calidad 360p o inferior?
Publicado por: seu230 en 21 Julio 2022, 00:06 am
Hola estuve viendo la documentacion de yt-dlp(muy similar a youtube-dl) y no veo la forma de descargar un .txt con links de youtube todo a 360p o a una calidad inferior

Es decir, tengo un archivo .txt dentro del cual estan las urls de cientos de videos que quiero decargar pero quisiera los videos se descarguen a 360p como maximo, no quiero videos en fhd o 4k

Con 360p o una calidad algo inferior en caso no este disponible el 360p me basta

Esta es la documentacion:
https://github.com/yt-dlp/yt-dlp


Título: Re: bajar videos con youtube-dl todo a calidad 360p o inferior?
Publicado por: Machacador en 21 Julio 2022, 04:41 am
Con IDM o JDownloader lo haces...

 :rolleyes: :o :rolleyes:


Título: Re: bajar videos con youtube-dl todo a calidad 360p o inferior?
Publicado por: el-brujo en 21 Julio 2022, 14:00 pm
yo también uso yt-dlp ya que youtube-dl iba muy, muy lento.

Le puedes pasar a parte del parámetro del listado en fichero txt de los vídeos para bajar el formato de calidad, o sólo audio.

Aunque no se que harás con un video a 360px, se ven borrosos xD

Citar
The default format selector is bv*+ba/b. This means that if a combined video + audio format that is better than the best video-only format is found, the former will be preferred. Use -f bv+ba/b or --compat-options format-spec to revert this


Citar
w*, worst*: Select the worst quality format that contains either a video or an audio
w, worst: Select the worst quality format that contains both video and audio. Equivalent to worst*[vcodec!=none][acodec!=none]
wv, worstvideo: Select the worst quality video-only format. Equivalent to worst*[acodec=none]
wv*, worstvideo*: Select the worst quality format that contains video. It may also contain audio. Equivalent to worst*[vcodec!=none]
wa, worstaudio: Select the worst quality audio-only format. Equivalent to worst*[vcodec=none]
wa*, worstaudio*: Select the worst quality format that contains audio. It may also contain video. Equivalent to worst*[acodec!=none]

Citar
For example, to download the worst quality video-only format you can use -f worstvideo. It is however recommended not to use worst and related options. When your format selector is worst, the format which is worst in all respects is selected. Most of the time, what you actually want is the video with the smallest filesize instead. So it is generally better to use -S +size or more rigorously, -S +size,+br,+res,+fps instead of -f worst. See sorting formats for more details.

You can select the n'th best format of a type by using best<type>.<n>. For example, best.2 will select the 2nd best combined format. Similarly, bv*.3 will select the 3rd best format that contains a video stream.

If you want to download multiple videos and they don't have the same formats available, you can specify the order of preference using slashes. Note that formats on the left hand side are preferred, for example -f 22/17/18 will download format 22 if it's available, otherwise it will download format 17 if it's available, otherwise it will download format 18 if it's available, otherwise it will complain that no suitable formats are available for download.

If you want to download several formats of the same video use a comma as a separator, e.g. -f 22,17,18 will download all these three formats, of course if they are available.

Sólo tienes que combinar el listado:

Código:
-a, --batch-file FILE 

con -f

Código:
# The following examples show the old method (without -S) of format selection
# and how to use -S to achieve a similar but (generally) better result

# Download the worst video available (old method)
$ yt-dlp -f "wv*+wa/w"

# Download the best video available but with the smallest resolution
$ yt-dlp -S "+res"

# Download the smallest video available
$ yt-dlp -S "+size,+br"

Más ejemplos:
https://github.com/yt-dlp/yt-dlp#format-selection-examples

Descargar vídeos con Youtube-dl: con interfaz gráfica también para Windows y Linux
https://blog.elhacker.net/2022/01/descargar-videos-con-youtube-dl-vimeo-twitter-audio-mp3.html


Título: Re: bajar videos con youtube-dl todo a calidad 360p o inferior?
Publicado por: EdePC en 21 Julio 2022, 14:30 pm
Yo también recomiendo jDowloader, mucho más sencillo y visual, al menos para la tarea que describes:

(https://i.ibb.co/jJcHm4f/jdownloader-ytb.png)

---
En caso de youtube-dl sería algo así:

youtube-dl -a lista.txt -f "best[height<=360]"

En yt-dlp su equivalente debería ser:

yt-dlp -a lista.txt -S "height:360"

---
Siempre uso youtube-dl aún, no noto descargas lentas, al menos en conexiones de hasta 30Mbps, tendría que probar en conexiones más rápidas. Por otro lado youtube-dl no se actualiza desde diciembre del año pasado, quizá vaya siendo hora de migrar a yt-dlp que está muy activo XD

---
EDITO:

Ahora que estoy probando el youtube-dl anda muy pero muy lento está a 60KBps x_x, el yt-dlp está descarga a la velocidad de 250KBps, esto en una conexión lenta de apenas 400KBps. Otra cosa que vi es que yt-dlp -a lista.txt -S está funcionando raro, parece que no descarga lo mejor que encuentra, a mi parecer es mejor utilizar:

yt-dlp -a lista.txt -f "b[height<=360]"


Título: Re: bajar videos con youtube-dl todo a calidad 360p o inferior?
Publicado por: seu230 en 7 Agosto 2022, 05:06 am
Gracias por sus respuestas pues efectivamente tenia que usar el comando <=360 descargo videos musicales para mi rockola asi que me la calidad 3660p es mas que suficiente. saludos