Skip to content

AttributeError: type object 'MediaDownloader' has no attribute 'global_counter' #30

@alemelis

Description

@alemelis

Hello, getting the following error when trying to run the example from the readme

$ python3.9 download.py --subreddit pics --sort_by top --sort_time all --max_post_downloads 40 --download_dir ./images

Downloading 40 posts from /r/pics sorted by top|all to ./images/pics/

pics|top|all|n=40:   0%|                                                                                                                                                       | 0/40 [00:00<?, ?it/s]multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/local/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/Users/alemelis/WallpapersFromReddit/downloaders.py", line 41, in download_post
    if MediaDownloader.global_counter.get_counter_value() >= MediaDownloader.max_posts_download:
AttributeError: type object 'MediaDownloader' has no attribute 'global_counter'
"""

I'm on macOS 12.5.1, running python3.9 (same error with 3.8 and 3.10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions