From 28334862f247c7d1c4dbf8c40473752ce75fc880 Mon Sep 17 00:00:00 2001 From: Kakha Urigashvili Date: Mon, 19 Jun 2023 15:48:56 -0700 Subject: [PATCH 1/2] download script --- .gitignore | 3 ++- download-videos.sh | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 download-videos.sh diff --git a/.gitignore b/.gitignore index 146f8c207..3824a238b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store .metals -.vscode \ No newline at end of file +.vscode +videos diff --git a/download-videos.sh b/download-videos.sh new file mode 100644 index 000000000..c9eef8e33 --- /dev/null +++ b/download-videos.sh @@ -0,0 +1,19 @@ + +#!/bin/bash + +for row in $(cat .problemSiteData.json | jq -r '.[] | @base64') +do + _jq() { + echo ${row} | base64 --decode | jq -r ${1} + } + link="https://www.youtube.com/watch?v=$(_jq'.video')" + output="videos/$(_jq '.code')-$(_jq '.video')" + if [ -f $output.webm ] || [ -f $output.mkv ] + then + echo "skipping $output" + else + echo "downloading $link to $output" + yt-dlp "$link" -o $output + fi +done + From 145c13de75160f24d8607b26b690328c7964aad2 Mon Sep 17 00:00:00 2001 From: Kakha Urigashvili Date: Thu, 29 Jun 2023 10:35:10 -0700 Subject: [PATCH 2/2] update download script --- download-videos.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/download-videos.sh b/download-videos.sh index c9eef8e33..e9476dfe5 100644 --- a/download-videos.sh +++ b/download-videos.sh @@ -1,6 +1,9 @@ #!/bin/bash +git fetch upstream +git rebase upstream/main + for row in $(cat .problemSiteData.json | jq -r '.[] | @base64') do _jq() {