josephrcox / easy-reddit-downloader

Simple headless Reddit post downloader
MIT License
70 stars 9 forks source link

Program doesn't handle when subreddits are done and don't have new posts #32

Closed josephrcox closed 1 year ago

josephrcox commented 1 year ago

Right now, the program will just hold up if you ask for more posts than are on the subreddit. Fix that with checking the response size and adding that to the checkIfDone function.

DataAddict42 commented 7 months ago

@josephrcox This issue is still occurring for me at least, this is a log from one attempt where it just exits back to the terminal after the available posts are exhausted:

👋 Welcome to the easiest & most customizable Reddit Post Downloader!

😎 Contribute @ https://github.com/josephrcox/easy-reddit-downloader

🤔 Confused? Check out the README @ https://github.com/josephrcox/easy-reddit-downloader#readme


User config: {"testingMode":false,"testingModeOptions":{"subredditList":["AskReddit","pics"],"numberOfPosts":25,"sorting":"new","time":"month","repeatForever":true,"timeBetweenRuns":30000},"download_post_list_options":{"enabled":false,"repeatForever":false,"timeBetweenRuns":3000},"local_logs":true,"local_logs_naming_scheme":{"showDateAndTime":true,"showSubreddits":true,"showNumberOfPosts":true},"file_naming_scheme":{"showDateAndTime":true,"showAuthor":true,"showTitle":true,"showScore":true},"download_self_posts":true,"download_media_posts":true,"download_link_posts":true,"download_youtube_videos_experimental":true,"download_comments":true,"separate_clean_nsfw":false,"redownload_posts":false,"detailed_logs":true}

You are on the latest stable version (v0.3.2)

👀 Requesting posts from
            https://www.reddit.com/r/privacytoolsIO/top/.json?sort=top&t=month&limit=10&after=

Analyzing post with title: A New Era. Why r/PTIO Is Now A Restricted Sub.) and URL: https://www.reddit.com/r/privacytoolsIO/comments/qk7qrj/a_new_era_why_rptio_is_now_a_restricted_sub/

Post has type: self due to their post hint: undefined and domain: self.privacytoolsIO

Analyzing post with title: Android: Disable fingerprint screen unlock but keep it for programs) and URL: https://www.reddit.com/r/privacytoolsIO/comments/qk5fqt/android_disable_fingerprint_screen_unlock_but/

Post has type: self due to their post hint: undefined and domain: self.privacytoolsIO

Still downloading posts from privacytoolsIO... (1/10)

    - subreddit: privacytoolsIO

    - self: 1

    - media: 0

    - link: 0

    - failed: 0

    - skipped_due_to_duplicate: 0

    - skipped_due_to_fileType: 0

Still downloading posts from privacytoolsIO... (2/10)