pierre-delecto / stash_theporndb_scraper

A python script to scrape Stash data from thePornDB
MIT License
51 stars 30 forks source link

Scan enhancements #11

Closed rg9400 closed 3 years ago

rg9400 commented 3 years ago

I made some changes, will list them out below

  1. I changed how Include Performers in Title formatted the scene name. This might be a preference thing, but I submitted it just in case. I put a "-" between the performer names and the scene title to act as a separator, and I no longer remove performer names from the scene title. Up to you if that format makes sense or not.

  2. I added all the new scan options into the function. I also added an option to call StashInterface with those options by just throwing them as flags in argparse. I don't particularly like how that ended up looking, and the flags are a bit messy. It does work, but there is probably a more elegant way of handling those.

  3. I created a new script called tpdb.py. This is just a very, very basic Flask API on top of the StashInterface and ScrapeScene scripts. For now, I just added a single endpoint with some basic POST parameters to configure scans as well as do a basic ScrapeScenes call. This can easily be extended to give a proper interface to do run particular tasks with various configurable parameters. I've been using this in my automation flow where I curl this endpoint from filebot after it processes downloads from NZBGet. I was inspired by your NZBGet script but wanted to run FileBot to rename the files and organize them first.

  4. I added a preliminary Dockerfile for the above Flask script. I'm not super familiar with best practices, so this is just something someone can use to locally build the Flask API server since it just uses the configuration file found in the user's folder. Maybe, in the future, this can be enhanced to create something that can actually be hosted on a Docker repo like Docker Hub/GHCR, but maybe the Flask API should be improved a bit before then to be able to run all the different tasks via web API requests vs using Python directly.

I did testing with my usecase and everything works, but let me know your thoughts

jeremymeyers commented 3 years ago

@rg9400 you might want to do your work on the https://github.com/ThePornDatabase/stash_theporndb_scraper fork as they are more active

jeremymeyers commented 3 years ago

(also if you arent on the stash discord you are welcome to join)