Skip to main content

A script to scrape Reigokai Translations and generate EPUB/PDF eBooks.

Project description

WordPress Scraper & Ebook Generator 📚

Python Version License: MIT PRs Welcome Project Status: Maintained

A powerful Python script to scrape all posts from a specific WordPress category, bypass Cloudflare protection, and compile everything into a clean, offline-readable EPUB and PDF.

Perfect for archiving your favorite web novel, blog series, or serialized story (like "Living SAFELY") for offline reading on your Kindle, tablet, or phone.

✨ Features

  • WordPress API Scraper: Fetches all posts from a specific category ID
  • Cloudflare Bypass: Uses a CF_CLEARANCE cookie to access protected sites
  • Incremental Fetching: Saves posts to a local JSON file
  • Multi-Format Ebook Generation:
    • EPUB: A clean, Kindle-friendly file with a navigable table of contents
    • PDF: A universally readable document for any device
  • Smart & Configurable: Easily set the target category ID, output names, and posts-per-page
  • Clean Output: Uses BeautifulSoup to parse and clean HTML

🛠️ Prerequisites

Before you begin, you will need:

  1. Python 3.8+
  2. Git (to clone this repository)
  3. A valid CF_CLEARANCE cookie from the target website

Getting the CF_CLEARANCE Cookie

  1. Open your web browser
  2. Go to the target website
  3. Open Developer Tools (F12 or Ctrl+Shift+I)
  4. Click on the "Network" tab
  5. Refresh the page
  6. Click on the first request
  7. Go to "Headers" tab under "Request Headers"
  8. Find and copy the cf_clearance cookie value

How to find the CF_CLEARANCE cookie

🚀 Installation & Setup

1. Clone Repository

git clone https://github.com/yourusername/living-safely-scraper.git
cd living-safely-scraper

2. Install Dependencies

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt

3. Configure

Create .env file:

CF_CLEARANCE=your_cookie_value_here

4. Run

python scraper.py

📂 Output Structure

reigakou-scraper-scraper/
├── Your_book_ebook/
│   ├── Your_book.epub
│   └── Your_book.pdf
├── Your_book_api.json
├── Your_book_posts.json
├── scraper.py
├── requirements.txt
├── .env
└── README.md

⚠️ Disclaimer: Use responsibly. For personal archiving only. Cookie expires periodically.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eigokai_scraper-1.0.3.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eigokai_scraper-1.0.3-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file eigokai_scraper-1.0.3.tar.gz.

File metadata

  • Download URL: eigokai_scraper-1.0.3.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for eigokai_scraper-1.0.3.tar.gz
Algorithm Hash digest
SHA256 eddf2831212039c69efc8406e8244ec873655b064917a0869202e785fbefecfa
MD5 d3e4b094f9479107d2d5f9d54db0724f
BLAKE2b-256 17f43440629d1a79d680b04087ce81fc34e39436dfc47a5d2b1bba1747974b1f

See more details on using hashes here.

File details

Details for the file eigokai_scraper-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for eigokai_scraper-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 875db3011f69b9c2b7a1e39ab8b89891761ef2aec729bb25d7e5bf138915a3ce
MD5 d953b2e4ff788ded39b2b35372c377e6
BLAKE2b-256 f4dd90657b4099ff41fbf91eddbfaeca7d39b70c01511fb3ffe2ca5e73b84118

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page