Skip to content

Instantly share code, notes, and snippets.

@lobotony
lobotony / gist:44fc7303214854d121ea3bc27147d6e0
Created May 29, 2023 21:31
Download video stream described in .m3u8 file as found on e.g. Patreon
This is just a quick note-to-self.
I haven't looked into any details regarding .m3u8, .ts or more compact ffmpeg usage.
Originally from here: https://unix.stackexchange.com/questions/687641/how-can-i-download-a-video-from-an-m3u8-file
* install ffmpeg
* download the .m3u8 file
* when logged in on Patreon, on Mac and Safari, this is what you get when you right-click on the embedded player and choose "Download Video"
* this should give you a file that can be used as thingy.m3u8 below
* download the stream with ffmpeg
@lobotony
lobotony / swatmd.py
Created May 11, 2022 17:15
waits for wdavdaemon_enterprise processes and kills them. run with sudo.
#!/usr/bin/env python3
import psutil
import time
def logDebug(msg):
print(time.ctime() + " " + msg)
while True:
count = 0
@lobotony
lobotony / scrubm4a
Created February 14, 2015 18:25
Scrub metadata from m4a files by copying the AAC stream to a new file without reencoding, using ffmpeg. This script replaces the file you're scrubbing, so duplicate your data beforehand. I'm no shell expert and wanted something quick, so it's not very polished, e.g. it won't work with wildcards.
#!/bin/sh
INFILE="$@"
TEMPFILE=/tmp/$RANDOM
echo "processing file: " $INFILE
echo "extracting aac"
ffmpeg -i "$INFILE" -codec: copy $TEMPFILE.aac
echo "stuffing aac into m4a container"
ffmpeg -i $TEMPFILE.aac -bsf:a aac_adtstoasc -codec: copy $TEMPFILE.m4a
echo "replacing old with new"