SafariBooks-Downloader icon indicating copy to clipboard operation
SafariBooks-Downloader copied to clipboard

Download 503 error

Open lprokein opened this issue 6 years ago • 10 comments

Hi I am getting this error for some books (e.g. 9781787281868, 9781788398237, 9781787128453) some others works fine.

[safari-downloader] downloaded meta files... [safari-downloader] downloaded table of content files... [safari-downloader] StatusCodeError: 503 - "\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\n<!DOCTYPE html>\n<html lang='en'>\n<head>\n<title>Site unavailable</title>\n<meta charset='UTF-8'>\n<meta name='description' content='Error page for Safari'/>\n<link href='https://fonts.googleapis.com/css?family=Source+Sans Pro:200italic,200,300italic,300,400italic,400,600italic,600,700italic,700,900italic,900' rel='stylesheet' type='text/css'>\n<link href='https://storage.googleapis.com/safari-fastly-objects/css/error.css' rel='stylesheet' type='text/css'>\n<meta name='viewport' content='width=device-width, initial-scale=1.0'>\n<script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n ga('create', 'UA-39299553-7', 'auto');\n ga('send', 'pageview');\n ga('send', 'event', 'Error', 'Varnish', '503', {'nonInteraction': 1});\n</script>\n<style>\n body {\n margin: 0;\n }\n header {\n background-color: #b9002d;\n padding:7px 0 6px 10px;\n margin-bottom: 15px;\n text-align: left;\n }\n header svg {\n fill: #fff;\n display: block;\n width: 73px;\n height: 13px;\n }\n h1 {\n font-size: 3em;\n max-width: 800px;\n line-height: 1em;\n margin-bottom: 20px;\n }\n h2 {\n font-size: 2em;\n max-width: 800px;\n margin-bottom: 40px;\n }\n @media (max-width: 600px) {\n h1 {\n font-size: 2em;\n max-width: 75%;\n }\n h2 {\n font-size: 1.5em;\n }\n }\n h1,\n h2 {\n font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;\n font-weight: 200;\n color: #695545;\n padding: 0 20px 0;\n }\n a, a:link, a:active, a:hover, a:visited {\n color: #4a3c31;\n }\n</style>\n</head>\n<body>\n<header>\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 60 10\" width=\"78\" height=\"13\"><desc>O'Reilly logo</desc><polygon points=\"28.09 1.96 28.09 0.42 21.68 0.42 21.68 9.64 28.09 9.64 28.09 8.11 23.22 8.11 23.22 5.8 27.86 5.8 27.86 4.27 23.22 4.27 23.22 1.96 28.09 1.96\"></polygon><polygon points=\"32.85 9.64 32.85 0.42 34.39 0.42 34.39 8.11 38.82 8.11 38.82 9.64 32.85 9.64\"></polygon><polygon points=\"40.07 9.64 40.07 0.42 41.61 0.42 41.61 8.11 46.04 8.11 46.04 9.64 40.07 9.64\"></polygon><rect x=\"29.71\" y=\"0.42\" width=\"1.54\" height=\"9.22\"></rect><path d=\"M1.59,6.28a4.8,4.8,0,1,1,4.8,4.8,4.8,4.8,0,0,1-4.8-4.8M4.09,4A3.27,3.27,0,1,0,6.4,3,3.27,3.27,0,0,0,4.09,4\" transform=\"translate(-1.59 -1.2)\"></path><path d=\"M19.82,6.89A2.69,2.69,0,0,0,19,1.62H14.41v9.22h1.54V7h2.14l2.32,3.84H22.2ZM15.95,5.47V3.16H19a1.15,1.15,0,0,1,0,2.31h-3.1Z\" transform=\"translate(-1.59 -1.2)\"></path><path d=\"M13.32,2.61a1.13,1.13,0,1,1-1.13-1.13,1.13,1.13,0,0,1,1.13,1.13\" transform=\"translate(-1.59 -1.2)\"></path><polygon points=\"52.9 0.42 51.03 0.42 48.66 3.85 46.3 0.42 44.43 0.42 47.89 5.44 47.89 9.64 49.43 9.64 49.43 5.44 52.9 0.42\"></polygon><path d=\"M58.31,1.2a2.41,2.41,0,1,0,2.41,2.42A2.42,2.42,0,0,0,58.31,1.2m0,4.44a2,2,0,1,1,2-2,2,2,0,0,1-2,2\" transform=\"translate(-1.59 -1.2)\"></path><path d=\"M59.4,3.09a0.72,0.72,0,0,0-.72-0.72H57.32V4.83h0.41v-1h0.69l0.49,1h0.46l-0.51-1a0.71,0.71,0,0,0,.54-0.69m-1.67-.31h0.95a0.31,0.31,0,0,1,.31.31,0.31,0.31,0,0,1-.31.3H57.73V2.78Z\" transform=\"translate(-1.59 -1.2)\"></path></svg>\n</header>\n<section>\n\n <h1>Houston, we have a problem.</h1>\n\n <h2>Sorry for the inconvenience. Please try again. For additional help, please contact our customer service team at <a href=\"tel:+1-800-889-8969\" aria-label=\"1. 8 0 0. 8 8 9. 8 9 6 9.\" style=\"white-space:nowrap;\">1-800-889-8969</a>, <a href=\"tel:+1-707-827-7019\" aria-label=\"7 0 7. 8 2 7. 7 0 1 9.\" style=\"white-space:nowrap;\">707-827-7019</a>, or <a href=\"mailto:[email protected]\">[email protected]</a></h2>\n\n <img src='https://storage.googleapis.com/safari-fastly-objects/img/cog.png' />\n </section>\n</body>\n</html>\n"

lprokein avatar Mar 23 '18 07:03 lprokein

same as me

debu99 avatar May 02 '18 07:05 debu99

Same here

joaoflf avatar Jun 08 '18 15:06 joaoflf

Same for me

andro404 avatar Jan 02 '19 13:01 andro404

I think it comes mostly from the website. Can you access the book through the website UI ?

hypr2771 avatar Jan 02 '19 13:01 hypr2771

yes, from the website it works perfectly fine. Only the downloader fails for some reason

andro404 avatar Jan 02 '19 14:01 andro404

I tried locally (with my forked version) and I managed to download book 9781788997027 which is one of the books mentioned by the OP :

SafariBooks-Downloader dev$ safaribooks-downloader -b 9781788997027 -o test
[safari-downloader] starting application...
[safari-downloader] the user "***@***.***" was successfully authorized...
[safari-downloader] downloaded meta files...
[safari-downloader] downloaded table of content files...
[safari-downloader] downloaded chapter files...
[safari-downloader] downloaded stylesheet files...
[safari-downloader] epub successfully saved. exiting...

Which version are you using ? Could you show the output of

echo `git remote get-url origin`:`git branch --format='%(refname)'`

assuming you named the remote repository origin and installed safaribooks-downloader from here. Could you also confirm you get a 503 and not a 404 HTTP error ?

hypr2771 avatar Jan 02 '19 18:01 hypr2771

Thanks for your feedback. I am using the forked version and thanks to it I got the 404 error fixed some days ago.

I was trying to download yesterday 9780321685438 and it gave me the exact same error as the one described by the creator of the issue (503).

I did retry today and it worked fine, no idea why.

For the command you asked me to run, it gave me the following output:

'` was unexpected at this time.

I tried without '` and then got the following:

error: option '-b' missing. please consider '--help' for more information.

andro404 avatar Jan 03 '19 14:01 andro404

Thanks for your feedback. I am using the forked version and thanks to it I got the 404 error fixed some days ago.

I was trying to download yesterday 9780321685438 and it gave me the exact same error as the one described by the creator of the issue (503).

I did retry today and it worked fine, no idea why.

For the command you asked me to run, it gave me the following output:

'` was unexpected at this time.

I tried without '` and then got the following:

error: option '-b' missing. please consider '--help' for more information.

Great ! I guess 503 is returned when they encounter a server side issue but it depends on their implementation which is black box and hard to do reverse engineering.

Sorry about the command, it works only on UNIX based system... Are you running on another system ? If so, you can run it from a MinGW terminal.

hypr2771 avatar Jan 03 '19 21:01 hypr2771

[safari-downloader] downloaded table of content files... [safari-downloader] StatusCodeError: 503

Got this error today, may be (like you mentioned) it has been handled from server side. Is there a way to avoid this?

LingarajVB avatar Jan 06 '19 18:01 LingarajVB

Have this problem. Tried dev branch, but still not working. Hmm.

LeoUfimtsev avatar Jan 28 '19 20:01 LeoUfimtsev