-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script appears broken - 401 Unauthorized #33
Comments
nevermind, script is not broken. appears to have something to do with the rare google outage that happened today |
I am getting the same error trying to use the script.
Does it work for you or does it keep giving the error? |
I am receiving the error message again
…On Wed, Apr 19, 2023, 3:27 PM g4570n ***@***.***> wrote:
I am getting the same error trying to use the script.
jq: error (at <stdin>:1): Cannot iterate over null (null)
Does it work for you or does it keep giving the error?
—
Reply to this email directly, view it on GitHub
<#33 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALJOTFTUJTCM5WW2SLGGX6LXCBRDZANCNFSM6AAAAAAXDLHJWU>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I am also getting this error. I think the Yahoo finance API is failing and giving jq bad data. |
This appears to be an ongoing issue |
Yahoo changed something in their finance API. Tried to debug it, but there’s no quick fix. |
Here’s how other people are handling this. Two extra calls to obtain a session and fetch a crumb. Implementation for us would look something like this: If crumb is unavailable or API returns 401, obtain new session, fetch crumb (store it in temporary file for subsequent requests) and repeat the initial call to fetch quotes. |
Please test this and let me know whether it works and which OS you're using: #35 |
Oh! |
I got this error at the moment, though I do have this running with root via /usr/local/sbin/: "mktemp: too few X's in template 'pstadler-ticker-sh'" |
Linux? |
Yes, I'm currently on Arch :) |
So what I‘m ultimately trying to do is to persist sessions across executions. #35 works just fine on macOS, but mktemp requires some sorts of random bits which is quite annoying. I should have some time later tonight to work out a solution that works across platforms. |
Updated PR, tested with macOS and Arch. This should now work in most environments. |
I can confirm working well on my particular environment. Great work and Thank you! @pstadler |
merged into master. please pull the latest version. |
For me (on Gentoo) the old version started to work now (it was broken a few hours ago). New version however doesn't produce any output. No error message, no quotes, nothing. Edit: here's content of my crumb file:
|
I wonder if its giving a 500 cause of the cookie file? Does that get generated okay? |
Cookie file:
|
Yep, I think it might be that, I was able to recreate your error with your cookies file, but my file worked okay: $ curl --silent -b cookies.txt "https://query1.finance.yahoo.com/v1/test/getcrumb" However, my cookies.txt file has a lot more content in there, for example (removing what might be sensitive):
I am hoping this helps the dev :) |
That‘s mighty odd. Thanks for helping out each other here 👍🏻 |
The HttpOnly cookies are missing. what‘s your curl version? |
curl 7.88.1 (x86_64-pc-linux-gnu) libcurl/7.88.1 OpenSSL/1.1.1t zlib/1.2.13 brotli/1.0.9 c-ares/1.19.0 nghttp2/1.51.0 |
Here's mine for context: $ curl --version Edit: went ahead and updated, and still working okay for me with: |
Tried running curl command without silent flag and nothing weird happens. Here's output
The file |
Also tried updating
Tried it also on another machine (also a similar Gentoo box, but connected to different ISP) and the result was the same. |
This one is a real head scratcher for me |
@tomaszg7 please run this and paste the result: curl -v "https://finance.yahoo.com" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8" |
|
that’s it, you’re getting redirected: |
Very interesting! Something about a consent page for GDPR consent. I wonder if its a geo-location thing that you might be running in-to that present that redirect.. Out of my comfort zone here, but there might be a way to inject a header to accept the consent cookie and then continue on with the call. Would you be able to give this a try? :
Additional Ref: |
people are reporting that the API is working again without crumb. Can you confirm this? |
Here's the output:
(It's from another machine with another ISP, but still in the same general area). I confirm that API is working without the crumb, I reported that a few posts back ;) I just checked and it still works. |
I am able to confirm too :) commented out the following to test:
and adjusted to this:
Edit: So odd, I also removed the cookie and it works like that too lol
to
|
Happily reverted this change!
@tomaszg7 I ignored your remark at that time, as I observed the API experiencing intermittent issues for days, if not weeks, before it eventually completely broke down. I thought that these disruptions might have been due to A/B testing or similar activities, and I didn't expect it to recover. It seems the joke's on me this time. If the issue reoccurs, I would be grateful to reach out to both you and @servingbaby for assistance. Thank you for your collaboration! |
Well, apparently we're back to square one. The script is again broken. Maybe they'll fix it once more in a day or two... |
* acquire yahoo finance session (fixes #33) * make temp dir creation work cross platform
/home/ticker.sh AAPL
jq: error (at :1): Cannot iterate over null (null)
appears the script is broken
The text was updated successfully, but these errors were encountered: