|
@@ -8,7 +8,7 @@ Example:
|
|
|
|
|
|
$0 cats
|
|
|
$0 -h
|
|
|
- $0 -c -dl ~/HOME/pastes/ -- cats dogs
|
|
|
+ $0 -c -dl ~/pastes/ -- cats dogs
|
|
|
EOF
|
|
|
exit 0
|
|
|
}
|
|
@@ -45,9 +45,8 @@ for term in "${terms[@]}"; do
|
|
|
if (( dl )); then
|
|
|
echo "Downloading files please wait"
|
|
|
curl -s -- "https://psbdmp.ws/api/search/$term" \
|
|
|
- | jq ".data" \
|
|
|
- | awk -v FS=\" '$2 == "id" {print "https://pastebin.com/raw/"$4} ' \
|
|
|
- | xargs -I{} -- wget -P "$SAVE_DIR" -nc -- {}
|
|
|
+ | jq -r '.data[].id' \
|
|
|
+ | xargs -I{} -- wget -P "$SAVE_DIR" -nc -- https://pastebin.com/raw/{}
|
|
|
else
|
|
|
echo "Search term $term"
|
|
|
echo "Total files: $(curl -s "https://psbdmp.ws/api/search/$term" | jq ".data" | wc -l)"
|