bibanon / BASC-Archiver

Python-based Imageboard (4chan) complete thread archiver.
https://pypi.python.org/pypi/BASC-Archiver/
135 stars 18 forks source link

Add `file_count()` method in py4chan #28

Open antonizoon opened 8 years ago

antonizoon commented 8 years ago

In fourchan.py, there happen to be these notes in line 246:

# TODO: extend BASC-py4chan to give us this number directly
self.threads[thread_id]['total_files'] = len(list(thread['thread'].filenames()))

And line 255:

# TODO: extend BASC-py4chan to give us this number directly
self.threads[thread_id]['total_files'] = len(list(running_thread.filenames()))

Apparently, it might be a good idea to have a file_count() method in basc_py4chan.Thread that counts the amount of replies where has_file returns True.