Youtube Video Examples

Published: 2019-08-04, Updated: 2020-05-13

Baixar playlist do youtube como mp3

youtube-dl -x --audio-format mp3 --playlist-start 1 --playlist-end 5 https://www.youtube.com/playlist?list=PLYxwBa53UZmRX7zFajlmYqydPFtOJu8YN

Baixar video e a legenda

youtube-dl --write-srt --sub-lang en 'http://www.youtube.com/watch?v=RHy9_RQbrnQ'

Exemplo de como baixar

youtube-dl -f mp4 --merge-output-format mp4 `cat link-2017-08-06.txt`

Como instalar

sudo curl -L https://github.com/ytdl-org/youtube-dl/releases/download/2019.06.21/youtube-dl -o /usr/local/bin/youtube-dl &&\
sudo chmod a+rx /usr/local/bin/youtube-dl

Listar todos os videos da pagina

// create the box
if(!getBox()){
  setupBox();
}

// get the links 
var videos = document.querySelectorAll(".channels-content-item .spf-link a.yt-uix-sessionlink");
var videoLinks = [];
var buff = "";
videos.forEach(v => {
    videoLinks.push(v.href);
    buff += v.href + "\n";
});

// set the links at box
getBox().innerHTML = buff;

// function to create a box and set it to HTML dom
function setupBox() {
    var mgCss = `.mg-text-area {
      background: red;
      color: white;
      position: fixed;
      top: 0;
      z-index: 99999;
      border: 2px solid #000;
      width: 300px;
      height: 200px;
    }`;
    var newEl = '<style>'+mgCss+'</style>' + '<textarea class="mg-text-area" placeholder="Put your text"></textarea>';
    var div = document.createElement('div');
    div.innerHTML = newEl;
    document.body.append(div);
}

function getBox(){
    return document.querySelector('.mg-text-area');
}

~~Deprecated~~

instalar o ffmpeg

$ sudo add-apt-repository ppa:mc3man/trusty-media
$ sudo apt-get update
$ sudo apt-get install ffmpeg gstreamer0.10-ffmpeg 

Queimar vĂ­deo com a lengeda

ffmpeg -i input.mp4 -c:v libx264 -vf subtitles=legenda.srt out.mp4

youtube commands, youtube download video, youtube-dl


Configurando o registry do docker sem certificado Arquivos/Permissoes Commands

Comments