diff options
author | giuli007 <39272329+giuli007@users.noreply.github.com> | 2023-06-19 16:23:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 16:23:01 +0200 |
commit | 9c90452a229810b80ebfd4de5b3346d5a7990803 (patch) | |
tree | 9dbf976b53eab8f8b856c7d42e5ff7085b9bbcc8 | |
parent | 2ac6837f5275682bf63bd75dd9ef7b4a9ac20a3e (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-x | ticker.sh | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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" |