mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-29 22:15:21 -04:00
Merge pull request #669 from FliegendeWurst/fix-issue-235
add command: --parser option (fixes #235)
This commit is contained in:
commit
36f0646501
6 changed files with 73 additions and 21 deletions
|
@ -265,14 +265,14 @@ def load_main_index_meta(out_dir: Path=OUTPUT_DIR) -> Optional[dict]:
|
|||
|
||||
|
||||
@enforce_types
|
||||
def parse_links_from_source(source_path: str, root_url: Optional[str]=None) -> Tuple[List[Link], List[Link]]:
|
||||
def parse_links_from_source(source_path: str, root_url: Optional[str]=None, parser: str="auto") -> Tuple[List[Link], List[Link]]:
|
||||
|
||||
from ..parsers import parse_links
|
||||
|
||||
new_links: List[Link] = []
|
||||
|
||||
# parse and validate the import file
|
||||
raw_links, parser_name = parse_links(source_path, root_url=root_url)
|
||||
raw_links, parser_name = parse_links(source_path, root_url=root_url, parser=parser)
|
||||
new_links = validate_links(raw_links)
|
||||
|
||||
if parser_name:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue