Wattpad story scraper

I wanted to read a story available on Wattpad.. Sadly Wattpad makes people read from phone devices (Android or iOS) instead of giving an epub file. And I really dislike reading from my mobile phone, I wanted to use my e-reader.

I searched on the Internet and I found quite a few videos on Youtube with complicated instructions to download a .jar and find the epub inside (it didn’t work for me, maybe they changed the website). Or to download the book into the mobile and then get the file (which is not easy anymore with Android 5.x, or at least I couldn’t do it easily. I think that I had to root my phone which I haven’t done it yet).

Finally I found the solution: a fantastic Python script! Called wattpad-ebook-scraper.

I know that people without handy Python (Window users) might have problems to use it… but for many other people it’s a very convenient way to create an epub file from Wattpad.

3 comments to Wattpad story scraper

  • Thanks for mentioning my project!

    I think the .jar method still works, but it only gets you the all the chapters as plain text files, not as html or epub. I made my project because I wanted to read the books on my Kindle and wanted to preserve all the formatting in the stories. You can run the epub through calibre to convert the epub file to whatever format you need (such as mobi for a Kindle).

  • strider

    Patch to beautify epub. Add smartypants.py to scrape.py directory.
    (BTW: It’s ILLEGAL, not ILLEAGAL).

    diff -crN OLD/wattpad-ebook-scraper-master/scrape.py NEW/wattpad-ebook-scraper-master/scrape.py
    *** OLD/wattpad-ebook-scraper-master/scrape.py 2015-11-11 01:18:34.000000000 +0100
    — NEW/wattpad-ebook-scraper-master/scrape.py 2015-11-11 12:48:50.688431057 +0100
    ***************
    *** 7,12 ****
    — 7,13 —-
    import dateutil.parser
    from genshi.input import HTML

    + import smartypants
    import ez_epub

    # Setup session to not hit Android download app page
    ***************
    *** 80,86 ****
    print(‘Downloading “{chapter_title}”: {chapter_id}’.format(chapter_title=chapter_title, chapter_id=chapter_id))

    chapter_req = session.get(API_STORYTEXT, params={‘id’: chapter_id})
    ! chapter_html = chapter_req.content

    section = ez_epub.Section()
    — 81,87 —-
    print(‘Downloading “{chapter_title}”: {chapter_id}’.format(chapter_title=chapter_title, chapter_id=chapter_id))

    chapter_req = session.get(API_STORYTEXT, params={‘id’: chapter_id})
    ! chapter_html = smartypants.smartypants(chapter_req.content)

    section = ez_epub.Section()

  • strider

    – add smartypants.py to scrape.py directory
    – edit scrape.py
    * add “import smartypants”
    * change “chapter_html = chapter_req.content” to “chapter_html = smartypants.smartypants (chapter_req.content)”
    That’s it!

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>