Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turning on "--keep-dirs" gives no output #771

Open
DesBw opened this issue Dec 20, 2024 · 3 comments
Open

Turning on "--keep-dirs" gives no output #771

DesBw opened this issue Dec 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@DesBw
Copy link

DesBw commented Dec 20, 2024

I am trying on the command line. Turning on the "--keep-dirs" option seems to stop trafilatura from extracting (fetching).

trafilatura -i links/file-with-links.txt --output-dir textOut <-- produces an output (as expected).
But, trafilatura -i links/file-with-links.txt --keep-dirs --output-dir textOut doesn't produce anything.

I am using version 1.12.2 on the mac with python 3.13.

@DesBw DesBw changed the title Turning on "--keep-dirs" stops trafilatura Turning on "--keep-dirs" gives no output Dec 20, 2024
@DesBw
Copy link
Author

DesBw commented Dec 20, 2024

The same result with version 2.0.

@adbar adbar added the bug Something isn't working label Dec 23, 2024
@adbar
Copy link
Owner

adbar commented Dec 23, 2024

Your command just writes a file named .txt in the target directory. --keep-dirs is useless if you download files from the internet, there are no directory to keep. It is best used with data already available on disk.

@DesBw
Copy link
Author

DesBw commented Dec 27, 2024

I see. I was hopping it would help with the file naming even there is no directory to keep.
Thank you for the clarification.
But, I think it should not block the extraction even if it doesn't do anything. A little tweaking of the code might me useful so that the fetching will proceed while the option is ignored. Alternatively, a little disclaimer on the user manual can help the user not to use the option for crawling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants