Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
/ vsdownload Public archive

command line program to download hls video streams from websites, m3u8 files and urls

License

Notifications You must be signed in to change notification settings

clitic/vsdownload

Repository files navigation

This project is deprecated and it will no longer be maintained. This program has been rewritten in Rust located at https://github.com/clitic/vsd.

VSDownload - Video Stream (M3U8) Downloader

command line program to download hls video streams from websites, m3u8 files and urls. What is m3u8 ?

a compact lightweight m3u8 downloader

Installations    |    Usage

Features Implemented

  • auto binary merge for ts segments
  • auto decrypt for aes standard cbc encrypted playlists (beta)
  • auto mux for seperate video, audio and subtitle (webvtt) stream
  • capturing m3u8 links and urls from a website
  • custom headers, proxies, key and iv
  • downloading in multiple threads
  • ffmpeg conversion integration
  • gui support
  • master m3u8 playlist parsing
  • platform independent
  • realtime file size prediction (arithmetic mean) and downloading speed
  • resume and retry support
  • supports live stream download

Important Declaration

If you are distributing downloaded video streams, first ensure that you have rights for those video streams or files.

Installations

Requires*

pip install https://github.com/clitic/vsdownload/archive/main.zip

Or you can also find a windows executable / gui wrapper from releases.

Usage

vsdownload capture <website url> --driver <driver path>
vsdownload save log.json
  • Downloading hls video streams from m3u8 files
vsdownload save <m3u8 url or file> -o video.mp4

In -o/--output flag, any ffmpeg supported extension could be provided
Add --no-cleanup flag to use resume capabilities

GUI Wrapper

To use gui wrapper, first install PyQt6 and then run vsdownload-gui

$ pip install PyQt6
$ vsdownload-gui

Scripting And Automation

You can also integrate vsdownload save and capture command in any python program. This is useful when you have to automate or create sub website m3u8 downloaders. First you can find or parse the m3u8 uri from a website then call vsdownload.save() function in order to download it.

  • save command function
from vsdownload import vsdownload

vsdownload.save("http://videoserver.com/playlist.m3u8", output="merged.mp4")
  • capture and save command functions
from vsdownload import vsdownload

log_file = "stream_log.json"

vsdownload.capture("http://streamingsite.com/stream.html", "chromedriver.exe", output=log_file)
vsdownload.save(log_file, output="merged.mp4")
  • calling vsdownload through subprocess
import subprocess

command_args = [
  "vsdownload", # command
  "save", # sub command
  "http://videoserver.com/playlist.m3u8", # input
  "-o", # extra options
  "a.mp4" # output file
]

try:
  subprocess.run(command_args, check=True)
except subprocess.CalledProcessError as e:
  print(f"error code: {e.returncode}")

License

© 2021-22 clitic

This repository is licensed under the MIT license. See LICENSE for details.

About

command line program to download hls video streams from websites, m3u8 files and urls

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published