C
C
cyberlain2016-10-10 20:30:55
YouTube
cyberlain, 2016-10-10 20:30:55

Is it possible to get direct path to video file in youtube?

In the inspector, of course, src to video files are not displayed)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Taratin, 2016-10-10
@Taraflex

http://www.youtube.com/get_video_info?video_id=<id video>

We parse the resulting text https://medialize.github.io/URI.js/
function parseSearch(str) {
    return URI(str).search(true);
}
var info = parseSearch('?' + <полученный текст>);
//info.title - тут заголовок
var links = info.url_encoded_fmt_stream_map.split(',').map(function (raw) {
                    var u = parseSearch('?' + raw);
                    return u.url;
                }) //тут массив ссылок

It should be borne in mind that this way we get only links to videos with a sewn audio track. And above 720p quality can not be obtained.
If you need higher quality, you will have to download the sound separately from the video.

S
sim3x, 2016-10-10
@sim3x

Possibly
youtube-dl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question