Skip to content
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

Sigma-Aldrich PDF failing to save from Chrome #524

Open
dstillman opened this issue Nov 24, 2024 · 1 comment
Open

Sigma-Aldrich PDF failing to save from Chrome #524

dstillman opened this issue Nov 24, 2024 · 1 comment
Assignees

Comments

@dstillman
Copy link
Member

https://forums.zotero.org/discussion/119933/cant-save-pdf-to-zotero-from-chrome-connector

It's working for me from Firefox but failing from Chrome:

zotero(2)(+0000001): Downloaded file was not a supported type

zotero(3)(+0000000): Getting contents of /Users/dan/Zotero-Dev/storage/tmp-4IT0Nk/179124.pdf

zotero(3)(+0000001): <!DOCTYPE html><html><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta http-equiv="refresh" content="5; URL='/US/en/sds/sigald/179124?userType=undefined&bm-verify=AAQAAAAK_____21_cbId81HEsovSt67yYNF5pWSnfJvEQ5yRhHWEDdsCzuJRecqm7u7JpOvxGIIX95AfaxPURaLu_tIxoz6ognSBjjuNjY6SxI-HrCJwmtf13zcN3Mj_eNBQZk24_8OoaN2XnytjII4oUNeq5B6gDMbqhKuxkyUQp1Ll0zjKRlbKKreLuRhajs8zPdlWYZAh2qhys7A3vKEAEjLKqe9hxzejFzfnrJWNbskcAh0TfDgvh5vOoyNtZRVM5py5NGbye0Rv_EjIlz3Kv7xMTXRrbs5jllKqRC8DYxi4Cnst65L0TwD0OCkVpkVpejNWVjQACyb9U1gsaQjvHXijS5PB5QBoVK0WGFPmB74PVX0hJ0ZoSC5KIZQn7sNLDjl3WTJNR7QHbe8TIq4jdyIBUTjV2GYP'" /><title>&nbsp;</title><script> var i = 1732445927; var j = i + Number("4536" + "59262"); </script> </head> <noscript> <iframe style="border: none; height: 100%; width: 100%;" src=""></iframe></noscript><script> var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("loadend", function() { try { var data = JSON.parse(xhr.responseText); if (data.hasOwnProperty('reload')) { if (data["reload"] == true) { window.location.replace(window.location.href.replace(/[&?]bm-verify=[^#]*/, ""));  if(window.location.hash){ window.location.reload(); } } } else if (data.hasOwnProperty('location')) { window.location.replace(data["location"]); } else { window.location.reload(); } } catch (e) { var data = {}; window.location.reload(); }}); xhr.open("POST", "/_sec/verify?provider=interstitial", false); xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(JSON.stringify({"bm-verify": "AAQAAAAK//////DdCwS84bBs5JQPfJaPk+YXIpwkWWSncEzQ1kehyp9Wp1uqqJbrpANrDXCZPiLCeJhqPHONNql+gxpjW9bl7pF8Oaz8HO1hcq0r0EQP3juCPH8X673gqA6uG73SPIFdQEoeCl1Qy02m71MT+jeFADr8ZyStdF6BDbOHHq5h0woGzty2SLkKkeciyCpn7Chbjp1aYO4Ax9/0+QVMFgYGDlMYbZbBXj0oP3TFliR84eS4/QuPtejEQXcR9ZQTq1ejXiZ/GV5TdXGl/TSx4sIBrhOUb7V1wLuSyG5DxLYcjad0OQHwmtP4DZ13stMlqrQeIw+h1zbZQN0jcpioIiENZIi2eGaEuifQ0u8elE/nek08TcIwqSn9ng8KNlEs9QH7EmfYqem2d2WPkM4xw1YCmh/LF8zxLo1ZCzijXQDp+WUJUw==", "pow": j})); </script>  </body> </html>

zotero(1)(+0000002): Error: Downloaded file was not a supported type (PDF or EPUB)

    Error: Downloaded file was not a supported type (PDF or EPUB)

And then at one point I was also getting a 429 with just a [] for a response, but not sure if that was related.

@dstillman dstillman transferred this issue from zotero/zotero Nov 24, 2024
@adomasven
Copy link
Member

Seems like different content is served based on User-Agent. We spoof the user-agent of the browser in Zotero when saving attachments from the Connector, along with passing the cookies and some other headers. This will be addressed by #474

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants