def __init__(self, sub_list, black_list, top_sort_method, score_limit, sample_size, existing_users, save_path,
imgur_client, previously_found):
"""
A class that searches supplied subreddits for top posts (of the user set period) and collects the names of users
who have submitted posts that scored above the set score limit. It will then download the user specified sample
size of posts and display them on the second page. Also has methods to add any found users to the main download
users list as well as methods to exclude certain users that the user wishes not to include. Parts of this class
work similar to the parts of the main program, but on a smaller scale. For instance, when a user is found an
instance of the User class is created for them with preset settings supplied. This class is only used
temporarily and if the user is added to the main list the instance is destroyed and a new instance made with the
proper overall settings.
:param sub_list: The sub list supplied by the UserFinderGUI which is to be searched for top posts
:param black_list: A list of users who are not to be included even if their posts reach the score limit
:param top_sort_method: The period of top posts to be searched (eg: day, week, etc.)
:param score_limit: The limit that post scores must be above to be considered
:param sample_size: The number of posts that are to be downloaded if the conditions are met
:param existing_users: A list of users already added to the main GUI lists that will be emitted from search
:param save_path: The save path of the special UserFinder directory where the user finder posts are stored
:param imgur_client: An instance of the imgure client that is supplied to temporarily created users
:param previously_found: A list of users that have been previously found and will not be included in the search
"""
super().__init__()
self.reddit = praw.Reddit(user_agent='python:DownloaderForReddit:%s (by /u/MalloyDelacroix)' % __version__,
client_id='frGEUVAuHGL2PQ', client_secret=None)
self.sub_list = sub_list
self.black_list = black_list
self.top_sort_method = top_sort_method
self.score_limit = score_limit
self.sample_size = sample_size
self.existing_users = existing_users
self.save_path = save_path
self.imgur_client = imgur_client
self.previously_found_users = previously_found
self.validated_subreddits = []
self.found_users = []
self.queue = Queue()
self.content_count = 0
评论列表
文章目录