Skip to main content

📖 WattPDL — Wattpad Story Downloader

Simpan cerita favoritmu jadi file .txt, .docx, atau .epub, lengkap atau per chapter, secara offline.

Python PyPI License Platform Status Tests

✨ Tentang Project

WattPDL adalah script Python ringan yang mengunduh chapter dari cerita Wattpad pilihanmu, lalu menyimpannya sebagai file .txt polos, dokumen Word .docx, atau ebook .epub yang bersih dan rapi. Kamu bisa unduh seluruh cerita jadi satu file, semua chapter terpisah dalam satu .zip, atau cukup chapter tertentu yang kamu pilih sendiri. Tidak perlu login, tidak perlu API key, cukup link atau ID ceritanya.

"Karena cerita yang bagus layak dibaca kapan saja, bahkan tanpa internet."

🎯 Fitur

Fitur Keterangan
🎨 Tampilan CLI rapi Panel, tabel info cerita, dan warna berkat library rich
🧩 4 mode unduh Semua jadi 1 file, semua terpisah dalam .zip, pilih beberapa chapter, atau cukup 1 chapter
📄 3 pilihan format Simpan sebagai .txt polos, dokumen Word .docx, atau ebook .epub
📁 Pilih folder simpan Default ke folder Downloads sistem, bisa dikustomisasi
🔄 Auto-retry Chapter gagal dicoba ulang hingga 3× sebelum dilewati
📊 Progress bar animasi Spinner, persentase, jumlah chapter, dan estimasi waktu tersisa
📋 Ringkasan akhir Panel laporan chapter yang gagal (jika ada) setelah selesai
🗂 Nama file aman Karakter ilegal otomatis dihapus dari nama file
🔗 Link sumber tersimpan URL cerita dicantumkan di header file hasil
⚡ Tanpa login Pakai endpoint publik Wattpad, jadi tidak butuh akun
↻ Resume otomatis Kalau proses terhenti di tengah jalan, jalankan ulang cerita yang sama — chapter yang sudah berhasil tidak diunduh ulang
⚙️ Ingat preferensi Folder simpan & format file terakhir otomatis dipakai lagi di sesi berikutnya
🤖 Mode non-interaktif Bisa dijalankan lewat argumen command line untuk scripting/otomatisasi, tanpa perlu jawab prompt

📦 Requirements

  • Python 3.9 atau lebih baru
  • Koneksi internet
  • Library: requests, rich, python-docx, EbookLib — otomatis terinstall bareng wattpdl, tidak perlu diinstall manual

Belum pernah pakai terminal? Ikuti ini dulu

🪟 Cara buka terminal di Windows
  1. Tekan tombol Windows, ketik PowerShell, lalu tekan Enter
  2. Jendela hitam/biru akan terbuka. Itu tempat kamu mengetik perintah
  3. Semua perintah python ... atau pip ... di panduan ini diketik di jendela itu, lalu tekan Enter
🍎 Cara buka terminal di macOS
  1. Tekan Cmd + Spasi, ketik Terminal, lalu tekan Enter
  2. Ketik perintah-perintah di panduan ini di situ, lalu tekan Enter
🐧 Cara buka terminal di Linux

Tekan Ctrl + Alt + T, atau cari aplikasi "Terminal" di menu aplikasi.

Belum punya Python?

  1. Buka python.org/downloads dan unduh versi terbaru
  2. Khusus Windows: saat instalasi, centang dulu kotak "Add Python to PATH" di layar pertama sebelum klik Install. Kalau ini kelewat, perintah python nanti tidak akan dikenali
  3. Setelah selesai install, buka terminal (lihat panduan di atas) lalu cek dengan:
python --version
# atau
python3 --version

Kalau muncul angka versi (misal Python 3.12.1), berarti sudah siap.

🚀 Instalasi

Cara A: Install dari PyPI (paling gampang)

pip install wattpdl

Kalau pip tidak dikenali, coba:

python -m pip install wattpdl

Kalau muncul error externally-managed-environment (biasanya di Linux):

pip install wattpdl --break-system-packages

Setelah terinstall, command wattpdl langsung bisa dipakai dari terminal mana saja — lanjut ke bagian Cara Pakai.

Cara B: Install dari source (untuk development / mau lihat/ubah kode)

1. Ambil kode project ini

Punya Git terinstall
git clone https://github.com/nekonaru/wattpdl.git
cd wattpdl
Tidak punya Git
  1. Buka halaman repository di GitHub
  2. Klik tombol hijau Code → pilih Download ZIP
  3. Ekstrak file ZIP yang terunduh ke folder pilihanmu
  4. Di terminal, masuk ke folder hasil ekstrak, contoh:
cd Downloads/wattpdl-main

2. Install dalam mode "editable"

pip install -e .

Sama seperti Cara A, tambahkan --break-system-packages di akhir kalau muncul error externally-managed-environment.

Ini juga mendaftarkan command wattpdl, tapi mengambil kodenya langsung dari folder ini — cocok kalau kamu mau modifikasi kode dan langsung lihat hasilnya tanpa install ulang.

🖥️ Cara Pakai

Jalankan:

wattpdl

Kalau kamu install dari source tanpa pip install -e ., jalankan lewat python -m wattpdl dari dalam folder src/ — tapi cara Editable Install di atas lebih direkomendasikan.

Masukkan link atau ID cerita saat diminta:

Link atau ID cerita Wattpad: https://www.wattpad.com/story/123456789-judul-cerita

atau cukup ID-nya:

Link atau ID cerita Wattpad: 123456789

Pilih mode unduh:

  1  Semua chapter → 1 file gabungan
  2  Semua chapter → file terpisah per chapter, dikemas .zip
  3  Pilih beberapa chapter → 1 file gabungan
  4  Pilih 1 chapter saja

Pilih mode [1/2/3/4] (1):
  • Mode 1: cara paling umum, seluruh cerita jadi satu file rapi dari chapter pertama sampai terakhir
  • Mode 2: cocok kalau mau baca per chapter terpisah, hasilnya satu .zip berisi file per chapter
  • Mode 3: muncul daftar semua judul chapter bernomor, lalu ketik nomor yang mau diunduh, bisa gabung koma dan rentang, contoh: 1,3,5-8
  • Mode 4: muncul daftar semua judul chapter, ketik satu nomor untuk unduh chapter itu saja

Pilih format file:

  1  Teks polos (.txt)
  2  Dokumen Word (.docx)
  3  Ebook (.epub)

Pilih format file [1/2/3] (1):

Pilih folder penyimpanan:

Folder default: C:\Users\user\Downloads
Tekan Enter untuk pakai folder itu, atau ketik path lain:

Tekan Enter untuk simpan di Downloads, atau ketik path kustom seperti:

  • Windows: D:\Cerita\Wattpad
  • Linux/macOS: /home/user/cerita

Tunggu proses selesai:

⠋ Chapter 24...              ████████████████░░░░░░░░░░░░░░  53.3%  24/45  0:00:12  sisa 0:00:11

Done! 🎉

╔══════ 🎉 Berhasil!  Semua chapter tersimpan ══════╗
║ 📁 File tersimpan di   C:\Users\user\Downloads\Judul_Cerita.txt ║
║ ✅ Berhasil            45/45                                    ║
║ ⏱️  Waktu total         2m 18d                                   ║
╚═══════════════════════════════════════════════════╝

↻ Resume Otomatis

Kalau proses unduh terhenti di tengah jalan (koneksi putus, terminal ditutup, laptop mati), setiap chapter yang sudah berhasil diunduh tersimpan otomatis di ~/.wattpdl/progress/<id_cerita>.json.

Jalankan lagi dengan cerita yang sama (ID/link sama), dan WattPDL akan:

  • Melewati chapter yang sudah berhasil (dipakai dari cache, tidak fetch ulang)
  • Hanya mengunduh chapter yang belum berhasil / gagal sebelumnya

File progress otomatis dihapus setelah semua chapter berhasil diunduh dalam satu sesi. Kalau mau paksa unduh ulang dari awal, hapus manual folder ~/.wattpdl/progress/.

⚙️ Preferensi Tersimpan

Folder simpan dan format file terakhir yang kamu pilih otomatis tersimpan di ~/.wattpdl/config.json, dan dipakai lagi sebagai default di sesi berikutnya — gak perlu isi ulang tiap kali jalanin script.

🤖 Mode Non-Interaktif (Scripting/Otomatisasi)

Selain mode tanya-jawab, WattPDL juga bisa dijalankan lewat argumen command line — cocok buat dijadwalkan (cron/Task Scheduler) atau dipanggil dari script lain.

wattpdl --id 398440633 --mode 1 --format docx

Argumen yang tersedia:

Argumen Keterangan
--id ID atau link cerita Wattpad. Mengisi ini mengaktifkan mode non-interaktif.
--mode {1,2,3,4} 1 = semua jadi 1 file, 2 = semua terpisah .zip, 3 = pilih beberapa chapter, 4 = pilih 1 chapter
--format {txt,docx,epub} Format file output. Default: dari config tersimpan, atau txt
--chapters Nomor chapter untuk --mode 3, contoh: 1,3,5-8
--chapter Nomor chapter untuk --mode 4, contoh: 5
--output-dir Folder penyimpanan custom. Default: dari config tersimpan, atau folder Downloads

Contoh lain:

# Unduh semua chapter sebagai .zip terpisah
wattpdl --id 398440633 --mode 2 --format txt

# Unduh chapter 1, 3, dan 5-8 saja, jadi 1 file gabungan
wattpdl --id 398440633 --mode 3 --chapters 1,3,5-8 --format docx

# Unduh chapter 10 saja, simpan ke folder custom
wattpdl --id 398440633 --mode 4 --chapter 10 --output-dir "D:\Cerita Wattpad"

# Unduh semua chapter jadi 1 ebook .epub
wattpdl --id 398440633 --mode 1 --format epub

# Lihat semua opsi
wattpdl --help

📂 Struktur Output

Nama dan bentuk file yang dihasilkan tergantung mode & format yang kamu pilih:

Mode Format .txt Format .docx Format .epub
1 - Semua, gabungan Judul_Cerita.txt Judul_Cerita.docx Judul_Cerita.epub
2 - Semua, terpisah Judul_Cerita.zip (isi: .txt per chapter) Judul_Cerita.zip (isi: .docx per chapter) Judul_Cerita.zip (isi: .epub per chapter)
3 - Beberapa chapter Judul_Cerita_pilihan.txt Judul_Cerita_pilihan.docx Judul_Cerita_pilihan.epub
4 - Satu chapter Judul_Cerita_Ch003_Nama_Chapter.txt Judul_Cerita_Ch003_Nama_Chapter.docx Judul_Cerita_Ch003_Nama_Chapter.epub

Isi file gabungan (mode 1 & 3): judul cerita, penulis, dan sumber di bagian atas, lalu tiap chapter dipisah dengan penanda #####.

Judul Cerita
oleh Nama Penulis
Sumber : https://www.wattpad.com/story/123456789

==================================================

##### Judul Chapter 1 #####

Isi teks chapter 1...

##### Judul Chapter 2 #####

Isi teks chapter 2...

Di versi .docx, judul cerita jadi heading utama dan tiap chapter otomatis jadi Heading 1 dengan halaman baru, tinggal buka di Word atau Google Docs dan langsung enak dibaca.

Di versi .epub, cerita jadi ebook standar dengan daftar isi (table of contents) otomatis per chapter — tinggal buka di aplikasi pembaca ebook favoritmu (Google Play Books, Apple Books, Calibre, dll).

Isi zip (mode 2): satu file per chapter, bernomor urut sesuai posisi di cerita, plus 000_info.txt/000_info.docx/000_info.epub berisi judul, penulis, dan sumber. Ekstensi file di dalam zip mengikuti format yang dipilih saat menjalankan script (.txt, .docx, atau .epub):

Judul_Cerita.zip
├── 000_info.txt
├── 001_Judul_Chapter_1.txt
├── 002_Judul_Chapter_2.txt
└── ...

🗺️ Default Folder per OS

Sistem Operasi Folder Default
🪟 Windows C:\Users\<namauser>\Downloads
🍎 macOS /Users/<namauser>/Downloads
🐧 Linux /home/<namauser>/Downloads

⚠️ Troubleshooting

Masalah Solusi
ModuleNotFoundError: No module named 'requests' Jalankan pip install requests
ModuleNotFoundError: No module named 'rich' Jalankan pip install rich
Library 'python-docx' belum terinstall Jalankan pip install python-docx (cuma dibutuhkan kalau memilih format .docx)
Library 'EbookLib' belum terinstall Jalankan pip install EbookLib (cuma dibutuhkan kalau memilih format .epub)
Error 404 / "Tidak ada chapter ditemukan" Pastikan ID/link benar & cerita tidak di-private
Folder tidak bisa dibuat Cek path valid & kamu punya izin tulis di sana
Proses macet di satu chapter Cek koneksi internet, jalankan ulang, progress akan lanjut

📝 Catatan Penting

  • ID cerita adalah angka di URL Wattpad, tepat setelah /story/
  • Script memakai endpoint publik, tidak butuh login atau API key
  • Jeda 0.5 detik antar chapter sudah diatur untuk menghindari rate limit server, jangan dihapus
  • Script ini hanya untuk membaca cerita milik sendiri atau cerita publik secara offline. Hormati hak cipta penulis

🛠️ Dibuat dengan

Python Requests Rich python--docx Wattpad API

🗂️ Struktur Project

wattpdl/
├── src/
│   └── wattpdl/
│       ├── __init__.py       # metadata package (__version__)
│       ├── __main__.py       # entry untuk `python -m wattpdl`
│       ├── app.py            # orkestrasi alur program (main())
│       ├── api.py            # komunikasi ke Wattpad public API
│       ├── writers.py        # konversi teks & penulisan file .txt/.docx/.zip
│       ├── cli.py            # tampilan terminal (rich), interaksi dengan user
│       ├── cli_args.py       # parsing argumen untuk mode non-interaktif
│       ├── config.py         # simpan preferensi user (folder simpan, format)
│       └── progress.py       # cache progress unduhan untuk fitur resume
├── requirements.txt          # daftar dependency (untuk referensi manual)
├── pyproject.toml            # metadata package + build config + ruff
├── tests/
│   ├── __init__.py
│   └── test_wattpdl.py       # unit test (pytest)
├── .github/
│   └── workflows/
│       ├── tests.yml         # CI: test, lint, & build check otomatis
│       └── publish.yml       # auto-publish ke PyPI saat rilis baru
├── CONTRIBUTING.md           # panduan kontribusi
├── LICENSE
└── README.md

Prinsip pemisahan modul:

  • api.py — tidak tahu apa-apa soal tampilan (rich), murni fetch data
  • writers.py — tidak melakukan request jaringan, murni konversi & tulis file
  • cli.py — semua interaksi dengan user & tampilan progress bar
  • cli_args.py — parsing & validasi argumen command line, tidak ada logika bisnis
  • config.py / progress.py — baca-tulis file JSON di ~/.wattpdl/, tidak tahu soal CLI atau jaringan
  • app.py — menyatukan semuanya, tanpa logika bisnis sendiri (dipanggil lewat command wattpdl setelah install)

🧪 Testing

Ada unit test untuk fungsi-fungsi inti (parsing ID cerita, validasi nama file, parsing pilihan chapter, konversi HTML ke teks, config, progress/resume, parsing argumen CLI, dll).

pip install -e .[dev]
pytest tests/ -v
ruff check .

🤝 Kontribusi

Mau bantu kembangin WattPDL? Baca CONTRIBUTING.md untuk struktur project dan alur kontribusi.

❓ FAQ

Apakah ini legal / aman dipakai?

Script ini memakai endpoint publik Wattpad yang sama seperti saat kamu baca cerita lewat browser, jadi tidak meng-hack apa pun. Tapi gunakan secara bertanggung jawab: unduh untuk bacaan pribadi/offline, dan hormati hak cipta penulis. Jangan sebar ulang atau jual isi cerita orang lain.

Apakah butuh akun Wattpad?

Tidak. Tidak perlu login atau API key sama sekali.

Cerita private / dihapus, bisa diunduh?

Tidak. Script hanya bisa mengakses cerita yang memang publik.

Prosesnya lama, kenapa?

Ada jeda 0.5 detik antar chapter (sengaja, biar tidak membebani server Wattpad). Untuk cerita ratusan chapter, wajar kalau prosesnya makan waktu beberapa menit.

Mode dan format mana yang sebaiknya dipilih?
  • Mau baca dari awal sampai akhir kayak buku → Mode 1, format .epub paling enak dibaca di aplikasi ebook
  • Mau tiap chapter jadi file sendiri-sendiri → Mode 2
  • Cuma butuh beberapa chapter tertentu (misal lagi ulang baca bagian tertentu) → Mode 3
  • Cuma penasaran satu chapter → Mode 4
  • Mau baca santai di HP/tablet pakai aplikasi ebook (Google Play Books, Apple Books, dll) → pilih format .epub
  • Mau edit atau print rapi pakai Word → pilih format .docx
  • Mau file kecil dan simpel, atau mau dibaca di aplikasi e-reader/notes → pilih format .txt

👤 Author

Nicolas Dwi Dharma
Nicolas Dwi Dharma
github.com/nekonaru

📄 License

Distributed under the MIT License. See LICENSE for more information.

Made with by Nicolas Dwi Dharma

Star ⭐ repo ini kalau project ini membantumu!

Metadata

Release files for wattpdl 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wattpdl 1.2.1
File Size Uploaded
wattpdl-1.2.1.tar.gz 30.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wattpdl 1.2.1
File Interpreter ABI Platform
wattpdl-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 54.5 kB

Release files / wattpdl-1.2.1.tar.gz

Download URL wattpdl-1.2.1.tar.gz
Size 30.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bbf5101709da403d3dfc89595f369600dac44ba7f2b77af3976081c3e177dad7
BLAKE2b-256 checksum
How to use checksums
d49e14576ab2e0120374a2ba485dc0fa4238b57b3d3bbed4a9f3528c8699a81d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / wattpdl-1.2.1-py3-none-any.whl

Download URL wattpdl-1.2.1-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3cbdd6f240c48cf23f4300d10c5d28fe32b79fa42eaeb76c64110ed2fca1632
BLAKE2b-256 checksum
How to use checksums
3dab5622c924467e4e6682f7087a49eb460e8107ddd1521075df61164b2f26f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page