-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fails to upload; possible 302 redirect from slack? #3
Comments
same issue.. took same debug steps as @cbowns |
Strange. I'm expecting that Slack just changed something about the way their web application behaves, and this script didn't follow. (It was a terrible, one-hour hack to begin with 😉) Maybe there's additional verification on the request, now? |
I'm seeing this same behaviour. Currently trying to upload all the pokemon emoji's 😄 |
A 302 re-direct actually means the upload worked (strangley enough). They will return a 200 if it doesn't work. The likely problem is that the image doesn't fit their image standards (128x128 max pixels and 64K in size). I'm using a modified version of this script successfully still. I wrote some additional code to downsample images that exceed their maxsize before uploading. Working on integrating it a bit better with what's here and creating a pull request. |
I've put in a pull request ( #6 ) that will throw exception w/ Slack error (Most likely the 128x128 limit) |
The script should now give a clearer message if there is an error uploading an emoji. The issue is that Slack returns at 200 OK and then displays an error_alert box on the web page. I've resolved this by checking the page for the presence of the alert and throwing an exception, if necessary. |
I'm still getting this issue. The page I'm getting redirected to is the login page. I'm wondering if the document.cookie part doesn't work. Have the latest master |
Nope, that definitely doesn't work. I tried it, but I must not have re-sourced the .env file. document.cookie can't get the https only cookies. Will fix documentation now. |
Cleaned up! #8 |
I've been plugging away at this for a bit and can't get it to work. I think I've got a proper cookie set up (via #2), but my uploads simply fail to go through. Looking at this traffic through Runscope vs an in-browser request with Chrome, it looks like Slack is returning a 302 to the main request the script makes.
If I toggle
allow_redirects
toallow_redirects=True
, I get a<Response [200]>
afterr.raise_for_status()
, but the upload itself is still not working. Any ideas on how to debug this further?The text was updated successfully, but these errors were encountered: