Transport Stream (TS) video downloader utility. Applicable for downloading *.ts video files from websites.
https://jet-cabral.medium.com/java-ts-video-downloader-a0fcf23ab84a
- Java version 8+ --> https://www.oracle.com/java/technologies/javase-downloads.html
- Maven --> https://maven.apache.org/install.html
- Install FFmpeg --> https://ffmpeg.org/download.html
- How to install FFmpeg and add to system path --> https://www.wikihow.com/Install-FFmpeg-on-Windows
* The downloaded output video can be found under: /<_your-system_>/java-video-downloader-util/VideoOutputDirectory/Full_Video.ts
* The website's HAR log file can be found under: /<_your-system_>/java-video-downloader-util/HttpArchiveOutput/trace-website-http-requests.har
- Run as mvn project
- Pass the website url as the 1st and only cmd line args
https://website-with-video.com
mvn clean compile exec:java -Dexec.cleanupDaemonThreads=false -Dexec.mainClass="com.video.downloader.MainVideoDownloader" -Dexec.args="https://website-with-video.com"
- To Download video from https://www.nbcnews.com/tech/tech-news/robinhood-reddit-timeline-two-apps-tormenting-wall-street-n1256080
- Run
mvn clean compile exec:java -Dexec.cleanupDaemonThreads=false -Dexec.mainClass="com.video.downloader.MainVideoDownloader" -Dexec.args="https://www.nbcnews.com/tech/tech-news/robinhood-reddit-timeline-two-apps-tormenting-wall-street-n1256080"
- Final output video should appear under
/<_your-system_>/java-video-downloader-util/VideoOutputDirectory/Full_Video.ts
- Search and find m3u8 file http requests in Website
(Uses Selenium and Browsermob proxy to run Chrome and capture http requests. Http Archive HAR file is created in
/<your-system>/java-video-downloader-util/HttpArchiveOutput/trace-website-http-requests.har
- Identify M3U8 master playlist file and pick out the best quality bit rate variant m3u8
- Download/Read m3u8 text file which contains all path references for video *.ts file urls
- Multi-thread video *.ts file downloads
- Utility implements retry logic for any unsuccessful *.ts file downloads
- Download and write each individual *.ts file to
/<your-system>/java-video-downloader-util/VideoOutputDirectory/.
- Run/Execute ffmpeg command to concat all *.ts files into a single output Full_Video.ts file under
/<your-system>/java-video-downloader-util/VideoOutputDirectory/Full_Video.ts
- https://developer.apple.com/documentation/http_live_streaming/example_playlists_for_http_live_streaming/creating_a_master_playlist
- https://en.wikipedia.org/wiki/M3U
- This utility has only been tested on a Windows 10 OS machine. Functionality is not guaranteed on another platform