Support for TV show episode information scraping

This commit is contained in:
C5H12O5
2023-08-11 01:13:16 +08:00
parent ed168eea92
commit 98cb4b54b8
7 changed files with 136 additions and 17 deletions

View File

@ -13,8 +13,8 @@ from scraper.functions import findfunc
_logger = logging.getLogger(__name__)
# define default scraping config file path
_currentdir = os.path.dirname(os.path.realpath(__file__))
_configpath = os.path.join(_currentdir, "../scrapeflows")
_basedir = os.path.dirname(os.path.realpath(__file__))
_configpath = os.path.join(_basedir, "../scrapeflows")
# define maximum number of results to return
_maxlimit = 10
@ -46,9 +46,9 @@ def scrape():
# parse --input argument as JSON
jsoninput = json.loads(args.input)
initialval = {
"title": jsoninput.get("title", None),
"title": jsoninput["title"],
"season": jsoninput.get("season", 0),
"episode": jsoninput.get("episode", None),
"episode": jsoninput.get("episode", 1),
"year": jsoninput.get("original_available", None),
"lang": args.lang,
"limit": maxlimit,