Closed randyyu13 closed 6 months ago
The API_KEY
is base64 encoded. As such, these are all the characters that are in it:
Can you manually inspect the API_KEY
to check if it meets these conditions?
It is not base64 encoded, do I generate a new API key or what do you recommend?
do I generate a new API key
Yes
That fixed it, thank you
When running the cl to get an API_KEY it only returns {}
So I attempted retrieving it from the browser, by running the cookies in console:
var auth_token = '########',
ct0 = '######',
kdt = '######',
twid = 'u%######'
btoa(`auth_token=${auth_token};ct0=${ct0};kdt=${kdt};twid=${twid}
`).replace(/[^a-zA-Z0-9\+\=\/]/g, '')
I tested the length and characters and validated it online and all is good
But when I test it in creating a stream, I get the same TypeError Invalid char... ...["cookie"] mentioned by randyyu13, which brought me to this issue...
Notes:
Thanks and I'm excited to get this running! LMK what I can do
When running the cl to get an API_KEY it only returns {}
I do have 2FA set
2FA is not supported, that's why you get '{}'
As for the workaround, did you try to decode the API_KEY using the method atob
? What output do you get if you decode it?
Hi, thanks for your help.
I was wrong, I don't have 2FA turned on.
Also, I was able to get the key created through a browser! Thanks! Looks like I have a line break at the end, you can see in the code above. Embarrassing lol
I'll create a new issue if you prefer, but on my first attempt to stream, I get:
RettiwtError: TOO_MANY_REQUESTS at HttpError.RettiwtError [as constructor]... status: 429
I researched and found that 429 is a Too Many Requests status code that is commonly used in web networking so do I assume this is coming from the Twitter endpoint.
Are you able to build a @mentions stream? Have you tested it in a while? Wondering if something changed on the Twitter side.
Thanks!
Update: Now when I run it, get RettiwtError: Failed to authenticate Now I'm banned...
Your account is suspended
After careful review, we determined your account broke the [X Rules](https://help.twitter.com/rules-and-policies/twitter-rules). Your account is permanently in read-only mode, which means you can’t post, Repost, or Like content. You won’t be able to create new accounts. If you think we got this wrong, you can [submit an appeal].
I'll create a new issue if you prefer, but on my first attempt to stream, I get
What polling rate did you use? Remember that stream
method sends repeated requests at fixed intervals, defined by the polling rate. If you set it too, low, you might have run into TOO_MANY_REQUESTS
Are you able to build a @mentions stream?
No, unfortunately we can't, since the normal tweet stream is nothing but the search function called at fixed intervals to poll for newer tweets.
Now I'm banned...
Hopefully, it was a burner account?
The pollingInterval was set to 1000, I didn't really even know what that was I just pasted the stream code.
Hah not a burner, was my client's account, bummer. Perhaps they will un-ban.
Thanks for all your help on your amazing API!
When trying to make an api call with API key, I get the following error: Invalid character in header content ["cookie"] I'm assuming there is a break character or something when the API key is parsed, so I tried the following
and expectedly I got the same error. Any ideas what is happening and how to fix? Same thing occurs in CLI API key is 207 characters long for reference