From 2ab4db818da5dc20687400cd387d6d3f0a8e3af9 Mon Sep 17 00:00:00 2001 From: MajorLinux Date: Mon, 31 Dec 2018 17:26:02 -0500 Subject: [PATCH] Initial Upload --- clipsDump.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 clipsDump.sh diff --git a/clipsDump.sh b/clipsDump.sh new file mode 100755 index 0000000..f6dfabb --- /dev/null +++ b/clipsDump.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +while read STRING +do + clientid=$STRING +done < clientID.txt + +url="$(curl -s -H 'Client-ID:'$clientid'' -X GET 'https://api.twitch.tv/helix/clips?broadcaster_id=37047880&first=100&started_at=2018-01-01T00:00:00Z&ended_at=2018-12-31T00:00:00Z' | jq -r '.data[] | .url')" > /dev/null + +youtube-dl -o "/mnt/e/Videos/Twitch Clips/clipsOfTheYear/%(title)s.%(ext)s" $url + +page="$(curl -s -H 'Client-ID:'$clientid'' -X GET 'https://api.twitch.tv/helix/clips?broadcaster_id=37047880&first=100&started_at=2018-01-01T00:00:00Z&ended_at=2018-12-31T00:00:00Z' | jq -r '.pagination.cursor')" + +while [ $page != 'null' ]; do + url="$(curl -s -H 'Client-ID:'$clientid'' -X GET 'https://api.twitch.tv/helix/clips?broadcaster_id=37047880&first=100&started_at=2018-01-01T00:00:00Z&ended_at=2018-12-31T00:00:00Z&after='$page'' | jq -r '.data[] | .url')" > /dev/null + + youtube-dl -o "/mnt/e/Videos/Twitch Clips/clipsOfTheYear/%(title)s.%(ext)s" $url + + page="$(curl -s -H 'Client-ID:'$clientid'' -X GET 'https://api.twitch.tv/helix/clips?broadcaster_id=37047880&first=100&started_at=2018-01-01T00:00:00Z&ended_at=2018-12-31T00:00:00Z&after='$page'' | jq -r '.pagination.cursor')" + +done