[This script](
https://raw.githubusercontent.com/dilawar/Scripts/master/download_mp3_youtube.py)
searches for firefox tab which is playing youtube video and downloads it. It
also extract an mp3 version (audio only) from it (one can transfer mp3 to music
player etc.).
This script uses `youtube.dl` application. It can be downloaded using `apt-get`
on ubuntu and should be available via `pip` or `easy-install`. Also you need to
install `ffmpeg` to convert video file to mp3.
USAGE:
$ ./download_mp3_youtube.py
You should see something like the following:
I can download audio from:
https://www.youtube.com/watch?v=L-9s4nTLSdA&list=FLI4baaRqmAzXBrRnDN0nGSQ&shuffle=0
[youtube:playlist] Downloading just video L-9s4nTLSdA because of --no-playlist
[youtube] Setting language
[youtube] L-9s4nTLSdA: Downloading webpage
[youtube] L-9s4nTLSdA: Downloading video info webpage
[youtube] L-9s4nTLSdA: Extracting video information
[youtube] L-9s4nTLSdA: Encrypted signatures detected.
[youtube] L-9s4nTLSdA: Downloading js player vflibLKsU
[download] Destination: /home/dilawar/Downloads/Madari - Clinton Cerejo feat Vishal Dadlani & Sonu Kakkar, Coke Studio @ MTV Season 2-L-9s4nTLSdA.mp4
[download] 100% of 138.91MiB in 04:14
[avconv] Destination: /home/dilawar/Downloads/Madari - Clinton Cerejo feat Vishal Dadlani & Sonu Kakkar, Coke Studio @ MTV Season 2-L-9s4nTLSdA.mp3
Default download directory is `~/Downloads`. It can be changed in the script.
Dilawar