Forum › Forums › General › Tips and Tricks › Simple YouTube download script
- This topic has 24 replies, 7 voices, and was last updated Mar 17-11:23 am by marcelocripe.
-
AuthorPosts
-
March 7, 2023 at 4:57 pm #101378Member
RJP
At first install or update yt-dlp and optionallt you can make a config file for avaiding webm videos.
The script:
Edit: some reason platform shown script wrong, so I did not use codes.
Edit 2: The script is in the zip-file
- This topic was modified 1 month, 3 weeks ago by RJP.
- This topic was modified 1 month, 3 weeks ago by RJP.
- This topic was modified 1 month, 3 weeks ago by RJP.
March 7, 2023 at 4:58 pm #101383March 7, 2023 at 5:15 pm #101394MemberXunzi_23
::Hi RJP
Simpler, you can use ytfzf to search for yt content, and have it download with ytdlp
or of course play. Big Advantage playlists and no need to know any content adress.fzf the fuzzy search tool does the finding.
March 7, 2023 at 5:16 pm #101395MemberRJP
::To disable webm videos via config file.
mkdir -p $HOME/.config/yt-dlp… and the config file
nano $HOME/.config/yt-dlp/config… which contenst is
--ignore-errors # --no-playlist # Save in ~/Videos -o ~/Videos/%(title)s.%(ext)s ### jos suomeksi niin laita Videot Videosin tilalle ####-o ~/Videot/%(title)s.%(ext)s # Prefer 1080p or lower resolutions -f bestvideo[ext=mp4][width<1280][height<=720]+bestaudio[ext=m4a]/bestvideo[width<1280][height<=720]+bestaudio/best[width<1280][height<=720]/best… save and quit
Ctrl o
Ctrl xMarch 7, 2023 at 5:31 pm #101399MemberRJP
::Hi RJP
Simpler, you can use ytfzf to search for yt content, and have it download with ytdlp
or of course play. Big Advantage playlists and no need to know any content adress.fzf the fuzzy search tool does the finding.
ytfzf is not working.
- This reply was modified 1 month, 3 weeks ago by RJP.
Attachments:
March 7, 2023 at 5:35 pm #101402MemberXunzi_23
::Sorry, Saw that problem on a friends computer yesterday, hope fix will be as easy for you
as it was here.
ta
Please dosudo apt install --reinstall ytfzf and same for fzffind a video with ytfzf, have the mark next to the one wished for
tap alt-d (download_shortcut) the selected video will be downloaded.
Very powerful scripts as a quick glance in man ytfzf will show.
- This reply was modified 1 month, 3 weeks ago by Xunzi_23.
- This reply was modified 1 month, 3 weeks ago by Xunzi_23.
- This reply was modified 1 month, 3 weeks ago by Xunzi_23.
March 7, 2023 at 5:48 pm #101408MemberRJP
March 7, 2023 at 6:58 pm #101412MemberPPC
March 7, 2023 at 7:33 pm #101418MemberXunzi_23
::Hopefully useful to some
.bash_aliases in my setup alias yt='ytfzf --pages=3' alias ytt='ytfzf -t --pages=2' alias yto='ytfzf -cO pages=2'March 7, 2023 at 11:38 pm #101426Memberstevesr0
::Hi RJP,
I am making an Impress file and need to insert YouTube videos. They have been downloaded as .webm format and seem to work (although the CPU usage and frequency shoots up in Impress when running the embedded version; I think that is a problem with the Impress Media Player).
Question: What do you mean when you wrote
To disable webm videos via config file.Are you transcoding them or filtering them out or…?
I am interested because I may want to try a different format that Impress might tolerate better.
Thanks in advance.
stevesr0
March 8, 2023 at 1:23 am #101429MemberRobin
::This is because of the high cpu load these webm files commonly produce. On weak machines they can cause desktop freeze due to the vp8/vp9/av1 video codec this container format only allowes. For these video formats mostly no hardware acceleration exists by now, so everything has to be processed and rendered by the cpu. Not the best idea… See https://en.wikipedia.org/wiki/VP9#Hardware_implementations for which CPUs and GPUs support it already. Single advantage of these video format is they are said to be free formats, but this doesn’t help people not being able to play them distortion free on their devices.
You can filter them using yt-dlp -F <‘url’> and then yt-dlp -f <‘format’> <‘url’> or yt-dlp -f <‘videoformat+audioformat’> <‘url’> while downloading, the latter is meant for video only and audio only formats from the ID column, the video format has to be the first one. You can transcode them also, but this means quality loss and bigger file size in most cases. You can also avoid these resource hungry formats automatically by using yt-dlp -f ‘[vcodec!=vp9][vcodec!=vp8][vcodec!=av1]’ <‘url’> for the download.
Windows is like a submarine. Open a window and serious problems will start.
March 8, 2023 at 2:07 pm #101468MemberXunzi_23
::RJP was second user in two days with ytfzf fail issue. Missing fzf but the error shown to users does not
help much.@ anticapitalista I just checked a package list for antiX 22 ytfzf is included but the tool it depends on fzf
fuzzy search application is missing.Could it please be included in an update to antiX versions which ship with ytfzf.
March 8, 2023 at 2:31 pm #101472MemberRJP
::RJP was second user in two days with ytfzf fail issue. Missing fzf but the error shown to users does not
help much.@ anticapitalista I just checked a package list for antiX 22 ytfzf is included but the tool it depends on fzf
fuzzy search application is missing.Could it please be included in an update to antiX versions which ship with ytfzf.
Package ueberzug is also needed with ytfzf. 😉
sudo apt install ytfzf fzf ueberzugMarch 8, 2023 at 2:54 pm #101483MemberRobin
::just checked a package list … antiX 22
@anticapitalista : just checked on antiX 23: Here also fzf is missing (should be a dependency of ytfzf package probably)
Package ueberzug was installed, but it might have been drawn in by some other package I installed earlier, so I’m not sure about the latter.Many thanks Xunzi23 and PPC, this ytfzf tool is a great recommendation. Didn’t know this tool before.
Windows is like a submarine. Open a window and serious problems will start.
March 8, 2023 at 4:42 pm #101501Member
marcelocripe
::Hello RJP.
Thank you very much for your program to download videos from YouTube.
I tried to apply the translation resources in your “YOUTUBE_DOWNLOADER”, but all the texts that are inside “TUBE=`yad” do not enter the “.pot” file that serves as a model for later generating the “.po” files and “.mo” containing the translations.
In case, is there another way to write this part of the program?
Apparently, everything inside the single quote “`” cannot be read by the command that generates the “.pot” file. Since I don’t understand the Bash programming language, I can’t make big changes.
Would it be possible to put the texts that are displayed in the dialog boxes in variables?
Normally, when the texts that are displayed in dialog boxes (window title and window body texts) are placed in variables, the translation procedure tends to be easier to implement.
Thank you very much!
Note: Following my original Brazilian Portuguese text is a proposed .desktop file. Please, if you are a native English speaker, review or correct the texts in English.
– – – – –
Olá RJP.
Muito obrigado pelo seu programa para baixar vídeos do YouTube.
Eu tentei aplicar os recursos de tradução no seu “YOUTUBE_DOWNLOADER”, mas todos os textos que estão dentro de “TUBE=`yad” não entram no arquivo “.pot” que serve de modelo para depois ser gerado os arquivos “.po” e “.mo” contendo as traduções.
Por caso, existe um outro modo de escrever esta parte do programa?
Ao que parece, tudo que está dentro da aspas simples “`” não consegue ser lido pelo comando que gera o arquivo “.pot”. Como eu não compreendo a linguagem de programação Bash, eu não consigo fazer grandes alterações.
Seria possível colocar os textos que são exibidos nas caixas de diálogos em variáveis?
Normalmente quando os textos que são exibidos nas caixas de diálogos (textos do título da janela e do corpo da janela) são colocadas em variáveis o procedimento de tradução costuma ficar mais fácil de ser implementando.
Muito obrigado!
Observação: Após o meu texto original em Português do Brasil está um proposta para o arquivo .desktop. Por favor, quem for nativo do Inglês, revise ou corrija os textos em Inglês.
– – – – –
[Desktop Entry] Categories=AudioVideo;Audio;Player; Encoding=UTF-8 # If the script is stored in the /opt/youtube_downloader/ folder with the program file name in capital letters #Exec=/opt/youtube_downloader/YOUTUBE_DOWNLOADER #or # If the script is stored in the /opt/youtube_downloader/ folder with the program file name in lower case #Exec=/opt/youtube_downloader/youtube_downloader #or # If the script is stored in the /usr/local/bin folder with the program filename in lower case #Exec=youtube_downloader Icon=youtube Terminal=false Type=Application Name=Youtube Videos Downloader Name[pt]=Transferir Vídeos do YouTube Name[pt_BR]=Baixar Vídeos do YouTube Comment=Download youtube video via GUI Comment[pt]=Transferir vídeos do YouTube em um interface gráfico, copiar o URL do YouTube, colar no programa e clique no botão Transferir Comment[pt_BR]=Baixar vídeos do YouTube em uma interface gráfica, copie o URL do YouTube, cole no programa e clique no botão Baixar -
AuthorPosts
- You must be logged in to reply to this topic.






