0

I am using IT-Ebooks Open Api for book search in my android app.

When i am requesting for book details via web service call like: http://it-ebooks-api.info/v1/book/2279690981. It is returning all details of that book whose ID is 2279690981.

Datas:

  {"Error":"0","Time":0.0005,"ID":2279690981,"Title":"PHP & MySQL: The Missing Manual","SubTitle":"",
"Description":"If you can build websites with CSS and JavaScript, this book takes you to the next level-creating dynamic, database-driven websites with PHP and MySQL. Learn how to build a database, manage your content, and interact with users through queries and web forms. With step-by-step tutorials, real-world examples, and jargon-free explanations, you\u2019ll soon discover the power of server-side programming.",
"Author":"Brett McLaughlin","ISBN":"9780596515867",
"Year":"2011","Page":"498","Publisher":"O'Reilly Media","Image":"http ://s.it- ebooks-api.info/3/p hp__mysql_the_missing_manual.jpg",
"Download":"http ://filepi .com /i/qqkNNW2"}

But when i am trying to download that book with the download url,it is downloading a page only.I am unable to download the pdf file through my app.

Did Any body face that problem that i am facing now???

If you have solution please share it.Thank you in advance.

JoxTraex
  • 13,423
  • 6
  • 32
  • 45
YesAbhi
  • 5
  • 1
  • 6
  • Ya, I am facing problem. I tried to download few docs that is uploaded by me bt i m getting same page to re-enter captcha. Did u find any solution to make diect download on single click. – Rubyist Dec 10 '14 at 19:32
  • @Rubyist I use jdownloader2. it works for me. – femchi Jan 03 '16 at 05:23
  • Desktop app Programming book downloader (https://programmingbooks.codeplex.com/) used the it-books-api.info with direct download link. This project open source on codeplex. – Vineet Choudhary Jan 05 '16 at 18:24

2 Answers2

0

Just try the link yourself.

The page you get has a captcha. Once you complete the captcha, you're given a link to download the actual pdf (which worked for me).

For an Android user, you could start an intent that launches the browser. This would allow the user to complete the captcha himself and download the pdf.

Stephan Branczyk
  • 9,363
  • 2
  • 33
  • 49
  • but in their website we dont need to complete that captcha.It can be downloaded by just one click.Is it possible to do that in mobile application.. – YesAbhi Nov 17 '14 at 10:43
  • You're right. I can confirm the same behavior. It's most likely using the referrer of the originating web site to let this request go through. I can confirm that it's not using a cookie. http://stackoverflow.com/questions/3104647/how-to-spoof-http-referer – Stephan Branczyk Nov 17 '14 at 10:50
  • Be careful even if you can spoof the referrer, you should probably ask them the permission to do so. If they catch you doing something they don't like, they can always revoke your access to their api. In my opinion, you're likely to get their permission if your application has a low number of users and if you just politely ask them for it. Ideally, they should give you a unique key to authenticate with or a unique referrer for your own application, this way, they'll be able to track more accurately how much resources your app consumes from their services. – Stephan Branczyk Nov 17 '14 at 10:58
0

You have to save the cookies and use it with combination with referral link.

 wget --cookies=on --keep-session-cookies --save-cookies=cookie.txt MAIN_URL
 wget -O ./OUTPUTFILE --referer=MAIN_URL --cookies=on --load cookies=cookie.txt --keep-session-cookies
King110
  • 122
  • 8