codelucas / newspaper

newspaper3k is a news, full-text, and article metadata extraction in Python 3. Advanced docs:
https://goo.gl/VX41yK
MIT License
14.06k stars 2.11k forks source link

Configurable base .news-scraper path #462

Open KillerCodeMonkey opened 6 years ago

KillerCodeMonkey commented 6 years ago

I am executing newspaper3k on amazon aws lambda.

There you are only allowed to create folders and writefiles to the /tmp folder.

@codelucas Maybe it is possible to make the base of the TOP_DIRECTORY path in the settings.py configurable, like adding an ENV-Variable?

codelucas commented 6 years ago

Yea that is possible. We actually used to not write to /tmp and write to the ~ homedir but that was changed recently due to more of our users having permissions problems. We can make this configurable.

U know the ideal solution to minimize user hassle would be to have an exception handler in the tmp directory creation step! If we catch some sort of a permissions error we can just attempt to write to either /tmp or ~ accordingly.

But we should also have a configurable path in settings.py like you said

ekingery commented 6 years ago

Issue #384 is related and could be a helpful reference for anyone stuck on this issue.