summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgiuli007 <39272329+giuli007@users.noreply.github.com>2023-06-19 16:23:01 +0200
committerGitHub <noreply@github.com>2023-06-19 16:23:01 +0200
commit9c90452a229810b80ebfd4de5b3346d5a7990803 (patch)
tree9dbf976b53eab8f8b856c7d42e5ff7085b9bbcc8
parent2ac6837f5275682bf63bd75dd9ef7b4a9ac20a3e (diff)
Change the url used to get the cookie from finance.yahoo.com to fc.yahoo.com (#42)
This works around the fact that the "finance" subdomain redirects to a consent page (https://guce.yahoo.com/consent) and doesn't allow curl to properly set the cookie needed in subsequent steps Co-authored-by: giuli007 <giuglioz@gmail.com>
-rwxr-xr-xticker.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/ticker.sh b/ticker.sh
index f2ffe6c..64475de 100755
--- a/ticker.sh
+++ b/ticker.sh
@@ -38,7 +38,8 @@ fields=$(IFS=,; echo "${FIELDS[*]}")
[ ! -d "$SESSION_DIR" ] && mkdir -m 700 "$SESSION_DIR"
preflight () {
- curl --silent --output /dev/null --cookie-jar "$COOKIE_FILE" "https://finance.yahoo.com" \
+ # rather than "finance", use the "fc" subdomain which doesn't redirect to a consent page
+ curl --silent --output /dev/null --cookie-jar "$COOKIE_FILE" "https://fc.yahoo.com" \
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
curl --silent -b "$COOKIE_FILE" "https://query1.finance.yahoo.com/v1/test/getcrumb" \
> "$CRUMB_FILE"