A powerful Flask-based backend service for the Comixie comic reading platform, providing a robust API for comic discovery, chapter reading, and PDF export functionality.
-
Comic Search
- Full-text search across comic titles
- Integration with ReadAllComics.com for comprehensive comic data
- Real-time search results with title, URL, and slug information
- Error handling for failed searches
-
Comic Details
- Detailed comic information including title, genres, and publisher
- Comic descriptions and cover images
- Complete chapter listings with individual chapter URLs
- Metadata extraction from comic pages
-
Chapter Content
- Full chapter image extraction
- Sequential page ordering
- High-quality image URL retrieval
- Support for variable page counts per chapter
-
Image Processing
- Automatic image fetching and processing
- Error handling for missing or corrupted images
- Optimized image delivery
-
PDF Generation
- Convert entire chapters to PDF format
- Automatic image resizing and aspect ratio preservation
- Optimized PDF layout (200x300 page size)
- Professional PDF formatting with proper page breaks
-
Download Features
- Direct PDF download functionality
- Custom filename generation based on chapter slug
- Streaming PDF delivery for large files
- Home Page Feed
- Latest comics discovery
- Paginated comic listings
- Comic metadata including publication dates
- Thumbnail image support
- Web Scraping
- CloudScraper integration for anti-bot protection
- BeautifulSoup HTML parsing
- Robust error handling and timeout management
- Regular expression pattern matching
- Framework: Flask with CORS support
- Web Scraping: CloudScraper + BeautifulSoup4
- Image Processing: Pillow (PIL)
- PDF Generation: ReportLab
- HTTP Client: CloudScraper (anti-detection)
- HTML Parsing: BeautifulSoup4
- Pattern Matching: Python regex
-
Prerequisites
- Python 3.8+
- pip
- virtualenv (recommended)
-
Environment Setup
# Create and activate virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install flask flask-cors cloudscraper beautifulsoup4 pillow reportlab
-
Running the Server
python main.py
The server will start on
http://localhost:5000 -
Testing the API
# Search for comics curl "http://localhost:5000/api/search?q=batman" # Get comic details curl "http://localhost:5000/api/details/batman-dark-knight" # Health check curl "http://localhost:5000/api/health"
- Page Size: 200x300 pixels (optimized for mobile reading)
- Image Scaling: Automatic aspect ratio preservation
- Timeout: 30 seconds per image download
- CloudScraper: Anti-detection web scraping
- Timeout: 10 seconds for search requests
- User Agent: Rotating user agents for better success rates
- Reading Progress Tracking
- Bookmark system
- Reading history
- Progress synchronization
We welcome contributions! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This project is for educational purposes only. Please respect the terms of service of the websites being scraped and ensure compliance with applicable laws and regulations.
- ReadAllComics.com for comic content
- Flask community for the excellent web framework
- CloudScraper developers for anti-detection capabilities
- ReportLab team for PDF generation tools
- BeautifulSoup contributors for HTML parsing