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 8, 2023 at 4:56 pm #101503Member
PPC
::Would it be possible to put the texts that are displayed in the dialog boxes in variables?
You are getting “spoiled” by me, my friend.
Personal opinion, that you did not ask for, marcelo:
you are wasting too much energy trying to create .desktop files and localizations for almost every single script users make available here in the forum. Most are just small scripting efforts, even if they can be very handy. If you find a script handy for you or your users, my advice would be to localize the text directly in the script and make it available in your personal repository at archive.org, github, etc… You can even package your version of the localized script, with it’s own .desktop file. When everyone has a GUI way to install .deb files, it will be trivial to download that package and install it. If you do that, I also advise to rename the script and the resulting .deb file (ex: adding -pt_br at the end of the file).P.
March 8, 2023 at 6:29 pm #101513MemberRobin
::Apparently, everything inside the single quote “`” cannot be read by the command that generates the “.pot” file.
Yes. This is a good finger exercise you can improve your skills in preparing scripts for translation with, Marcelo.
Please remember the meaning of the different quotings. Here it’s about the backtick quote, which is one valid form of bash “command substitution”. (see man bash, around line 1203ff) Everything what you can put in between the two backticks is treated as a command to be executed on runtime by bash, and you can as well put into round braces preceded by a dollar sign, which has exactly the same meaning. To catch possible blanks add a set of double qoutes around it “$(…)”. By this modification you have actually nothing changed in the functionality of the script, but now you easily can mark the strings inside for translation.Windows is like a submarine. Open a window and serious problems will start.
March 8, 2023 at 6:33 pm #101515MemberRJP
::@marcelocripe
Não sei fazer arquivos pot, mas fiz uma versão em português do downloader usando o google translate.
Attachments:
March 8, 2023 at 9:08 pm #101521MemberXunzi_23
::RJP wrote Package ueberzug is also needed with ytfzf
It is the optional extra needed by those who wish for thumbnail viewing.
using the option -t, –show-thumbnails not a hard dependency.For anyone interested/impatient a new version of ytfzf was released on 01.03.2023
now 2.5.5
I did not feel like waiting wait so installed git then followed instructions from
https://github.com/pystardust/ytfzfI had to remove the old download directory from home as this was not the first time
proceedure had been done.
Then:git clone https://github.com/pystardust/ytfzf cd ytfzf sudo make install doc followed by sudo make addonsAddons as I wish to explore them further.
I did need to reinstall fzf but probably everything would have worked as expected after a
logout/login or possibly reboot.- This reply was modified 1 month, 3 weeks ago by Xunzi_23.
March 9, 2023 at 8:33 am #101531MemberXunzi_23
::CAUTION ! On several tests below broke sound after updating ytdlp. as yet not found out why.
Seems Better to wait for updated antiX packages or stick to tried and tested..Just to make this more complete, I checked ytdlp and fzf for updates. Ytdlp was very recently updated,
a lot of improvement seems to be waiting for users so I updated. Please read release notes onhttps://github.com/yt-dlp/yt-dlp/releases/tag/2023.03.04
Posted some time ago: The releases can be updated using yt-dlp -U, and downgraded using –update-to if
requiredSo used sudo ytdlp -U, updated smoothly. CAUTION: Lost sound on one test after update !.
I also checked over at fzf page and as ffmpeg and ytdlp are not always a happy pair at
https://github.com/yt-dlp/FFmpeg-Builds
The special build may not be needed in most cases, I am using a testing stick and the weather outside is not
inviting so will take a look.As running live no persistence I can just reboot to get back to old state so risk is a couple of minutes time lost :-).
One of the reasons antiX is my distro of choice.fzf and debian build numbers are not enlightening, visiting https://github.com/junegunn/fzf shows fzf was updated on
Feb 15 2023 which makes it definitely newer than the repo version. Updated for good measure.
git clone –depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/installUsers please see the post as for info, my antiX 23 testing with Kernel 6.1 and Nvidia Graphics is running as expected
and letting me explore new features and options.No Risk no Fun, No Warranty :-).
- 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 9, 2023 at 1:49 pm #101560MemberLead Farmer
::@RJP I test your script and it worked ok.
I would remove the window “ADDRESS IS: $TUBE” is not necessarily, and I would add select resolution.
https://askubuntu.com/questions/486297/how-to-select-video-quality-from-youtube-dl
- This reply was modified 1 month, 3 weeks ago by Lead Farmer.
March 9, 2023 at 1:54 pm #101562Member
marcelocripe
::You are getting “spoiled” by me, my friend.
Not PPC, it’s not “pampering” or “laziness”. It’s just my lack of knowledge, that’s all. If I knew how to do it, I would have done it already! I tried to do it, but I couldn’t.
Personal opinion, that you did not ask for, marcelo:
you are wasting too much energy trying to create .desktop files and localizations for almost every single script users make available here in the forum. Most are just small scripting efforts, even if they can be very handy. If you find a script handy for you or your users, my advice would be to localize the text directly in the script and make it available in your personal repository at archive.org, github, etc… You can even package your version of the localized script, with it’s own .desktop file. When everyone has a GUI way to install .deb files, it will be trivial to download that package and install it. If you do that, I also advise to rename the script and the resulting .deb file (ex: adding -pt_br at the end of the file).Translating the texts directly into programming code is exactly what I don’t want to do. I’ve done this a lot with several excellent programs that were created by the antiX community, I share them for a group of people that I consider to be small, eventually these people know my archive.org or GitLab pages. The excellent program that RJP created and the other excellent program (watch YouTube videos by dragging the URL) that you created can be distributed with the translations, that is, if people are interested in translating the programs, but it needs to be done with the correct method of translating the programs and that’s what I intended here. Since I don’t know how to program in Bash, I help with what little knowledge I have, whether it’s helping to create the .desktop files or trying to implement the translation features. Because I support the initiative of people who share their programming codes with the antiX community.
Yes. This is a good finger exercise you can improve your skills in preparing scripts for translation with, Marcelo.
Please remember the meaning of the different quotings. Here it’s about the backtick quote, which is one valid form of bash “command substitution”. (see man bash, around line 1203ff) Everything what you can put in between the two backticks is treated as a command to be executed on runtime by bash, and you can as well put into round braces preceded by a dollar sign, which has exactly the same meaning. To catch possible blanks add a set of double qoutes around it “$(…)”. By this modification you have actually nothing changed in the functionality of the script, but now you easily can mark the strings inside for translation.Robin, thank you very much for your explanation. With this class, I think I will be able to implement the translation features. If I can’t do it, I’ll let you know. Thank you very much!
Não sei fazer arquivos pot, mas fiz uma versão em português do downloader usando o google translate.
RJP, you were very kind to do this for me. Thank you very much!
But, we need to do it correctly as taught by Xecure in this topic Internationalisation of antiX community scripts created by Robin.As you know programming, this information can be very useful for you and if I can help you I will.
After implementing the necessary modifications in the “YOUTUBE_DOWNLOADER” file, the command below can be applied to generate the “.pot” file. This “.pot” file has to contain all the texts that are displayed in your English language program from your “YOUTUBE_DOWNLOADER” script. From the “.pot” file we can create “.po” files for all other languages, including the en_US, en_GB, etc. variants.
bash –dump-po-strings YOUTUBE_DOWNLOADER | xgettext -L PO -o locale/YOUTUBE_DOWNLOADER.pot –
And if there is interest, your program can be packaged to .deb, but we need to get the translations first.
Thank you very much!
– – – – –
You are getting “spoiled” by me, my friend.
Não PPC, não é “mimo” ou “preguiça”. É apenas falta de conhecimento meu, apenas isso. Se eu soubesse fazer, eu já teria feito! Eu tentei fazer, mas não consegui.
Personal opinion, that you did not ask for, marcelo:
you are wasting too much energy trying to create .desktop files and localizations for almost every single script users make available here in the forum. Most are just small scripting efforts, even if they can be very handy. If you find a script handy for you or your users, my advice would be to localize the text directly in the script and make it available in your personal repository at archive.org, github, etc… You can even package your version of the localized script, with it’s own .desktop file. When everyone has a GUI way to install .deb files, it will be trivial to download that package and install it. If you do that, I also advise to rename the script and the resulting .deb file (ex: adding -pt_br at the end of the file).Traduzir os textos diretamente no código de programação é exatamente o que eu não quero fazer. Eu já fiz muito isso com vários excelentes programas que foram criados pela comunidade antiX, eu os compartilho para um grupo de pessoas que considero ser pequeno, eventualmente estas pessoas conheçam as minhas páginas do archive.org ou do GitLab. O excelente programa que o RJP criou e o outro excelente programa (assistir vídeos do YouTube arrastando o URL) que você criou podem ser distribuídos com as traduções, isto é, se houver interesse das pessoas em traduzir os programas, mas é preciso ser feito com o método correto de tradução dos programas e é isso que eu pretendia aqui. Como eu não sei programar em Bash, eu ajudo com o pouco conhecimento que eu tenho, seja ajudando a criar os arquivos .desktop ou tentando implementar os recursos de tradução. Porque eu apoio a iniciativa das pessoas que compartilham os seus códigos de programação com a comunidade antiX.
Yes. This is a good finger exercise you can improve your skills in preparing scripts for translation with, Marcelo.
Please remember the meaning of the different quotings. Here it’s about the backtick quote, which is one valid form of bash “command substitution”. (see man bash, around line 1203ff) Everything what you can put in between the two backticks is treated as a command to be executed on runtime by bash, and you can as well put into round braces preceded by a dollar sign, which has exactly the same meaning. To catch possible blanks add a set of double qoutes around it “$(…)”. By this modification you have actually nothing changed in the functionality of the script, but now you easily can mark the strings inside for translation.Robin, muito obrigado por sua explicação. Com mais esta aula, eu acho que conseguirei implementar os recursos de tradução. Se eu não conseguir fazer, eu te aviso. Muito obrigado!
Não sei fazer arquivos pot, mas fiz uma versão em português do downloader usando o google translate.
RJP, você foi muito gentil em fazer isso por mim. Muito obrigado!
Mas, nós precisamos fazer da forma correta como foi ensinado pelo Xecure neste tópico Internationalisation of antiX community scripts que foi criado pelo Robin.
Como você conhece programação, estas informações podem ser muito úteis para você e o que eu puder te ajudar eu o farei.Após implementar as modificações necessárias no arquivo “YOUTUBE_DOWNLOADER”, o comando abaixo pode ser aplicado para gerar o arquivo “.pot”. Este arquivo “.pot” tem que conter todos os textos que são exibidos no seu programa em idioma Inglês do seu script “YOUTUBE_DOWNLOADER”. A partir do arquivo “.pot” podemos criar os arquivos “.po” para todos os outros idiomas, inclusive para as variantes en_US, en_GB, etc.
bash –dump-po-strings YOUTUBE_DOWNLOADER | xgettext -L PO -o locale/YOUTUBE_DOWNLOADER.pot –
E se houver interesse, o seu programa poderá ser empacotado para .deb, mas precisamos antes obter as traduções.
Muito obrigado!
March 15, 2023 at 2:21 pm #102122Member
marcelocripe
::First of all, I’d like to thank RJP for his initiative in creating the program, Robin for teaching me what to do to make the translations work, and the other people who contributed to this topic.
I was able to implement the translation features in the program for the March 7, 2023 version.
I needed to change the spelling of the program name to match the “patterns” that are used in other Debian/antiX .deb packages.
The “youtube-downloader_1_all.deb” package is available on GitLab.
I included as dependencies of “youtube-downloader_1_all.deb” the packages “ytfzf”, “fzf” and “ueberzug”.
The tests I did were in antiX 22 full 64 bits without updating and without persistence, after installing the package “youtube-downloader_1_all.deb”, I needed to apply the command $ sudo apt install –reinstall ytfzf fzf ueberzug for the program to work correctly. I believe that it will not be necessary to reinstall (“ytfzf”, “fzf” and “ueberzug”) if the package “youtube-downloader_1_all.deb” is installed in an updated antiX.
Some videos were able to be downloaded with “youtube-downloader_1_all.deb” and other videos were not.
If other volunteer translators are interested in having the translation of “youtube-downloader_1_all.deb”, just download the files “youtube-downloader.desktop” and “youtube-downloader_pt_BR.po”. In “youtube-downloader.desktop” include your language in the entries “Name[xx]” and “Comment[xx]” or correct existing automatic translations. In “youtube-downloader_pt_BR.po” change the identifier “pt_BR” by the identifier of your language/country in the file name and in its content, in the place where the texts in “pt_BR” are, replace it with your text of your language. You can email me or request a merge directly on GitLab with your translated files. Once I have two or more new languages, I will create another “youtube-downloader_1_all.deb” package.
Installation process of “youtube-downloader_1_all.deb” package:
1 – Download the package “youtube-downloader_1_all.deb” and the checksum files.
2 – Access the folder where you downloaded the files: “youtube-downloader_1_all.deb”, “youtube-downloader_1_all.deb.sha256.sum” and “youtube-downloader_1_all.deb.md5.sum”.
3 – Check the “youtube-downloader_1_all.deb” with the commands below:
demo@antix1:~/Downloads
$ shasum -c youtube-downloader_1_all.deb.sha256.sum
youtube-downloader_1_all.deb: OK
demo@antix1:~/Downloads
$demo@antix1:~/Downloads
$ md5sum -c youtube-downloader_1_all.deb.md5.sum
youtube-downloader_1_all.deb: SUCCESS
demo@antix1:~/Downloads
$4 – Install the package “youtube-downloader_1_all.deb”
demo@antix1:~/Downloads
$ sudo apt updatedemo@antix1:~/Downloads
$ sudo apt install ./youtube-downloader_1_all.deb– – – – –
Antes de mais nada, eu gostaria de agradecer ao RJP por sua iniciativa em criar o programa, ao Robin por me instruir no que era preciso fazer para as traduções funcionarem e as outras pessoas que coloboraram neste tópico.
Eu consegui implementar os recursos de traduções no programa da versão do dia 07 de março de 2023.
Eu precisei alterar a escrita do nome do programa para ficar semelhante aos “padrões” que são utilizados nos outros pacotes .deb do Debian/antiX.
O pacote “youtube-downloader_1_all.deb” está disponível no GitLab.
Eu inclui como dependências do “youtube-downloader_1_all.deb” os pacotes “ytfzf”, “fzf” e “ueberzug”.
Os testes que eu fiz foram no antiX 22 full de 64 bits sem atualização e sem persistência, após a instalação do pacote “youtube-downloader_1_all.deb”, eu precisei aplicar o comando $ sudo apt install –reinstall ytfzf fzf ueberzug para o programa funcionar corretamente. Eu acredito que não será necessário reinstalar (“ytfzf”, “fzf” e “ueberzug”) se o pacote “youtube-downloader_1_all.deb” for instalado em um antiX atualizado.
Alguns vídeos foram possíveis de serem baixados com o “youtube-downloader_1_all.deb” e outros vídeos não.
Se houver o interesse dos outros tradutores voluntários em ter a tradução do “youtube-downloader_1_all.deb”, basta baixar os arquivos “youtube-downloader.desktop” e “youtube-downloader_pt_BR.po”. No “youtube-downloader.desktop” inclua o seu idioma nas entradas “Name[xx]” e “Comment[xx]” ou corrija as traduções automáticas existentes. No “youtube-downloader_pt_BR.po” altere o identificador “pt_BR” pelo identificador do seu idioma/país no nome do arquivo e no seu conteúdo, no lugar onde estão os textos em “pt_BR” substitua pelo seu texto do seu idioma. Você pode me enviar por e-mail ou fazer o pedido de mesclagem direto no GitLab com os seus arquivos traduzidos. Assim que eu tiver dois ou mais idiomas novos, eu criarei outro pacote “youtube-downloader_1_all.deb”.
Processo de instalação do pacote “youtube-downloader_1_all.deb”:
1 – Baixe o pacote “youtube-downloader_1_all.deb” e os arquivos da soma de verificação.
2 – Acesse a pasta onde você baixou os arquivos: “youtube-downloader_1_all.deb”, “youtube-downloader_1_all.deb.sha256.sum” e “youtube-downloader_1_all.deb.md5.sum”.
3 – Verifique o “youtube-downloader_1_all.deb” com os comandos abaixo:
demo@antix1:~/Downloads
$ shasum -c youtube-downloader_1_all.deb.sha256.sum
youtube-downloader_1_all.deb: OK
demo@antix1:~/Downloads
$demo@antix1:~/Downloads
$ md5sum -c youtube-downloader_1_all.deb.md5.sum
youtube-downloader_1_all.deb: SUCESSO
demo@antix1:~/Downloads
$4 – Instale o pacote “youtube-downloader_1_all.deb”
demo@antix1:~/Downloads
$ sudo apt updatedemo@antix1:~/Downloads
$ sudo apt install ./youtube-downloader_1_all.debMarch 15, 2023 at 5:19 pm #102159MemberRJP
March 17, 2023 at 11:23 am #102348Member
marcelocripe
::For the information of all people interested in the “youtube-downloader_1_all.deb” package.
I tested the “youtube-downloader_1_all.deb” package on two different computers:
– the first computer has antiX 22 full 64-bit installed on the hard disk and with the update dated 03-16-2023 and everything worked perfectly.
– the second computer has Remastering of antiX 21 Full 32-bit with Kernel 4.4.0-296 which is installed on the hard disk and with the update of 03-16-2023 and everything worked perfectly. The “ueberzug” package was installed along with its dependencies.Now I can create the text file containing the complete tutorial on how to install the “youtube-downloader_1_all.deb” package that will be available on GitLab and on archive.org.
I uploaded the translatable files in “.po” format to GitLab for the languages “de”, “es”, “fr”, “fr_BE”, “it” and “pt”, because these are the languages of the volunteer translators who are active here on the antiX forum. If you want it in another language, please let me know here or by email.
Thank you so much RJP.
– – – – –
Para a informação de todas as pessoas interessadas no pacote “youtube-downloader_1_all.deb”.
Eu testei o pacote “youtube-downloader_1_all.deb” em dois computadores diferentes:
– o primeiro computador possui o antiX 22 full de 64 bits que está instalado no disco rígido e com a atualização do dia 16-03-2023 e tudo funcionou perfeitamente.
– o segundo computador possui a Remasterização do antiX 21 Full de 32 bits com o Kernel 4.4.0-296 que está instalada no disco rígido e com a atualização do dia 16-03-2023 e tudo funcionou perfeitamente. O pacote “ueberzug” foi instalado junto com as suas dependências.Agora eu poderei criar o arquivo de texto contendo o tutorial completo de como instalar o pacote “youtube-downloader_1_all.deb” que estará disponível no GitLab e no archive.org.
Eu enviei os arquivos traduzíveis no formato “.po” para o GitLab dos idiomas “de”, “es”, “fr”, “fr_BE”, “it” e “pt”, porque estes são os idiomas dos tradutores voluntários que são ativos aqui no fórum do antiX. Se você quiser de outro idioma, por favor, me avise aqui ou por e-mail.
Muito obrigado RJP.
-
AuthorPosts
- You must be logged in to reply to this topic.