01-edu / public

📚 @01-edu's Public Repository
http://public.01-edu.org/
197 stars 425 forks source link

wget subject #2568

Closed MamDrame closed 1 month ago

MamDrame commented 1 month ago

wget

Issue: Unspecified Flag --convert-links in Audit

Description

The audit mentions the use of the --convert-links flag in the command ./wget --mirror --convert-links http://corndog.io/, but this flag is not specified or explained in the project's instructions.

Expected Behavior

The project's instructions should include and explain the use of the --convert-links flag if it is required for the audit.

Actual Behavior

The --convert-links flag is present in the audit but is not mentioned in the project's instructions.

MSilva95 commented 1 month ago

Hello @MamDrame! This flag will convert all the links (including those in CSS) to work locally. I will add info on the subject for the student to know what to do! Thank you for the feedback!

MamDrame commented 1 month ago

for more info: --convert-links After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc. Each link will be changed in one of the two ways: The links to files that have been downloaded by Wget will be changed to refer to the file they point to as a relative link.

Example: if the downloaded file /foo/doc.html links to /bar/img.gif, also downloaded, then the link in doc.html will be modified to point to ../bar/img.gif. This kind of transformation works reliably for arbitrary combinations of directories.

The links to files that have not been downloaded by Wget will be changed to include host name and absolute path of the location they point to.

Example: if the downloaded file /foo/doc.html links to /bar/img.gif (or to ../bar/img.gif), then the link in doc.html will be modified to point to http://hostname/bar/img.gif.

Because of this, local browsing works reliably: if a linked file was downloaded, the link will refer to its local name; if it was not downloaded, the link will refer to its full Internet address rather than presenting a broken link. The fact that the former links are converted to relative links ensures that you can move the downloaded hierarchy to another directory.

Note that only at the end of the download can Wget know which links have been downloaded. Because of that, the work done by -k will be performed at the end of all the downloads.

source: https://explainshell.com/explain?cmd=wget+--convert-links#:~:text=%2Dk%20%2D%2Dconvert%2Dlinks%20After,non%2DHTML%20content%2C%20etc.