gildas-lormeau / single-file-cli

CLI tool for saving a faithful copy of a complete web page in a single HTML file (based on SingleFile)
GNU Affero General Public License v3.0
539 stars 57 forks source link

Output file names when using `--urls-file` #48

Open YenForYang opened 10 months ago

YenForYang commented 10 months ago

Is there a way to specify output file names when using --urls-file? I tried adding the filename after the url and it doesn't appear to work (no error either).

oderyn commented 9 months ago

Do you mean the ability to set the pattern of the filename or have the filename output to the terminal when single-file is run?

To define the filename template, you would do something like this:

--output-directory="/path/to/output/directory/" --filename-template="{url-pathname}.html"

The cool thing is that you can also add a directory structure to --filename-template. In fact, the url-pathname will use the directory structure from the website when it saves the file.