I
I
Ivan2021-02-09 23:25:42
YouTube
Ivan, 2021-02-09 23:25:42

How to download video from YouTube (music)?

Good evening.

I need to be able to download videos from youtube.
I can do it in a simple way, just get the download url via

https://www.youtube.com/get_video_info?video_id=I6...

In response to this, I get this:
Array
(
[0] => Array
(
[itag] => 18
[url] => https://r2---sn-pivhx-n8vs.googlevideo.com/videoplayback?expire=1612918297&ei=udkiYI3_KMLoyAXF3q2QCg&ip=2a03%3Ac980%3Adead%3A1009%3A91%3A218%3A228%3A19&id=o-AJ7dkLYFYNYEqZFp4TA8_721q-h7fBBgQcUe2b4TDeq5&itag=18&source=youtube&requiressl=yes&mh=GP&mm=31%2C29&mn=sn-pivhx-n8vs%2Csn-n8v7kn7e&ms=au%2Crdu&mv=u&mvi=2&pl=48&vprv=1&mime=video%2Fmp4&ns=bVBIbhkVee0LHnoZaQXM_oYF&gir=yes&clen=75844420&ratebypass=yes&dur=1042.924&lmt=1608871121827338&mt=1612895510&fvip=12&c=WEB&txp=5530434&n=RcPJaPSw7z3Ek9X&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAI_e_1DFTin7i2x7Hm0tqOBZZbqKmdukC5ZM4sHRSmDgAiEApO6PkQNJvgDj1qPAvXVTXWbmq4ZLeuvAAhZNyR-UWjo%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AG3C_xAwRQIhAL5ecRcfQbyvmXO5Llp_acKWvQVG1fwZ-vOfNz1B60EeAiBGEQObs1JXJNr7ZkLToDR_RRV2X5gj4_s-inDB2ctH5Q%3D%3D
[bitrate] => 581810
[width] => 640
[height] => 360
[lastModified] => 1608871121827338
[contentLength] => 75844420
[quality] => medium
[fps] => 30
[qualityLabel] => 360p
[projectionType] => RECTANGULAR
[averageBitrate] => 581782
[audioQuality] => AUDIO_QUALITY_LOW
[approxDurationMs] => 1042924
[audioSampleRate] => 44100
[audioChannels] => 2
[title] => Минусы Бизнеса в США / Погряз В Бюрократии
[mime] => video/mp4
[format] => mp4
)

[1] => Array
(
[itag] => 22
[url] => https://r2---sn-pivhx-n8vs.googlevideo.com/videoplayback?expire=1612918297&ei=udkiYI3_KMLoyAXF3q2QCg&ip=2a03%3Ac980%3Adead%3A1009%3A91%3A218%3A228%3A19&id=o-AJ7dkLYFYNYEqZFp4TA8_721q-h7fBBgQcUe2b4TDeq5&itag=22&source=youtube&requiressl=yes&mh=GP&mm=31%2C29&mn=sn-pivhx-n8vs%2Csn-n8v7kn7e&ms=au%2Crdu&mv=u&mvi=2&pl=48&vprv=1&mime=video%2Fmp4&ns=bVBIbhkVee0LHnoZaQXM_oYF&ratebypass=yes&dur=1042.924&lmt=1608871145181017&mt=1612895510&fvip=12&c=WEB&txp=5532434&n=RcPJaPSw7z3Ek9X&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRAIgYGOmUToS9ZhfV_tkElz_oHk_yvUcZkwniH55B5boAJsCIErOH_g8ltnMXvYMYO7OUIsdrLaZocP47FuhCe6M_-yO&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AG3C_xAwRQIhAL5ecRcfQbyvmXO5Llp_acKWvQVG1fwZ-vOfNz1B60EeAiBGEQObs1JXJNr7ZkLToDR_RRV2X5gj4_s-inDB2ctH5Q%3D%3D
[bitrate] => 2169962
[width] => 1280
[height] => 720
[lastModified] => 1608871145181017
[quality] => hd720
[fps] => 30
[qualityLabel] => 720p
[projectionType] => RECTANGULAR
[audioQuality] => AUDIO_QUALITY_MEDIUM
[approxDurationMs] => 1042924
[audioSampleRate] => 44100
[audioChannels] => 2
[title] => Минусы Бизнеса в США / Погряз В Бюрократии
[mime] => video/mp4
[format] => mp4
)

)


Everything is fine, but if I try to do the same, but for example with this video:
https://www.youtube.com/watch?v=DXGelmwqfm4

I'll get this response:
Array
(
[0] => Array
(
[itag] => 18
[bitrate] => 689985
[width] => 586
[height] => 360
[lastModified] => 1611090297798193
[contentLength] => 16980119
[quality] => medium
[fps] => 24
[qualityLabel] => 360p
[projectionType] => RECTANGULAR
[averageBitrate] => 689800
[audioQuality] => AUDIO_QUALITY_LOW
[approxDurationMs] => 196928
[audioSampleRate] => 44100
[audioChannels] => 2
[signatureCipher] =>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question