Commit Graph

5 Commits

Author SHA1 Message Date
Doc
acaccb8cdd refactor: Improve 4chan downloader with better error handling and resource management
- Replace log.Fatal() with proper error returns for better control flow
- Add type safety with dedicated structs instead of interface{} maps
- Implement proper HTTP client with timeout configuration
- Fix goroutine closure variable capture issues
- Add input validation for URL format and board extraction
- Ensure destination directory exists before writing files
- Improve error messages with context and proper error wrapping
- Add resource cleanup with defer statements for HTTP responses
- Separate concerns into dedicated functions for better organization
- Use filepath.Join for cross-platform path handling
- Add comprehensive logging throughout the application

This refactoring makes the downloader more robust, maintainable, and production-ready while preserving all original functionality.
2025-10-03 19:33:16 +02:00
Doc
3bf0dd812f Changed concurrency to use a waitgroup 2024-03-20 09:51:29 +01:00
Doc
6b415b0ef1 Post request and writing data to disk is now async 2024-03-19 13:50:34 +01:00
Doc
806840d947 Check if url flag is valid 2024-03-19 12:55:02 +01:00
Doc
9c6778a8c9 Init 2024-03-12 08:56:20 +01:00