Skip to content

Commit 2833486

Browse files
download script
1 parent 09cbb32 commit 2833486

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
.metals
3-
.vscode
3+
.vscode
4+
videos

download-videos.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
#!/bin/bash
3+
4+
for row in $(cat .problemSiteData.json | jq -r '.[] | @base64')
5+
do
6+
_jq() {
7+
echo ${row} | base64 --decode | jq -r ${1}
8+
}
9+
link="https://www.youtube.com/watch?v=$(_jq '.video')"
10+
output="videos/$(_jq '.code')-$(_jq '.video')"
11+
if [ -f $output.webm ] || [ -f $output.mkv ]
12+
then
13+
echo "skipping $output"
14+
else
15+
echo "downloading $link to $output"
16+
yt-dlp "$link" -o $output
17+
fi
18+
done
19+

0 commit comments

Comments
 (0)