Package: tubemp3
TubeMp3Library for getting music from YouTubeInstalationsudoaptupdate&&sudoaptupgrade-ysudoaptinstallffmpegpython3python3-pip-ypip3installtubemp3-UExamples:codingwith url:fromtubemp3.apiimportinfo_urlurl='https://music.youtube.com/watch?v=B_HSa1dEL9s'res=info_url(url)forkeyinres.keys():print(f'{key}:{res[key]}','\n')results:[youtube]B_HSa1dEL9s:Downloadingwebpage
title:ForWhomTheBellTolls(Remastered)track:ForWhomTheBellTolls(Remastered)duration:310artist:Metallicachannel:Metallicayear:2022album:RideTheLightning(Remastered)id_video:B_HSa1dEL9surl_m4a:https://rr1---sn-npqpo5g5cg-2o1e.googlevideo.com/
videoplayback?expire=1672556531&ei=k9uwY4KZKoaZobIPgrOigA0&ip=2804%3A2108%3Afcf6%3Abe07%3A8cc2%3A985b%3A2332%3Aa511&id=o-AFe6AF4hh8V2O0q5_ZfLPR2z-BKhuQn55TFZcQOIIVwW&itag=140&source=youtube&requiressl=yes&mh=qb&mm=31%2C29&mn=sn-npqpo5g5cg-2o1e%2Csn-bg0eznzr&ms=au%2Crdu&mv=m&mvi=1&pl=40&gcr=br&initcwndbps=778750&vprv=1&mime=audio%2Fmp4&ns=WZK8_LEes6LiCdnpIj4ez3MK&gir=yes&clen=5018216&dur=309.973&lmt=1661906335401511&mt=1672534612&fvip=2&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=2318224&n=_Xrn3u1o2oiygs8fc&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgagpGXuqKY0aDx841yUqVtODeXzqJNcpib8Jx2GtVfQ
ECIAujzKGJucW8TwZ_eoOWqt_xI7IfXSYlIVDSWLlOk8tO&sig=AOq0QJ8wRgIhALtD7-iYCvo4baCxdLsRRhuVP6Jn5ucmj2crKIN_syd4AiEAod5kdZNa3-dGVgZUQeraAVVqiAm0eKKSsXOQauJUFo4=thumbnail:https://i.ytimg.com/vi_webp/B_HSa1dEL9s/maxresdefault.webpytdl:{'id':'B_HSa1dEL9s','title':'For Whom The Bell Tolls (Remastered)','formats':[{'asr':48000,'filesize':1817167,'format_id':'249','format_note':....with searchfromtubemp3.apiimportget_info_url,get_info_searchquery='waht is love'vds=get_info_search(query,number_results=5)forvdinvds:delvd['ytdl']print(vd,'\n')response:[download]Downloadingplaylist:wahtislove[youtube:search]query"waht is love":Downloadingpage1[youtube:search]playlistwahtislove:Downloading5videos[download]Downloadingvideo1of5[youtube]HEXWRTEbj1I:Downloadingwebpage[download]Downloadingvideo2of5[youtube]i0p1bmr0EmE:Downloadingwebpage[download]Downloadingvideo3of5[youtube]MPn6E4za7Os:Downloadingwebpage[download]Downloadingvideo4of5[youtube]z3mzvJiUZao:Downloadingwebpage[download]Downloadingvideo5of5[youtube]TC7tjGJO5oI:Downloadingwebpage[download]Finisheddownloadingplaylist:wahtislove{'title':'Haddaway - What Is Love [Official]','track':'Unknown','duration':241,'artist':'CoconutMusicGermany','channel':'CoconutMusicGermany','year':'2014','album':'Unknown','id_video':'HEXWRTEbj1I','url_m4a':'https://rr1---sn-npqpo5g5cg-2o1e.googlevideo.com/videoplayback?expire=1672873426&ei=crG1Y5TVJIvnwgT6qKGABw&ip=2804%3A2108%3Afcf6%3Abe07%3A5020%3A8d5a%3Aa6b3%3A23ad&id=o-AG_p23V5_lC6WC7TPG_woSn7d9OonLlY05cW8Ehqj_g1&itag=140&source=youtube&requiressl=yes&mh=GR&mm=31%2C29&mn=sn-npqpo5g5cg-2o1e%2Csn-bg0eznzr&ms=au%2Crdu&mv=m&mvi=1&pl=40&initcwndbps=918750&vprv=1&mime=audio%2Fmp4&ns=35Dvf-UTMTck_rt2pPlC4BgK&gir=yes&clen=3896196&dur=240.698&lmt=1583594487153971&mt=1672851444&fvip=1&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=5531432&n=zh7tK1-I-AgAOXEnW&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAJkQZ0e1nCh0hYjKsimaBmKc5zI2K5uV9isIndndU3HdAiAoGRQG9Ps7B8JXkf6f3W0vIFmM67YV9xeJeE3dXeZ56Q%3D%3D&sig=AOq0QJ8wRQIhAJckM6F3enXYAEjed0aDsNmBq3-TptLUk0AumEoXvi0wAiBCYKbnulVtt7Iv2bFyMOuPEHem65I5Tt6ZAsBG8fIsQA==','thumbnail':'https://i.ytimg.com/vi/HEXWRTEbj1I/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBJfRv8MtJiH-z3e2hrGw4UUlLwYw'}{'title':'TWICE "What is Love?" M/V','track':'Unknown','duration':223,'artist':'JYP Entertainment','channel':'JYP Entertainment','year':'2018','album':'Unknown','id_video':'i0p1bmr0EmE','url_m4a':'https://rr2---sn-npqpo5g5cg-2o1e.googlevideo.com/videoplayback?expire=1672873427&ei=c7G1Y_GoKOzW1sQP2pOC0A0&ip=2804%3A2108%3Afcf6%3Abe07%3A5020%3A8d5a%3Aa6b3%3A23ad&id=o-AN9gI3VUPQkbhPXANUxlzc4kQQdtcLsNsHw1_H8apfFE&itag=140&source=youtube&requiressl=yes&mh=uz&mm=31%2C29&mn=sn-npqpo5g5cg-2o1e%2Csn-bg0eznls&ms=au%2Crdu&mv=m&mvi=2&pl=40&initcwndbps=918750&vprv=1&mime=audio%2Fmp4&ns=O4DI6it9CfCEMR_bwQr8haoK&gir=yes&clen=3614325&dur=223.283&lmt=1671003915011438&mt=1672851444&fvip=5&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=4532434&n=jGTpl5_RrdxXqfM4g&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgWGkY4i3SgBELNgOLxVCK1hK-8sYDXbxaFyixG1WM3okCIQCA2f3-bphfWpjuD93XFX9CxaWKzgIdMlVyfDEuhGCZjA%3D%3D&sig=AOq0QJ8wRgIhAMGKvaGfz94Dkkjd6iTpGm9_97wIWL-NZ1RW2D0Akr1_AiEA0q_DaKASSmMz764RwzulGE7Np0Ee2jkzTF23yiyH1No=','thumbnail':'https://i.ytimg.com/vi/i0p1bmr0EmE/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBJ3NXnqmFXY3Bsx0kjcL90pgpStw'}{'title':'What Is Love (12" Mix)','track':'What Is Love (12" Mix)','duration':402,'artist':'Haddaway','channel':'Haddaway Channel','year':'2015','album':'What Is Love','id_video':'MPn6E4za7Os','url_m4a':'https://rr2---sn-npqpo5g5cg-2o1e.googlevideo.com/videoplayback?expire=1672873428&ei=dLG1Y7nXMq3I1sQPp8e_yA4&ip=2804%3A2108%3Afcf6%3Abe07%3A5020%3A8d5a%3Aa6b3%3A23ad&id=o-APO7C8kNjwa7vG5OfVLeB_0DAw3Q-Zl-f0nG3pl-iQ9r&itag=140&source=youtube&requiressl=yes&mh=zC&mm=31%2C29&mn=sn-npqpo5g5cg-2o1e%2Csn-bg07dnr7&ms=au%2Crdu&mv=m&mvi=2&pl=40&gcr=br&initcwndbps=918750&vprv=1&mime=audio%2Fmp4&ns=5_dRSRokQi9IcH9ccQoq5S4K&gir=yes&clen=6511823&dur=402.239&lmt=1628120612101811&mt=1672851444&fvip=3&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=5532434&n=JGTgxIbTpUdtvwNm8&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAPkDMsqprhpqSAnoxD_PO4e7ixq-9bwEBqNh7lT4eA17AiBL-2S_mlpP3lv5Ja3rcZZOMKxpppXEYtLWW8tZiMnrVQ%3D%3D&sig=AOq0QJ8wRQIgCwEl9obg7xrspikAEKqGPyk1_byVmA4_uoBhNZNHNucCIQC659JmmwByr9b7NYiYvxT9QeobGLbN0OyPSuGFKyiDQA==','thumbnail':'https://i.ytimg.com/vi/MPn6E4za7Os/maxresdefault.jpg'}{'title':'Haddaway - What Is Love (Moreno J Remix)','track':'Unknown','duration':489,'artist':'Moreno J','channel':'Moreno J','year':'2022','album':'Unknown','id_video':'z3mzvJiUZao','url_m4a':'https://rr1---sn-npqpo5g5cg-2o1e.googlevideo.com/videoplayback?expire=1672873429&ei=dbG1Y_H7K4PSxASP4ZXgDQ&ip=2804%3A2108%3Afcf6%3Abe07%3A5020%3A8d5a%3Aa6b3%3A23ad&id=o-AMt16smA2XweIETQBi8Kw71SQHJ7RWvFufgyxV5WSpdv&itag=140&source=youtube&requiressl=yes&mh=bM&mm=31%2C29&mn=sn-npqpo5g5cg-2o1e%2Csn-bg07dn6k&ms=au%2Crdu&mv=m&mvi=1&pl=40&initcwndbps=962500&vprv=1&mime=audio%2Fmp4&ns=kdjN5BTGxc8eZUbUupHHYJMK&gir=yes&clen=7916285&dur=489.105&lmt=1654522808604025&mt=1672851679&fvip=2&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=5532434&n=Dcr7lAiKvLztuF6e4&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAL12mKaeIzlaLPs2WQpRvFdNNxpnFZRFb-f9oznLenKdAiEAtoUIKEB1v8_ZwDo2kSJ54f4OiayH8YXVwH-x0Nse-vQ%3D&sig=AOq0QJ8wRgIhAORPYlDsWzmlMs3KQUGqTbON9A6p3viXSUtCWPjn9FGwAiEAkZbYQ7dlDAI5YrRCY6k1cQ8eRpFacOAJGvBFE_Gvcgo=','thumbnail':'https://i.ytimg.com/vi/z3mzvJiUZao/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGGUgUihIMA8=&rs=AOn4CLCGdIZe_pHFB4JQSLBt5jhLsvxH_w'}{'title':'Haddaway - What Is Love (Shuffle Dance)','track':'Unknown','duration':296,'artist':'Km Music 1','channel':'Km Music 1','year':'2022','album':'Unknown','id_video':'TC7tjGJO5oI','url_m4a':'https://rr2---sn-npqpo5g5cg-2o1e.googlevideo.com/videoplayback?expire=1672873431&ei=d7G1Y9moFYPAwwSKkLrQDQ&ip=2804%3A2108%3Afcf6%3Abe07%3A5020%3A8d5a%3Aa6b3%3A23ad&id=o-AG3n9CPXFnOT7deFlFrAMsifjmlnjJp_vR9RsrYTtE1F&itag=140&source=youtube&requiressl=yes&mh=tV&mm=31%2C29&mn=sn-npqpo5g5cg-2o1e%2Csn-bg07dnr7&ms=au%2Crdu&mv=m&mvi=2&pl=40&initcwndbps=918750&vprv=1&mime=audio%2Fmp4&ns=iFArK1FgIFDlTR70xu9IzAcK&gir=yes&clen=4789386&dur=295.891&lmt=1671575648475580&mt=1672851444&fvip=2&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=5532434&n=JEb1lCqvD_TP3sX6A&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhALlIUf8X5ru4A_lAKBnEK6Ohy79kH-sJPosrEPJ0ffymAiEA-vjuhZgyo4NWCUUd0J-gTa-1CApqDw1InFQZhglgBTI%3D&sig=AOq0QJ8wRAIgEHA62vE0WdjCQB9IhXJXKEFrlKvEK36KLM07yoqTy2gCIC3zUJ9P7SBwFAlBgzjSaxcyTl-gmdl1t7ITbARSQBVp','thumbnail':'https://i.ytimg.com/vi/TC7tjGJO5oI/maxresdefault.jpg'}on terminalwith name:$getmusic'https://music.youtube.com/watch?v=B_HSa1dEL9s''test.mp3'result:[youtube]B_HSa1dEL9s:Downloadingwebpage[youtube]B_HSa1dEL9s:Downloadingwebpage[youtube]DownloadingjustvideoB_HSa1dEL9sbecauseof--no-playlist
<youtube_dl.YoutubeDL.YoutubeDLobjectat0x7f52f3b611c0>[musicinfo]title:ForWhomTheBellTolls(Remastered)duration:5:10
artist:Metallica
id:B_HSa1dEL9s
album:RideTheLightning(Remastered)year:2022[youtube]B_HSa1dEL9s:Downloadingwebpage[download]Destination:test.m4a[download]100%of4.79MiBin01:06[ffmpeg]Correctingcontainerin"test.m4a"[ffmpeg]Destination:test.mp3
Deletingoriginalfiletest.m4a(pass-ktokeep)Nonstandardgenrename:Unknown