apt-get install python3 python3-lxml python3-requests python3-requests-cache
```
+You must also install Streamlink, or if it unavailable, the older Livestreamer. Depending on the age of your distro you'll need either:
-Install Livestreamer and PyCrypto. Ubuntu packages this as Python 2:
-```
-apt-get install livestreamer python-crypto
-```
+- `apt-get install streamlink`
+- `apt-get install livestreamer python-crypto`
Install ffmpeg:
raise Exception("You must install ffmpeg or libav-tools")
+def find_streamlink():
+ for streamlink in ["streamlink", "livestreamer"]:
+ if check_command_exists([streamlink, "--help"]):
+ return streamlink
+
+ raise Exception("You must install streamlink or livestreamer")
+
def get_duration(filename):
ffprobe = find_ffprobe()
def download_hds(filename, video_url, pvswf=None):
+ streamlink = find_streamlink()
+
filename = sanify_filename(filename)
logging.info("Downloading: %s", filename)
param = video_url
cmd = [
- "livestreamer",
+ streamlink,
"-f",
"-o", filename,
param,
return False
def download_hls(filename, video_url):
+ streamlink = find_streamlink()
+
filename = sanify_filename(filename)
video_url = "hlsvariant://" + video_url
logging.info("Downloading: %s", filename)
cmd = [
- "livestreamer",
+ streamlink,
"-f",
"-o", filename,
video_url,