mirror of
https://github.com/Garmelon/PFERD.git
synced 2025-11-04 14:42:49 +01:00
Add basic auth to KIT-IPD crawler
This commit is contained in:
@@ -20,6 +20,11 @@ GROUP.add_argument(
|
||||
metavar="REGEX",
|
||||
help="href-matching regex to identify downloadable files",
|
||||
)
|
||||
GROUP.add_argument(
|
||||
"--basic-auth",
|
||||
action="store_true",
|
||||
help="enable basic authentication",
|
||||
)
|
||||
GROUP.add_argument(
|
||||
"target",
|
||||
type=str,
|
||||
@@ -50,5 +55,11 @@ def load(
|
||||
if args.link_regex:
|
||||
section["link_regex"] = str(args.link_regex)
|
||||
|
||||
if args.basic_auth:
|
||||
section["auth"] = "auth:kit-ipd"
|
||||
parser["auth:kit-ipd"] = {}
|
||||
auth_section = parser["auth:kit-ipd"]
|
||||
auth_section["type"] = "simple"
|
||||
|
||||
|
||||
SUBPARSER.set_defaults(command=load)
|
||||
|
||||
Reference in New Issue
Block a user