stop rate limiting me web archive >:(
This commit is contained in:
parent
6bbd07dc16
commit
209f38200a
5
README
5
README
@ -9,11 +9,14 @@ Dependencies:
|
||||
- yt-dlp(1)
|
||||
|
||||
Usage:
|
||||
yt add | clone | music | pick | play | verify
|
||||
yt add | archive | cache | clone | music | pick | play | queue | verify
|
||||
|
||||
add uri file
|
||||
- Adds a video by URI to a playlist
|
||||
|
||||
archive uri...
|
||||
- Archives a video on the Wayback Machine
|
||||
|
||||
cache uri...
|
||||
- Caches a video title
|
||||
|
||||
|
13
yt
13
yt
@ -35,6 +35,12 @@ add() { # adds a video to a playlist file
|
||||
|
||||
archive() { # archives a video to the Wayback Machine
|
||||
while test -n "$1"; do
|
||||
wayback_url="$(curl -s "$WBAPI$1" \
|
||||
| jq .archived_snapshots.closest.url \
|
||||
| tr -d '"' | sed 's/^http:/https:/g')"
|
||||
|
||||
if [ "$wayback_url" != "null" ]; then continue fi
|
||||
|
||||
curl -s -d "url=$1" https://web.archive.org/{url} >/dev/null
|
||||
shift
|
||||
done
|
||||
@ -58,7 +64,8 @@ clone() { # clones a YouTube playlist in m3u format
|
||||
| sed -n -e '/web\.archive\.org/p' -e '/^\#/p')"
|
||||
then
|
||||
continue
|
||||
else
|
||||
fi
|
||||
printf "%s: %s: Saving video to the Wayback Machine.\n" "$argv0" "$1" 1>&2
|
||||
archive "$line"
|
||||
fi
|
||||
done
|
||||
@ -177,6 +184,10 @@ case "$com" in
|
||||
shift 2>/dev/null || usage 'add uri file'
|
||||
add "$@"
|
||||
;;
|
||||
archive)
|
||||
shift 2>/dev/null || usage 'archive uri...'
|
||||
archive "$@"
|
||||
;;
|
||||
cache)
|
||||
shift 2>/dev/null || usage 'cache uri...'
|
||||
cache "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user