D
D
Dmitry2022-01-09 13:56:25
YouTube
Dmitry, 2022-01-09 13:56:25

How to extract from YouTube HTML link for downloading (download) video (Java)?

Given the URL of a YouTube video. For example: https://www.youtube.com/watch?v=yj-04qAGq2A
The HTML page contains links starting with " https://rr4---sn-cx1x9-ua8z.googlevideo.com/videop... . ..". I'm decoding special characters in links, but the resulting links don't work.
In the dev panel, I see video requests that also start with " https://rr4---sn-cx1x9-ua8z.googlevideo.com/videop... ...". If I cut off the end of the link, starting with "&range=", such a link works and allows you to download the video.
How is it possible to extract from HTML or generate (convert) a link for direct video download?
Maybe there is a non-Java library to help generate a video download link from HTML content?
Could it be possible to send an additional (intermediate) request to YouTube that returns a valid video download link?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2022-01-09
@bacon

It's not so simple there, it's better to see how others have done it, for example, https://github.com/ytdl-org/youtube-dl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question