UltimaScraper icon indicating copy to clipboard operation
UltimaScraper copied to clipboard

Support different run modes

Open E0911CD45B19686 opened this issue 5 years ago • 2 comments

Occasionally my scheduled task will time out, and this results in no downloads because the script first scrapes everything and then downloads everything (and if the site is slow scraping can take a long time). This isn't that big a deal, I can just increase the timeout or re-run on failure.

But I thought I'd ask if you'd be open to some architecture changes (by me/community) to support running in different modes. My current ideas are:

  • Treat each creator as their own process to scrape and download. You could still parallelize by doing multiple creators at once (tee-hee 🤭)
  • Move (or allow) some settings to be passed by CLI flags (e.g., the name of a creator(s). Use case here is more easily spreading the load over a full day by scraping a couple creators every couple of hours instead of all of them at once)
  • Refactor some code to work more like a library then the above (or anything else) could be done by anyone and not have to be supported officially

E0911CD45B19686 avatar Mar 21 '21 13:03 E0911CD45B19686

Another one: New mode to only scrape stories, combined with CLi agruments to run the script hourly and not miss story content.

E0911CD45B19686 avatar Mar 23 '21 00:03 E0911CD45B19686

You can run the script like a library, but I haven't documented it at all.

It would run something like this

You gotta create the api, then pass it to start_datascraper The json config will contain the settings you want to run. For example you can change which models you want to scrape or which user you want to auth in as.

        site_name_lower = "onlyfans"
        session_manager = api_helper.session_manager()
        api = OnlyFans.start(session_manager)
        api.set_auth_details(
            json_auth)
        apis = [api]
        valid = main_datascraper.start_datascraper(
            json_config, site_name_lower, apis=apis)

UltimaHoarder avatar Mar 23 '21 01:03 UltimaHoarder