![]() |
#1 |
Member
![]() Posts: 21
Karma: 10
Join Date: Jun 2012
Device: Sony PRS-T1
|
Download ePub from url? [unprotected]
I need to get an ePub from an URL, so for example from:
Code:
http://example.com/download/20120628/20120628download.epub Code:
'http://example.com/download/' + %Y + %m + %d + '/' + %Y + %m + %d + 'download.epub' ![]() Help is greatly appreciated. Last edited by Zeno_; 06-28-2012 at 08:51 AM. |
![]() |
![]() |
![]() |
#2 |
Member
![]() Posts: 14
Karma: 10
Join Date: Jun 2012
Device: snoy
|
My Python knowledge is little better the yours I'm afraid Zeno_, but I do have a Perl script that I've used in the past to save a pdf file to my computer from a url, and I suspect it would also work for ePub files.
Hope this helps. WmFS #=========================================== # DownloadPDF.pl #=========================================== # Set $file to name of the output file # Set $url to remote file #=========================================== use LWP::UserAgent; $file = "The Perl Review (March 2002).pdf"; $url = "https://www.theperlreview.com/Issues/The_Perl_Review_0_1.pdf"; $ua = LWP::UserAgent->new; $req = HTTP::Request->new(GET => $url); $res = $ua->request($req); if ($res->is_success) { open OUTFILE, ">" . $file; $record = $res->content; print OUTFILE $record; close OUTFILE; } else { print "Failed to download $url\n"; $record = $res->content; print $record; } Last edited by wmfs; 06-28-2012 at 09:15 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 21
Karma: 10
Join Date: Jun 2012
Device: Sony PRS-T1
|
Thanks for the script wmfs, but I don't think I could turn it into a recipe to use with Calibre.
edit: Found using old NRC Handelsblad recipe ![]() Last edited by Zeno_; 06-28-2012 at 03:20 PM. |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() Posts: 55
Karma: 10
Join Date: Apr 2010
Location: new york city
Device: nook, ipad
|
If it's a one-time download, as opposed to something you're trying to automate for repeated download, you could also just use dotepub (http://dotepub.com/).
This, combined with the 'automatic adding' feature that calibre added recently makes it extremely easy to go directly from a web page article to an epub in calibre. (I literally just hit the dotepub bookmark on my toolbar when I want to save an article and 20 seconds later it's sitting in my calibre library.) Only caveat is that the entire content needs to be on the page you're viewing - most sites have a 'single page' or 'print version' option, but some don't. ETA: I just realized that the file is already an epub embedded in a website. Not quite the same thing. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Source URL / Automated Download | Demosthenex | Library Management | 10 | 04-26-2012 07:27 AM |
Print friendly url unrelated to regular url (and javascript) | sleepless | Recipes | 3 | 12-03-2011 10:43 AM |
Simple download from rss url recipe | BloodOmen | Recipes | 0 | 02-16-2011 09:21 PM |
Gen3 CyBook Gen3 User Guide Download URL | HarryT | Bookeen | 11 | 01-13-2010 02:27 PM |
Connect Reader Software - Download URL | NatCh | Sony Reader | 13 | 10-17-2007 11:41 AM |