Skip to content

Commit

Permalink
Add update.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
phillmac committed Nov 9, 2021
1 parent 5d640ad commit a656c7f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /bin/bash

if [[ -z "REDIS_HOST" ]]; then
export REDIS_HOST=redis
fi

if [[ -z "$REDIS_PORT" ]]; then
export REDIS_PORT=6379
fi

url=${1%/}
collection_type=$2

while read -r file_name
do
echo "Adding ${file_name}"
node --unhandled-rejections=strict src/update.js --torrent-url "${url}/${file_name}" --type "${collection_type}"
done < <(curl --silent -L "${url}" | grep -o "[a-zA-Z0-9./?=_%:-]*\.torrent" | sort -ru)

0 comments on commit a656c7f

Please sign in to comment.