Skip to content

Commit

Permalink
cleaner progress log display
Browse files Browse the repository at this point in the history
  • Loading branch information
stared committed Dec 8, 2022
1 parent f3edd33 commit 8ee9aac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
19 changes: 7 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,13 @@ In case when the same option is specified both in the YAML file and in as a comm
When you run BDFR manually from your Terminal, if you pass `--progress-bar` you will get a short summary of results with a progress bar, instead of more detailed logs.

```
✅ 646🔼 Colorado lake porn by None
✅ 643🔼 Crater lake, Oregon [OC] 6000x4000 byBroomesPhotography
✅ 642🔼 Lake Louis, Alberta, Canada - Aug 4/21 by hallidc
✅ 118637🔼 TIME’s new cover. by sudde004
✅ 87051🔼 “Safety glasses” that I made for my wife’s Optometry office. by alanbrendan
✅ 71576🔼 I'd like to propose this type of design for this sub's logo. by None
✅ 66352🔼 The new National Geographic cover by Crazylyric
✅ 65328🔼 This "Seatbelts save lives" campaign by harschil
✅ 65106🔼 Poster for better shark culling laws by mladish
✅ 62722🔼 Really cool design made by Daren Newman for the Tokyo Olympics by None
✅ 61632🔼 Let us make this International Fixed Calendar work by BanX
✅ 60414🔼 Very direct ads from the City of Toronto against littering by the_ravenant
✅ 52🔼 Helianthus Annuus: A beautiful sunflower grown from a birdseed mix. [OC]
❌ 124🔼 Olives
✅ 20🔼 Carpobrotus chilensis, Marina, California [3023x4032] [OC]
✅ 0🔼 Game made with preserved ferns, acorns, meadowsweet flowers and moss [OC]
✅ 223🔼 Plinia cauliflora "Jabuticaba" and bees
✅ 367🔼 Frozen saxifraga cotyledon - or "fjelldronning" aka mountain queen - on a r...
✅ 135🔼 Hibiscus syriacus - Minerva Rose of Sharon [OC]
Subreddits: 100%|███████████████████████████████████████| 5/5 [00:45<00:00, 9.09s/subreddit]
```
Expand Down
3 changes: 2 additions & 1 deletion bdfr/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def download(self):
for generator in tqdm(self.reddit_lists, desc="Subreddits", unit="subreddit", colour="red"):
desc = generator.url if isinstance(generator, praw.models.ListingGenerator) else "Posts"
for submission in tqdm(list(generator), desc=desc, unit="post", colour="green", leave=False):
log_str = f'{submission.score}🔼 {submission.title} by {submission.author}'
title_short = submission.title[:60] + (submission.title[60:] and '...')
log_str = f'{submission.score:5d}🔼 {title_short}'
try:
if self._download_submission(submission):
logger_progress_bar.info(f'✅ {log_str}')
Expand Down

0 comments on commit 8ee9aac

Please sign in to comment.