Commit 6a8db34
authored
refactor: improve code structure with response validation function
Refactored the script to improve modularity and readability.
- Moved image validation logic to a separate function `is_valid_image_response`
- Keeps `fetch_image` function focused on download and file saving
- Prepares the script for future enhancements and better testability1 parent cce04b5 commit 6a8db34
1 file changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
0 commit comments