sapo-videos/get-failures.sh

22 lines
919 B
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-FileCopyrightText: 2023 Hugo Peixoto <hugo.peixoto@gmail.com>
TOKEN="581a26491893263804e888240fad1cf7"
echo "not working" >&2
exit 1;
cat failures.txt |
while read TERM PAGE; do
echo "$TERM.$PAGE";
curl -s \
"https://videos.sapo.pt/ajax/search?q=$TERM&type=videos&token=$TOKEN&nocache=9638&page=$PAGE&order=rel" \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0' \
-H 'Accept: text/javascript,text/xml,application/xml,application/xhtml+xml,text/html,application/json;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1' \
-H 'Accept-Language: en-US' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'X-Requested-With: XMLHttpRequest' \
-H "Cookie: language=pt; sso_tld=POR; bsu-v3-api=1689792348549; sv_token=$TOKEN" -o "data/$TERM.$PAGE.json"
done