Initial release

This commit is contained in:
juyoung 2025-04-25 02:26:56 -07:00
commit 00031c0f61
4 changed files with 27 additions and 0 deletions

19
README.md Normal file
View file

@ -0,0 +1,19 @@
```
Kalturadl
=========
Download and compress lecture videos from Kaltura on Canvas
Right-click the video and select "Inspect" or press Ctrl + Shift + I. Go to
the "Network" tab. Play the video for 1-2 seconds, then pause it. Copy the
"index.m3u8" URL from the Network tab.
Download the video: `bash dlm3u8.sh <m3u8_url> <output.mkv>`
Compress the video to 480p: `ffmpeg -i <input.mkv> -vf "scale=-1:480" -c:v
libvpx-vp9 -crf 30 -b:v 0 -cpu-used 4 -c:a aac -b:a 128k <output.mkv>`
Archive all videos and course materials into a single file: `tar -cvpf -
<course_folder>/ | zstd -3 -o "<course_name>_$(date +'%Y%m%d_%H%M%S').tar.
zst"`
```

1
archive.txt Normal file
View file

@ -0,0 +1 @@
tar -cvpf - cs101/ | zstd -3 -o "cs101_$(date +'%Y%m%d_%H%M%S').tar.zst"

1
compress.txt Normal file
View file

@ -0,0 +1 @@
ffmpeg -i input.mkv -vf "scale=-1:480" -c:v libvpx-vp9 -crf 30 -b:v 0 -cpu-used 4 -c:a aac -b:a 128k output.mkv

6
dlm3u8.sh Normal file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
if [ "$#" -ne 2 ] ; then
echo "USAGE: $0 <m3u8_url> <output.mkv>"; exit
fi
base=$(echo "$1" | rev | cut -d'/' -f2- | rev)
curl -s "$1" | grep -v "^#" | sed -e "s>^>$base/>" | xargs curl -s | ffmpeg -i pipe:0 -c:v copy -c:a copy "$2"