1.0
This commit is contained in:
319
README.md
319
README.md
@@ -1,2 +1,319 @@
|
||||
# autodownloaderpdf
|
||||
# AutoDownloaderPDF - JOBS EASIER
|
||||
|
||||
Aplikasi otomasi desktop untuk mengunduh, mengkonversi, dan mengunggah dokumen PDF secara massal dari berbagai sistem online. Tool ini dirancang untuk mempermudah pekerjaan administratif dengan otomasi proses yang berulang-ulang.
|
||||
|
||||
## 📋 Daftar Isi
|
||||
|
||||
- [Fitur Utama](#fitur-utama)
|
||||
- [Persyaratan Sistem](#persyaratan-sistem)
|
||||
- [Instalasi](#instalasi)
|
||||
- [Konfigurasi](#konfigurasi)
|
||||
- [Penggunaan](#penggunaan)
|
||||
- [Struktur Proyek](#struktur-proyek)
|
||||
- [Modul-Modul Tersedia](#modul-modul-tersedia)
|
||||
- [Lisensi](#lisensi)
|
||||
|
||||
## ✨ Fitur Utama
|
||||
|
||||
- **Download Otomatis**: Mengunduh dokumen dari berbagai website secara otomatis
|
||||
- **Konversi PDF**: Mengonversi dokumen ke format PDF dengan rendering browser modern
|
||||
- **Autentikasi Terpusat**: Mengelola login ke multiple sistem (MLite, JKN, dll)
|
||||
- **Operasi Massal**: Mendukung bulk insert dan bulk upload untuk efisiensi
|
||||
- **Upload Terintegrasi**: Mengunggah file yang sudah diproses ke sistem tujuan
|
||||
- **GUI Intuitif**: Antarmuka Tkinter yang user-friendly
|
||||
- **Konfigurasi Fleksibel**: File konfigurasi terpusat untuk kemudahan setup
|
||||
- **Multi-threading**: Dukungan proses paralel untuk performa optimal
|
||||
- **Text-to-Speech Notifications**: Notifikasi audio untuk status operasi
|
||||
|
||||
## 🖥️ Persyaratan Sistem
|
||||
|
||||
### Software Requirements
|
||||
- **Python**: 3.8 atau lebih baru
|
||||
- **OS**: Windows (Primary), Linux/Mac (Partial Support)
|
||||
- **Database**: MySQL/MariaDB
|
||||
|
||||
### Hardware Requirements
|
||||
- RAM: Minimal 2GB (4GB disarankan)
|
||||
- Storage: Minimal 1GB untuk operasi dan cache
|
||||
- Internet: Koneksi stabil diperlukan
|
||||
|
||||
## 📦 Instalasi
|
||||
|
||||
### 1. Clone Repository
|
||||
```bash
|
||||
git clone <repository-url>
|
||||
cd autodownloaderpdf
|
||||
```
|
||||
|
||||
### 2. Buat Virtual Environment (Recommended)
|
||||
```bash
|
||||
python -m venv venv
|
||||
|
||||
# Windows
|
||||
venv\Scripts\activate
|
||||
|
||||
# Linux/Mac
|
||||
source venv/bin/activate
|
||||
```
|
||||
|
||||
### 3. Install Dependencies
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Packages yang diinstal:
|
||||
- **beautifulsoup4**: Web scraping dan parsing HTML
|
||||
- **requests**: HTTP client untuk API calls
|
||||
- **mysql-connector-python**: Koneksi database MySQL
|
||||
- **requests-toolbelt**: Utility untuk HTTP requests
|
||||
- **pyttsx3**: Text-to-speech engine
|
||||
- **playwright**: Browser automation untuk rendering PDF
|
||||
|
||||
### 4. Setup qPDF (REQUIRED)
|
||||
qPDF adalah PDF manipulation utility yang digunakan untuk konversi dan manipulasi file PDF. Instalasi:
|
||||
|
||||
```bash
|
||||
# Windows (menggunakan Chocolatey)
|
||||
choco install qpdf
|
||||
|
||||
# Linux (Ubuntu/Debian)
|
||||
sudo apt-get install qpdf
|
||||
|
||||
# Linux (Fedora/RHEL)
|
||||
sudo dnf install qpdf
|
||||
|
||||
# Mac
|
||||
brew install qpdf
|
||||
```
|
||||
|
||||
Jika Chocolatey belum terinstall, install terlebih dahulu dengan membuka Command Prompt (Run as Administrator) dan jalankan:
|
||||
```bash
|
||||
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
|
||||
```
|
||||
|
||||
## ⚙️ Konfigurasi
|
||||
|
||||
### File Konfigurasi (app.config)
|
||||
|
||||
Buat file `app.config` di root directory dengan struktur berikut:
|
||||
|
||||
```ini
|
||||
[Database]
|
||||
Host = localhost
|
||||
Port = 3306
|
||||
Database = your_database_name
|
||||
User = your_db_user
|
||||
Password = your_db_password
|
||||
|
||||
[Paths]
|
||||
base_path = /path/to/downloads
|
||||
|
||||
[Url]
|
||||
jknurl = https://jkn.example.com
|
||||
mlite = https://mlite.example.com
|
||||
|
||||
[UserPass]
|
||||
USERNAME = admin_username
|
||||
PASSWORD = admin_password
|
||||
```
|
||||
|
||||
### Load Konfigurasi dalam Code
|
||||
```python
|
||||
from config_loader import Config
|
||||
|
||||
cfg = Config('app.config')
|
||||
print(cfg.Database.host)
|
||||
print(cfg.Url.jkn)
|
||||
```
|
||||
|
||||
## 🚀 Penggunaan
|
||||
|
||||
### Menjalankan Aplikasi
|
||||
|
||||
```bash
|
||||
# Jalankan dari command line
|
||||
python main.py
|
||||
|
||||
# Atau jika menggunakan executable (hasil build PyInstaller)
|
||||
JOBS_EASIER.exe
|
||||
```
|
||||
|
||||
### Workflow Dasar
|
||||
|
||||
1. **Autentikasi**: Login ke sistem yang diperlukan (MLite, JKN, dll)
|
||||
2. **Pilih Operasi**: Tentukan jenis operasi yang ingin dilakukan
|
||||
3. **Konfigurasi Parameter**: Sesuaikan pengaturan sesuai kebutuhan
|
||||
4. **Jalankan Proses**: Mulai download/upload dengan monitoring real-time
|
||||
5. **Review Hasil**: Cek status dan log untuk verifikasi
|
||||
|
||||
## 📁 Struktur Proyek
|
||||
|
||||
```
|
||||
autodownloaderpdf/
|
||||
├── main.py # Entry point aplikasi
|
||||
├── config_loader.py # Module untuk load konfigurasi
|
||||
├── app.config # File konfigurasi (buat sendiri)
|
||||
├── requirements.txt # Python dependencies
|
||||
├── LICENSE # Aladdin Free Public License
|
||||
├── README.md # Dokumentasi ini
|
||||
└── SubModules/
|
||||
├── __init__.py
|
||||
├── auth.py # Autentikasi ke berbagai sistem
|
||||
├── veronisa.py # Download dan konversi PDF
|
||||
├── ralan.py # Upload dengan processing
|
||||
├── ralannoupload.py # Processing tanpa upload (Ralan)
|
||||
├── ranap.py # Upload ke sistem RANAP
|
||||
├── ranapnoupload.py # Processing tanpa upload (RANAP)
|
||||
├── massinsert.py # Bulk insert ke database
|
||||
├── massupload.py # Bulk upload ke sistem
|
||||
└── tes.py # Module testing
|
||||
```
|
||||
|
||||
## 🔧 Modul-Modul Tersedia
|
||||
|
||||
### `auth.py` - Autentikasi
|
||||
Menangani login dan manajemen session ke berbagai sistem:
|
||||
- Login ke MLite
|
||||
- Login ke JKN
|
||||
- Manajemen cookies
|
||||
- Penyimpanan credentials terenkripsi
|
||||
|
||||
```python
|
||||
from SubModules import auth
|
||||
|
||||
cookies = auth.auth(username, password)
|
||||
auth.save_cookies_to_file(cookies)
|
||||
```
|
||||
|
||||
### `veronisa.py` - Download & Konversi PDF
|
||||
Fungsi utama untuk download dokumen dan konversi ke PDF:
|
||||
- Web scraping menggunakan BeautifulSoup
|
||||
- Render PDF menggunakan Playwright
|
||||
- Multi-threading untuk performa
|
||||
- Parse tanggal dan folder management
|
||||
|
||||
```python
|
||||
from SubModules import veronisa
|
||||
|
||||
# Jalankan proses download dan konversi
|
||||
veronisa.main_process(start_date, end_date)
|
||||
```
|
||||
|
||||
### `ralan.py` - Upload RALAN
|
||||
Mengunggah dokumen RALAN ke sistem:
|
||||
- Login guest ke JKN
|
||||
- Upload file dengan multipart encoding
|
||||
- Validasi dan error handling
|
||||
|
||||
### `ralannoupload.py` - Processing RALAN (Tanpa Upload)
|
||||
Processing dokumen RALAN tanpa mengunggah hasil
|
||||
|
||||
### `ranap.py` - Upload RANAP
|
||||
Mengunggah dokumen RANAP ke sistem target
|
||||
|
||||
### `ranapnoupload.py` - Processing RANAP (Tanpa Upload)
|
||||
Processing dokumen RANAP tanpa mengunggah hasil
|
||||
|
||||
### `massinsert.py` - Bulk Insert Database
|
||||
Memasukkan data secara massal ke database MySQL
|
||||
|
||||
### `massupload.py` - Bulk Upload Otomatis
|
||||
Mengunggah multiple file dalam satu operasi
|
||||
|
||||
### `tes.py` - Testing Module
|
||||
Module untuk testing dan debugging fitur-fitur
|
||||
|
||||
## 🔐 Keamanan
|
||||
|
||||
- Simpan `app.config` dengan permission terbatas
|
||||
- Jangan simpan password dalam source code
|
||||
- Gunakan environment variables untuk credentials penting
|
||||
- Encrypt cookies sebelum menyimpan di file
|
||||
- Validate user input sebelum diproses
|
||||
|
||||
## 📊 Database Connection
|
||||
|
||||
Aplikasi ini menggunakan MySQL untuk penyimpanan data. Pastikan:
|
||||
|
||||
1. MySQL server sudah berjalan
|
||||
2. Database sudah dibuat dengan schema yang sesuai
|
||||
3. User MySQL memiliki permission yang tepat
|
||||
4. Konfigurasi koneksi sudah benar di `app.config`
|
||||
|
||||
```python
|
||||
import mysql.connector
|
||||
|
||||
# Koneksi otomatis via config_loader
|
||||
conn = mysql.connector.connect(
|
||||
host=cfg.Database.host,
|
||||
user=cfg.Database.user,
|
||||
password=cfg.Database.password,
|
||||
database=cfg.Database.database
|
||||
)
|
||||
```
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
### Error: "Module not found"
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### Error: "Config file not found"
|
||||
- Pastikan `app.config` ada di direktori root
|
||||
- Periksa path dan nama file
|
||||
|
||||
### Error: "Database connection failed"
|
||||
- Verifikasi MySQL server berjalan
|
||||
- Cek kredensial di `app.config`
|
||||
- Pastikan database dan user sudah dibuat
|
||||
|
||||
### Error: "Browser/Playwright issue"
|
||||
```bash
|
||||
playwright install
|
||||
```
|
||||
|
||||
### GUI tidak muncul di Linux
|
||||
- Pastikan dependencies GUI sudah terinstall
|
||||
- Coba jalankan dengan display yang sesuai: `DISPLAY=:0 python main.py`
|
||||
|
||||
## 🤝 Kontribusi
|
||||
|
||||
Untuk berkontribusi pada proyek ini:
|
||||
|
||||
1. Fork repository
|
||||
2. Buat feature branch (`git checkout -b feature/AmazingFeature`)
|
||||
3. Commit changes (`git commit -m 'Add some AmazingFeature'`)
|
||||
4. Push ke branch (`git push origin feature/AmazingFeature`)
|
||||
5. Buat Pull Request
|
||||
|
||||
## 📄 Lisensi
|
||||
|
||||
Proyek ini didistribusikan di bawah **Aladdin Free Public License (AFPL)**.
|
||||
|
||||
Lihat file [LICENSE](LICENSE) untuk informasi detail.
|
||||
|
||||
**Copyright © 2025 Andy Cahyono Putra**
|
||||
|
||||
---
|
||||
|
||||
## 📞 Dukungan
|
||||
|
||||
Untuk pertanyaan atau issue, silakan:
|
||||
- Buka issue di repository
|
||||
- Hubungi maintainer proyek
|
||||
- Cek dokumentasi dan FAQ
|
||||
|
||||
## 📝 Changelog
|
||||
|
||||
### Version 1.0.0
|
||||
- Initial release
|
||||
- Core features: Download, Convert, Upload
|
||||
- Multi-module architecture
|
||||
- GUI implementation
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: 2026-03-06
|
||||
**Status**: Active Development
|
||||
|
||||
|
||||
Reference in New Issue
Block a user