![]() You can pass it an URL for a single song or even an entire playlist. Youtube-dl -yes-playlist -ignore-errors -sleep-interval 30 -o '%(playlist)s/%(title)s.%(ext)s' "$1"įor this task, I use youtube-dl (w/ a dependency on ffmpeg) with the following options for best results. Youtube-dl -ignore-errors -sleep-interval 30 -i -f bestaudio -extract-audio -audio-format mp3 -audio-quality 0 -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' "$1" Youtube-dl -ignore-errors -f bestaudio -extract-audio -audio-format mp3 -audio-quality 0 -o '%(title)s.%(ext)s' "$1" This will also help make sure your IP doesn't get banned. It is really simple and also respects YouTube's flood or bot protection by having a 30 second interval between downloads. If I want to download a video as an mp3 I can do that, or download an entire playlist as mp3 I can use mp3p then the url to the playlist. This should honestly just be included aliases when you install the youtube-dl package in my opinion. This question has been answered a lot, but I figured I would add something really useful. For cleanup you may want to type rm _z-hEyVQDRA.flv to get rid of the flv file that you no longer need.Once this has successfully completed you will now have the mp3 file you were after. So for this example you would type ffmpeg -i _z-hEyVQDRA.flv -acodec libmp3lame MasterOfPuppets.mp3 Next you need to copy that file name and then put it in an ffmpg command like ffmpeg -i. What you should see is a flv file with the same name as the 'v' component of the youtube url you downloaded.Į.g if you downloaded then you should have a file called _z-hEyVQDRA.flv This will list all the flv files you have. Next have a look to make sure the flv file has downloaded from youtube by typing ls *flv Now install ffmpeg from the official repo. c Resume download of a video which was interrupted beforeįor complete list of switches execute man youtube-dl in terminal. You can also specify other options -b Best quality To download a video execute the following: youtube-dl This will let you upgrade with sudo youtube-dl -U Or as official readme suggest using curl or wget. Nevertheless I will leave the old answer here for future visitors.Install youtube-dl from the official repository in Ubuntu: sudo apt-get install youtube-dl That way, XFCE would execute them on login and all programs could see them. So the correct solution actually was to put the modifications of $LD_LIBRARY_PATH in. a launcher or Alt+F2) and not from a terminal would not see the modified $LD_LIBRARY_PATH, thus missing some libraries. So any program started directly from the GUI (e.g. However, this did not happen when logging into my GUI session (XFCE). bashrc I had changed $LD_LIBRARY_PATH, which was necessary for xdotool to run. The nice thing about the XF86AudioPlay method is, that it also works for pausing Youtube videos playing in the background in Firefox, for example. ![]() on the task bar) with the following command: bash -i -c 'xdotool key XF86AudioPlay'Īs soon as you remove the -i switch, thus making bash non-interactive, it stops working. And funny enough, I got it to work in keyboard shortcuts and launcher icons (e.g. So I concluded that xdotool only works when executed from an interactive shell. I found the same as you: The command xdotool key XF86AudioPlay works from a shell, but not from a shortcut or application launcher. I usually listen to music on rhytmbox music play. ![]() How do I get the command that XFCE executes when I press the default play/pause button on my laptop keyboard because that seems to play/pause any media playing in the background. ![]() Now because I knew a bit of C/C++ I created this wrapper program which does exactly the same thingĪnd mapped the shortcut to execute this program but Alas!! it still doesn't work. I confirmed this by changing the command the shortcuts executes to exo-open -launch WebBrowser which as you might have thought opens my web browser when I press Super+F11. When I press the keyboard shortcut which I have set to Super+F11 my CPU usage rises a bit which means that the shortcut is working. The command is xdotool key XF86AudioPlay but when I make a keyboard shortcut out of this by going to Settings > Keyboard > Application Shortcuts. I found this page which shows a command to simulate media keys from the terminal. Till now I have managed to make keyboard shortcuts for volume control. With this keyboard however I have to create my own keyboard shortcuts to do that because of the absence of media keys. So I bought this keyboard for my laptop that doesn't have media keys on it and I am very used to pressing the play/pause button on my laptop to pause any media playing in the background.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |