顯示具有 wget 標籤的文章。 顯示所有文章
顯示具有 wget 標籤的文章。 顯示所有文章

2023年3月24日 星期五

[研究]wget2 v1.99.1安裝、試用 (Windows 10上Ubuntu 22.04.2 LTS子系統)

[研究]wget2 v1.99.1安裝、試用 (Windows 10上Ubuntu 22.04.2 LTS子系統)

2023-03-24

在一個安裝 Ubuntu 22.04.2 LTS子系統的 Windows 10上,安裝 wget2 v1.99.1 版,下載測試。

預設有wget 1.21.2 可以安裝,但沒有 wget2  1.99.1 可安裝,要先做 sudo apt-get update更新後,才有 wget2  1.99.1 可安裝。


uroot@WIN10:~$ pwd
/home/uroot
uroot@WIN10:~$ sudo apt-cache policy wget2
[sudo] password for uroot:
N: Unable to locate package wget2
uroot@WIN10:~$ sudo apt-cache policy wget
wget:
  Installed: 1.21.2-2ubuntu1
  Candidate: 1.21.2-2ubuntu1
  Version table:
 *** 1.21.2-2ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
uroot@WIN10:~$ sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [14.1 MB]
Get:6 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [693 kB]
Get:7 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [143 kB]
Get:8 http://security.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [9016 B]
Get:9 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [645 kB]
Get:10 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [100 kB]
Get:11 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 c-n-f Metadata [588 B]
Get:12 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [714 kB]
Get:13 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [118 kB]
Get:14 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [14.1 kB]
Get:15 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [19.4 kB]
Get:16 http://security.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [4068 B]
Get:17 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [228 B]
Get:18 http://archive.ubuntu.com/ubuntu jammy/universe Translation-en [5652 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy/universe amd64 c-n-f Metadata [286 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [217 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy/multiverse Translation-en [112 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 c-n-f Metadata [8372 B]
Get:23 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [949 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [205 kB]
Get:25 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [13.8 kB]
Get:26 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [684 kB]
Get:27 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [107 kB]
Get:28 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 c-n-f Metadata [584 B]
Get:29 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [895 kB]
Get:30 http://archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [179 kB]
Get:31 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [18.4 kB]
Get:32 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [24.1 kB]
Get:33 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [6312 B]
Get:34 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [444 B]
Get:35 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [40.7 kB]
Get:36 http://archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [9800 B]
Get:37 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [392 B]
Get:38 http://archive.ubuntu.com/ubuntu jammy-backports/restricted amd64 c-n-f Metadata [116 B]
Get:39 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [19.5 kB]
Get:40 http://archive.ubuntu.com/ubuntu jammy-backports/universe Translation-en [14.0 kB]
Get:41 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [392 B]
Get:42 http://archive.ubuntu.com/ubuntu jammy-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 26.3 MB in 38s (692 kB/s)
Reading package lists... Done
uroot@WIN10:~$ sudo apt-cache policy wget2
wget2:
  Installed: (none)
  Candidate: 1.99.1-2.2
  Version table:
     1.99.1-2.2 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages

uroot@WIN10:~$ sudo apt-get -y install wget2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libgpgme11 libwget0
The following NEW packages will be installed:
  libgpgme11 libwget0 wget2
0 upgraded, 3 newly installed, 0 to remove and 49 not upgraded.
Need to get 375 kB of archives.
After this operation, 1024 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libgpgme11 amd64 1.16.0-1.2ubuntu4 [136 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libwget0 amd64 1.99.1-2.2 [143 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy/universe amd64 wget2 amd64 1.99.1-2.2 [95.8 kB]
Fetched 375 kB in 2s (157 kB/s)
Selecting previously unselected package libgpgme11:amd64.
(Reading database ... 24120 files and directories currently installed.)
Preparing to unpack .../libgpgme11_1.16.0-1.2ubuntu4_amd64.deb ...
Unpacking libgpgme11:amd64 (1.16.0-1.2ubuntu4) ...
Selecting previously unselected package libwget0.
Preparing to unpack .../libwget0_1.99.1-2.2_amd64.deb ...
Unpacking libwget0 (1.99.1-2.2) ...
Selecting previously unselected package wget2.
Preparing to unpack .../wget2_1.99.1-2.2_amd64.deb ...
Unpacking wget2 (1.99.1-2.2) ...
Setting up libwget0 (1.99.1-2.2) ...
Setting up libgpgme11:amd64 (1.16.0-1.2ubuntu4) ...
Setting up wget2 (1.99.1-2.2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
uroot@WIN10:~$

uroot@WIN10:~$ wget2 --version
GNU Wget2 1.99.1 - multithreaded metalink/file/website downloader

+digest +https +ssl/gnutls +ipv6 +iri +large-file +nls -ntlm -opie +psl +iconv +idn2 +zlib +lzma +brotlidec +bzip2 +http2 +gpgme
uroot@WIN10:~$ wget2
Nothing to do - goodbye
uroot@WIN10:~$

測試

wget2 --no-check-certificate --mirror -p --convert-links -r https://www.xxx.idv.tw  



結果完全不會進行網站下載,測試網路是通的。

Windows 上的 Linux 子系統,相容性畢竟無法和真正的 Linux 相同。

(完)

相關

[研究]wget2 v1.99.1安裝、試用 (Windows 10上Ubuntu 22.04.2 LTS子系統)
https://shaurong.blogspot.com/2023/03/wget2-v1991-windows-10ubuntu-22042-lts.html

[研究]wget 1.21.2 與 wget2 v1.99.1網站下載軟體安裝、試用 (Ubuntu 22.04.2 LTS)
https://shaurong.blogspot.com/2023/03/wget2-v1991-ubuntu-22042-lts.html

[研究]wget2 v2.0.1網站下載軟體安裝、試用 (Rocky Linux 9.1)
https://shaurong.blogspot.com/2023/03/wget2-v201-rocky-linux-91.html

[研究]wget 1.21.1 網站下載軟體安裝、測試 (Rocky Linux 9.1)
https://shaurong.blogspot.com/2023/03/wget-1211-rocky-linux-91.html

[研究]Wget for Windows 1.21.3試用
https://shaurong.blogspot.com/2023/03/wget-for-windows-1213.html


[研究]wget 1.21.2 與 wget2 v1.99.1網站下載軟體安裝、試用 (Ubuntu 22.04.2 LTS)

[研究]wget 1.21.2 與 wget2 v1.99.1網站下載軟體安裝、試用 (Ubuntu 22.04.2 LTS)

2023-03-21

本篇CentOS應該通用。

GNU Wget2:是 GNU Wget 的下一代版本,支援多執行緒下載、HTTP/2、IPv6 等功能,是一款強大的命令列工具。

Wget - 維基百科,自由的百科全書
https://zh.wikipedia.org/wiki/Wget#Wget2

GNU Wget2 2.0.0 釋出於 2021 年 9 月 26 日。比起Wget1.x支援以下協定和技術:

  • HTTP/2
  • HTTP壓縮
  • 並列連接
  • 使用HTTP頭欄位If-Modified-Since
  • TCP Fast Open

官方網站:https://www.gnu.org/software/wget/

官方網站:https://gitlab.com/gnuwget/wget2

********************************************************************************

Rocky Linux 9.1 上安裝 wget2 太麻煩了,要用 tar.gz 自己編譯,看看 Ubuntu 是否容易些。

apt有提供 wget

user1@ubuntu22042:~$ sudo apt-cache policy wget
wget:
  Installed: 1.21.2-2ubuntu1
  Candidate: 1.21.2-2ubuntu1
  Version table:
 *** 1.21.2-2ubuntu1 500
        500 http://tw.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
user1@ubuntu22042:~$ 


安裝

apt有提供 wget2

user1@ubuntu22042:~$ sudo apt-cache policy wget2
wget2:
  Installed: (none)
  Candidate: 1.99.1-2.2
  Version table:
     1.99.1-2.2 500
        500 http://tw.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
user1@ubuntu22042:~$ 

安裝


user1@ubuntu22042:~$ sudo apt-get -y install wget2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libwget0
The following NEW packages will be installed:
  libwget0 wget2
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 239 kB of archives.
After this operation, 643 kB of additional disk space will be used.
Get:1 http://tw.archive.ubuntu.com/ubuntu jammy/universe amd64 libwget0 amd64 1.99.1-2.2 [143 kB]
Get:2 http://tw.archive.ubuntu.com/ubuntu jammy/universe amd64 wget2 amd64 1.99.1-2.2 [95.8 kB]
Fetched 239 kB in 0s (2739 kB/s) 
Selecting previously unselected package libwget0.
(Reading database ... 176153 files and directories currently installed.)
Preparing to unpack .../libwget0_1.99.1-2.2_amd64.deb ...
Unpacking libwget0 (1.99.1-2.2) ...
Selecting previously unselected package wget2.
Preparing to unpack .../wget2_1.99.1-2.2_amd64.deb ...
Unpacking wget2 (1.99.1-2.2) ...
Setting up libwget0 (1.99.1-2.2) ...
Setting up wget2 (1.99.1-2.2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
user1@ubuntu22042:~$ 
值

執行

user1@ubuntu22042:~$ wget2   
Nothing to do - goodbye
user1@ubuntu22042:~$ 

檢視版本

user1@ubuntu22042:~$ wget2 --version
GNU Wget2 1.99.1 - multithreaded metalink/file/website downloader

+digest +https +ssl/gnutls +ipv6 +iri +large-file +nls -ntlm -opie +psl +iconv +idn2 +zlib +lzma +brotlidec +bzip2 +http2 +gpgme 
user1@ubuntu22042:~$ 

檢視參數

user1@ubuntu22042:~$ wget2 --help
GNU Wget2 V1.99.1 - multithreaded metalink/file/website downloader

Usage: wget [options...] <url>...

Startup:
  -a  --append-output       File where messages are appended to, '-' for STDOUT
  -B  --base                Base for relative URLs read from input-file
                              or from command line
      --config              List of config files. (default: ~/.wget2rc)
  -d  --debug               Print debugging messages.(default: off)
  -e  --execute             Wget compatibility option, not needed for Wget
      --force-atom          Treat input file as Atom Feed. (default: off) (NEW!)
      --force-css           Treat input file as CSS. (default: off) (NEW!)
  -F  --force-html          Treat input file as HTML. (default: off)
      --force-metalink      Treat input file as Metalink. (default: off) (NEW!)
      --force-rss           Treat input file as RSS Feed. (default: off) (NEW!)
      --force-sitemap       Treat input file as Sitemap. (default: off) (NEW!)
      --fsync-policy        Use fsync() to wait for data being written to
                              the pysical layer. (default: off) (NEW!)
  -h  --help                Print this help.
      --input-encoding      Character encoding of the file contents read with
                              --input-file. (default: local encoding)
  -i  --input-file          File where URLs are read from, - for STDIN.
      --local-db            Read or load databases
  -o  --output-file         File where messages are printed to,
                              '-' for STDOUT.
  -q  --quiet               Print no messages except debugging messages.
                              (default: off)
      --stats-all           Print all stats (default: off)
                              Additional format supported:
                              --stats-all[=[FORMAT:]FILE]
      --stats-dns           Print DNS stats. (default: off)
                              Additional format supported:
                              --stats-dns[=[FORMAT:]FILE]
      --stats-ocsp          Print OCSP stats. (default: off)
                              Additional format supported:
                              --stats-ocsp[=[FORMAT:]FILE]
      --stats-server        Print server stats. (default: off)
                              Additional format supported:
                              --stats-server[=[FORMAT:]FILE]
      --stats-site          Print site stats. (default: off)
                              Additional format supported:
                              --stats-site[=[FORMAT:]FILE]
      --stats-tls           Print TLS stats. (default: off)
                              Additional format supported:
                              --stats-tls[=[FORMAT:]FILE]
  -v  --verbose             Print more messages. (default: on)
  -V  --version             Display the version of Wget and exit.

Download:
  -A  --accept              Comma-separated list of file name suffixes or
                              patterns.
      --accept-regex        Regex matching accepted URLs.
      --ask-password        Print prompt for password
      --backups             Make backups instead of overwriting/increasing
                              number. (default: 0)
      --bind-address        Bind to sockets to local address.
                              (default: automatic)
      --cache               Enabled using of server cache. (default: on)
      --chunk-size          Download large files in multithreaded chunks.
                              (default: 0 (=off)) Example:
                              wget --chunk-size=1M
      --clobber             Enable file clobbering. (default: on)
      --connect-timeout     Connect timeout in seconds.
      --content-on-error    Save response body even on error status.
                              (default: off)
  -c  --continue            Continue download for given files. (default: off)
  -k  --convert-links       Convert embedded URLs to local URLs.
                              (default: off)
      --cut-file-get-vars   Cut HTTP GET vars from file names. (default: off)
      --cut-url-get-vars    Cut HTTP GET vars from URLs. (default: off)
      --delete-after        Don't save downloaded files. (default: off)
      --dns-caching         Caching of domain name lookups. (default: on)
      --dns-timeout         DNS lookup timeout in seconds.
  -D  --domains             Comma-separated list of domains to follow.
      --exclude-domains     Comma-separated list of domains NOT to follow.
      --filter-mime-type    Specify a list of mime types to be saved or ignored
      --filter-urls         Apply the accept and reject filters on the URL
                              before starting a download. (default: off)
      --follow-tags         Scan additional tag/attributes for URLs,
                              e.g. --follow-tags="img/data-500px,img/data-hires
      --force-progress      Force progress bar.
                              (default: off)
      --http2-request-window
                            Max. number of parallel streams per HTTP/2
                              connection. (default: 30)
      --ignore-case         Ignore case when matching files. (default: off)
      --ignore-tags         Ignore tag/attributes for URL scanning,
                              e.g. --ignore-tags="img,a/href
  -4  --inet4-only          Use IPv4 connections only. (default: off)
  -6  --inet6-only          Use IPv6 connections only. (default: off)
      --iri                 Wget dummy option, you can't switch off
                              international support
  -l  --level               Maximum recursion depth. (default: 5)
      --local-encoding      Character encoding of environment and filenames.
      --max-redirect        Max. number of redirections to follow.
                              (default: 20)
      --max-threads         Max. concurrent download threads.
                              (default: 5) (NEW!)
  -m  --mirror              Turn on mirroring options -r -N -l inf
      --netrc               Load credentials from ~/.netrc if not given.
                              (default: on)
  -O  --output-document     File where downloaded content is written to,
                              '-O'  for STDOUT.
  -p  --page-requisites     Download all necessary files to display a
                              HTML page
      --parent              Ascend above parent directory. (default: on)
      --password            Password for Authentication.
                              (default: empty password)
      --post-data           Data to be sent in a POST request.
      --post-file           File with data to be sent in a POST request.
      --prefer-family       Prefer IPv4 or IPv6. (default: none)
      --progress            Type of progress bar (bar, dot, none).
                              (default: none)
      --proxy               Enable support for *_proxy environment variables.
                              (default: on)
      --random-wait         Wait 0.5 up to 1.5*<--wait> seconds between
                              downloads (per thread). (default: off)
      --read-timeout        Read and write timeout in seconds.
  -r  --recursive           Recursive download. (default: off)
      --regex-type          Regular expression type. Possible types are
                              posix or pcre. (default: posix)
  -R  --reject              Comma-separated list of file name suffixes or
                              patterns.
      --reject-regex        Regex matching rejected URLs.
      --remote-encoding     Character encoding of remote files
                              (if not specified in Content-Type HTTP header
                              or in document itself)
      --report-speed        Output bandwidth as TYPE. TYPE can be bytes
                              or bits. --progress MUST be used.
      --restrict-file-names
                            unix, windows, nocontrol, ascii, lowercase,
                              uppercase, none
      --robots              Respect robots.txt standard for recursive
                              downloads. (default: on)
  -S  --server-response     Print the server response headers. (default: off)
  -H  --span-hosts          Span hosts that were not given on the
                              command line. (default: off)
      --spider              Enable web spider mode. (default: off)
      --strict-comments     A dummy option. Parsing always works non-strict.
      --tcp-fastopen        Enable TCP Fast Open (TFO). (default: on)
  -T  --timeout             General network timeout in seconds.
  -N  --timestamping        Just retrieve younger files than the local ones.
                              (default: off)
  -t  --tries               Number of tries for each download. (default 20)
      --trust-server-names  On redirection use the server's filename.
                              (default: off)
      --use-askpass         Prompt for a user and password using
                              the specified command.
      --use-server-timestamps
                            Set local file's timestamp to server's timestamp.
                              (default: on)
      --user                Username for Authentication.
                              (default: empty username)
  -w  --wait                Wait number of seconds between downloads
                              (per thread). (default: 0)
      --waitretry           Wait up to number of seconds after error
                              (per thread). (default: 10)
      --xattr               Save extended file attributes. (default: on)

HTTP related options:
  -E  --adjust-extension    Append extension to saved file (.html or .css).
                              (default: off)
      --auth-no-challenge   send Basic HTTP Authentication before challenge
  -K  --backup-converted    When converting, keep the original file with
                              a .orig suffix. (default: off)
      --compression         Customize Accept-Encoding with
                              identity, gzip, deflate, xz, lzma, br, bzip2
                              and any combination of it
                              no-compression means no Accept-Encoding
      --content-disposition
                            Take filename from Content-Disposition.
                              (default: off)
      --cookie-suffixes     Load public suffixes from file. 
                              They prevent 'supercookie' vulnerabilities.
                              See https://publicsuffix.org/ for details.
      --cookies             Enable use of cookies. (default: on)
      --default-http-port   Set default port for HTTP. (default: 80)
      --default-https-port  Set default port for HTTPS. (default: 443)
      --default-page        Default file name. (default: index.html)
      --header              Insert input string as a HTTP header in
                              all requests
      --html-extension      Obsoleted by --adjust-extension
      --http-keep-alive     Keep connection open for further requests.
                              (default: on)
      --http-password       Password for HTTP Authentication.
                              (default: empty password)
      --http-proxy          Set HTTP proxy/proxies, overriding environment
                              variables. Use comma to separate proxies.
      --http-proxy-password
                            Password for HTTP Proxy Authentication.
                              (default: empty password)
      --http-proxy-user     Username for HTTP Proxy Authentication.
                              (default: empty username)
      --http-user           Username for HTTP Authentication.
                              (default: empty username)
      --keep-session-cookies
                            Also save session cookies. (default: off)
      --load-cookies        Load cookies from file.
      --metalink            Follow a metalink file instead of storing it
                              (default: on)
      --netrc-file          Set file for login/password to use instead of
                              ~/.netrc. (default: ~/.netrc)
  -Q  --quota               Download quota, 0 = no quota. (default: 0)
      --referer             Include Referer: url in HTTP request.
                              (default: off)
      --retry-connrefused   Consider "connection refused" a transient error.
                               (default: off)
      --save-cookies        Save cookies to file.
      --save-headers        Save the response headers in front of the response
                              data. (default: off)
  -U  --user-agent          HTTP User Agent string.
                              (default: wget)

HTTPS (SSL/TLS) related options:
      --ca-certificate      File with bundle of PEM CA certificates.
      --ca-directory        Directory with PEM CA certificates.
      --certificate         File with client certificate.
      --certificate-type    Certificate type: PEM or DER (known as ASN1).
                              (default: PEM)
      --check-certificate   Check the server's certificate. (default: on)
      --check-hostname      Check the server's certificate's hostname.
                              (default: on)
      --crl-file            File with PEM CRL certificates.
      --egd-file            File to be used as socket for random data from
                              Entropy Gathering Daemon.
      --gnutls-options      Custom GnuTLS priority string.
                              Interferes with --secure-protocol.
                              (default: none)
      --hpkp                Use HTTP Public Key Pinning (HPKP). (default: on)
      --hpkp-file           Set file for storing HPKP data
                              (default: ~/.wget-hpkp)
      --hsts                Use HTTP Strict Transport Security (HSTS).
                              (default: on)
      --hsts-file           Set file for HSTS caching. (default: ~/.wget-hsts)
      --http2               Use HTTP/2 protocol if possible. (default: on)
      --https-enforce       Use secure HTTPS instead of HTTP. Legal types are
                              'hard', 'soft' and 'none'.
                              If --https-only is enabled,
                              this option has no effect. (default: none)
      --https-only          Do not follow non-secure URLs. (default: off).
      --https-proxy         Set HTTPS proxy/proxies, overriding environment
                              variables. Use comma to separate proxies.
      --ocsp                Use OCSP server access to verify server's
                              certificate. (default: on)
      --ocsp-file           Set file for OCSP chaching.
                              (default: ~/.wget-ocsp)
      --ocsp-stapling       Use OCSP stapling to verify the server's
                              certificate. (default: on)
      --private-key         File with private key.
      --private-key-type    Type of the private key (PEM or DER).
                              (default: PEM)
      --random-file         File to be used as source of random data.
      --secure-protocol     Set protocol to be used (auto, SSLv3, TLSv1, PFS).
                              (default: auto). Or use GnuTLS priority
                              strings, e.g. NORMAL:-VERS-SSL3.0:-RSA
      --tls-false-start     Enable TLS False Start (needs GnuTLS 3.5+).
                              (default: on)
      --tls-resume          Enable TLS Session Resumption. (default: off)
      --tls-session-file    Set file for TLS Session caching.
                              (default: ~/.wget-session)

Directory options:
      --cut-dirs            Skip creating given number of directory
                              components. (default: 0)
      --directories         Create hierarchy of directories when retrieving
                              recursively. (default: on)
  -P  --directory-prefix    Set directory prefix.
  -x  --force-directories   Create hierarchy of directories when not
                              retrieving recursively. (default: off)
      --host-directories    Create host directories when retrieving
                              recursively. (default: on)
      --protocol-directories
                            Force creating protocol directories.
                              (default: off)

GPG related options:
      --gnupg-homedir       Specify a directory to use as the GnuPG home
                               directory. (default: gnupg default homedir)
      --signature-extensions
                            The extension of the signature file which should be
                              downloaded. (default: sig)
      --verify-save-failed  Save target files even when their signatures fail
                              GPG validation. (default: off)
  -s  --verify-sig          Download .sig file and verify. (default: off)

Plugin options:
      --list-plugins        Lists all the plugins in the plugin search paths.
      --local-plugin        Loads a plugin with a given path.
      --plugin              Load a plugin with a given name.
      --plugin-dirs         Specify alternative directories to look
                              for plugins, separated by ','
      --plugin-help         Print help message for all loaded plugins
      --plugin-opt          Forward an option to a loaded plugin.
                              The option should be in format:
                              <plugin_name>.<option>[=value]


Example boolean option:
 --quiet=no is the same as --no-quiet or --quiet=off or --quiet off
Example string option:
 --user-agent=SpecialAgent/1.3.5 or --user-agent "SpecialAgent/1.3.5"

To reset string options use --[no-]option

user1@ubuntu22042:~$ 

測試


wget2 --no-check-certificate --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains www.xxx.idv.tw --no-parent https://www.xxx.idv.tw/

過程有紅字

WARNING: The certificate is NOT trusted. The certificate issuer is unknown. 

不過仍可正常運作,中文名稱檔案有下載成功。


(完)

相關

[研究]wget 1.21.2 與 wget2 v1.99.1網站下載軟體安裝、試用 (Ubuntu 22.04.2 LTS)
https://shaurong.blogspot.com/2023/03/wget2-v1991-ubuntu-22042-lts.html

[研究]wget2 v2.0.1網站下載軟體安裝、試用 (Rocky Linux 9.1)
https://shaurong.blogspot.com/2023/03/wget2-v201-rocky-linux-91.html

[研究]wget 1.21.1 網站下載軟體安裝、測試 (Rocky Linux 9.1)
https://shaurong.blogspot.com/2023/03/wget-1211-rocky-linux-91.html

[研究]Wget for Windows 1.21.3試用
https://shaurong.blogspot.com/2023/03/wget-for-windows-1213.html


[研究]Wget2 v2.0.1網站下載軟體安裝、試用 (Rocky Linux 9.1)

[研究]Wget2 v2.0.1網站下載軟體安裝、試用 (Rocky Linux 9.1)

2023-03-21

本篇CentOS應該通用。

GNU Wget2:是 GNU Wget 的下一代版本,支援多執行緒下載、HTTP/2、IPv6 等功能,是一款強大的命令列工具。

Wget - 維基百科,自由的百科全書
https://zh.wikipedia.org/wiki/Wget#Wget2

GNU Wget2 2.0.0 釋出於 2021 年 9 月 26 日。比起Wget1.x支援以下協定和技術:

  • HTTP/2
  • HTTP壓縮
  • 並列連接
  • 使用HTTP頭欄位If-Modified-Since
  • TCP Fast Open

官方網站:https://www.gnu.org/software/wget/

官方網站:https://gitlab.com/gnuwget/wget2

********************************************************************************

Rocky Linux 9.1 上有提供 wget,但沒有提供 wget2

[user1@localhost ~]$ sudo yum -y install epel-release

[user1@localhost ~]$ sudo yum -y install epel-release    


[user1@localhost ~]$ sudo yum list | grep wget
wget.x86_64     1.21.1-7.el9     @AppStream
[user1@localhost ~]$

官方安裝教學
https://gitlab.com/gnuwget/wget2

安裝基本套件


[user1@localhost ~]$ sudo yum -y install autotools python  rsync tar makeinfo pkg-config  doxygen  pandoc  gettext libiconv  libz liblzma  libbz2 libbrotlidec libbrotli  libzstd  libgnutls libidn2 flex  libpsl  libnghttp2  libmicrohttpd  lzip lcov libgpgme  libpcre libhsts libwolfssl
[sudo] password for user1: 
Last metadata expiration check: 0:29:03 ago on Fri 24 Mar 2023 10:43:56 AM CST.
No match for argument: autotools
Package python-unversioned-command-3.9.14-1.el9_1.1.noarch is already installed.
Package rsync-3.2.3-18.el9.x86_64 is already installed.
Package tar-2:1.34-5.el9.x86_64 is already installed.
No match for argument: makeinfo
Package pkgconf-pkg-config-1.7.3-9.el9.x86_64 is already installed.
No match for argument: doxygen
Package gettext-0.21-7.el9.x86_64 is already installed.
No match for argument: libiconv
No match for argument: libz
No match for argument: liblzma
No match for argument: libbz2
No match for argument: libbrotlidec
Package libbrotli-1.0.9-6.el9.x86_64 is already installed.
Package libzstd-1.5.1-2.el9.x86_64 is already installed.
No match for argument: libgnutls
Package libidn2-2.3.0-7.el9.x86_64 is already installed.
Package libpsl-0.21.1-5.el9.x86_64 is already installed.
Package libnghttp2-1.43.0-5.el9.x86_64 is already installed.
No match for argument: libgpgme
No match for argument: libpcre
No match for argument: libhsts
No match for argument: libwolfssl
Error: Unable to find a match: autotools makeinfo doxygen libiconv libz liblzma libbz2 libbrotlidec libgnutls libgpgme libpcre libhsts libwolfssl
[user1@localhost ~]$ 

安裝、編譯主要套件

[user1@localhost ~]$ wget https://gnuwget.gitlab.io/wget2/wget2-latest.tar.gz
--2023-03-24 11:06:21--  https://gnuwget.gitlab.io/wget2/wget2-latest.tar.gz
Resolving gnuwget.gitlab.io (gnuwget.gitlab.io)... 35.185.44.232
Connecting to gnuwget.gitlab.io (gnuwget.gitlab.io)|35.185.44.232|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2819571 (2.7M) [application/gzip]
Saving to: ‘wget2-latest.tar.gz’

wget2-latest.tar.g 100%[=============>]   2.69M  1.41MB/s    in 1.9s    

2023-03-24 11:06:25 (1.41 MB/s) - ‘wget2-latest.tar.gz’ saved [2819571/2819571]

[user1@localhost ~]$ tar xf wget2-latest.tar.gz 
[user1@localhost ~]$ cd wget2-2.0.1/
[user1@localhost wget2-2.0.1]$ ./configure
...(略)
configure: error: in `/home/user1/wget2-2.0.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[user1@localhost wget2-2.0.1]$ 

[user1@localhost wget2-2.0.1]$ sudo yum -y install gcc
[sudo] password for user1: 
Last metadata expiration check: 0:23:47 ago on Fri 24 Mar 2023 10:43:56 AM CST.
Dependencies resolved.
=========================================================================
 Package              Arch    Version                   Repository  Size
=========================================================================
Installing:
 gcc                  x86_64  11.3.1-2.1.el9            appstream   32 M
Upgrading:
 glibc                x86_64  2.34-40.el9_1.1           baseos     1.9 M
 glibc-all-langpacks  x86_64  2.34-40.el9_1.1           baseos      18 M
 glibc-common         x86_64  2.34-40.el9_1.1           baseos     300 k
 glibc-gconv-extra    x86_64  2.34-40.el9_1.1           baseos     1.5 M
 glibc-langpack-en    x86_64  2.34-40.el9_1.1           baseos     559 k
 glibc-langpack-zh    x86_64  2.34-40.el9_1.1           baseos     2.2 M
Installing dependencies:
 glibc-devel          x86_64  2.34-40.el9_1.1           appstream   41 k
 glibc-headers        x86_64  2.34-40.el9_1.1           appstream  440 k
 kernel-headers       x86_64  5.14.0-162.18.1.el9_1     appstream  3.2 M
 libxcrypt-devel      x86_64  4.4.18-3.el9              appstream   28 k
 make                 x86_64  1:4.3-7.el9               baseos     530 k

Transaction Summary
=========================================================================
Install  6 Packages
Upgrade  6 Packages

Total download size: 61 M
Downloading Packages:
(1/12): libxcrypt-devel-4.4.18-3.el9.x86 183 kB/s |  28 kB     00:00    
(2/12): make-4.3-7.el9.x86_64.rpm        2.1 MB/s | 530 kB     00:00    
(3/12): glibc-headers-2.34-40.el9_1.1.x8 1.3 MB/s | 440 kB     00:00    
(4/12): glibc-devel-2.34-40.el9_1.1.x86_ 520 kB/s |  41 kB     00:00    
(5/12): glibc-langpack-zh-2.34-40.el9_1. 4.4 MB/s | 2.2 MB     00:00    
(6/12): glibc-langpack-en-2.34-40.el9_1. 5.7 MB/s | 559 kB     00:00    
(7/12): glibc-gconv-extra-2.34-40.el9_1. 3.9 MB/s | 1.5 MB     00:00    
(8/12): glibc-common-2.34-40.el9_1.1.x86 4.3 MB/s | 300 kB     00:00    
(9/12): kernel-headers-5.14.0-162.18.1.e 907 kB/s | 3.2 MB     00:03    
(10/12): glibc-2.34-40.el9_1.1.x86_64.rp 2.2 MB/s | 1.9 MB     00:00    
(11/12): glibc-all-langpacks-2.34-40.el9 5.2 MB/s |  18 MB     00:03    
(12/12): gcc-11.3.1-2.1.el9.x86_64.rpm   2.8 MB/s |  32 MB     00:11    
-------------------------------------------------------------------------
Total                                    4.5 MB/s |  61 MB     00:13     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                 1/1 
  Upgrading        : glibc-langpack-en-2.34-40.el9_1.1.x86_64       1/18 
  Upgrading        : glibc-gconv-extra-2.34-40.el9_1.1.x86_64       2/18 
  Running scriptlet: glibc-gconv-extra-2.34-40.el9_1.1.x86_64       2/18 
  Upgrading        : glibc-common-2.34-40.el9_1.1.x86_64            3/18 
  Running scriptlet: glibc-2.34-40.el9_1.1.x86_64                   4/18 
  Upgrading        : glibc-2.34-40.el9_1.1.x86_64                   4/18 
  Running scriptlet: glibc-2.34-40.el9_1.1.x86_64                   4/18 
  Upgrading        : glibc-langpack-zh-2.34-40.el9_1.1.x86_64       5/18 
  Installing       : make-1:4.3-7.el9.x86_64                        6/18 
  Installing       : glibc-headers-2.34-40.el9_1.1.x86_64           7/18 
  Installing       : kernel-headers-5.14.0-162.18.1.el9_1.x86_64    8/18 
  Installing       : glibc-devel-2.34-40.el9_1.1.x86_64             9/18 
  Installing       : libxcrypt-devel-4.4.18-3.el9.x86_64           10/18 
  Installing       : gcc-11.3.1-2.1.el9.x86_64                     11/18 
  Upgrading        : glibc-all-langpacks-2.34-40.el9_1.1.x86_64    12/18 
  Cleanup          : glibc-all-langpacks-2.34-40.el9.x86_64        13/18 
  Cleanup          : glibc-langpack-en-2.34-40.el9.x86_64          14/18 
  Cleanup          : glibc-gconv-extra-2.34-40.el9.x86_64          15/18 
  Running scriptlet: glibc-gconv-extra-2.34-40.el9.x86_64          15/18 
  Cleanup          : glibc-2.34-40.el9.x86_64                      16/18 
  Cleanup          : glibc-langpack-zh-2.34-40.el9.x86_64          17/18 
  Cleanup          : glibc-common-2.34-40.el9.x86_64               18/18 
  Running scriptlet: glibc-all-langpacks-2.34-40.el9_1.1.x86_64    18/18 
  Running scriptlet: glibc-common-2.34-40.el9.x86_64               18/18 
  Verifying        : make-1:4.3-7.el9.x86_64                        1/18 
  Verifying        : libxcrypt-devel-4.4.18-3.el9.x86_64            2/18 
  Verifying        : kernel-headers-5.14.0-162.18.1.el9_1.x86_64    3/18 
  Verifying        : gcc-11.3.1-2.1.el9.x86_64                      4/18 
  Verifying        : glibc-headers-2.34-40.el9_1.1.x86_64           5/18 
  Verifying        : glibc-devel-2.34-40.el9_1.1.x86_64             6/18 
  Verifying        : glibc-langpack-zh-2.34-40.el9_1.1.x86_64       7/18 
  Verifying        : glibc-langpack-zh-2.34-40.el9.x86_64           8/18 
  Verifying        : glibc-langpack-en-2.34-40.el9_1.1.x86_64       9/18 
  Verifying        : glibc-langpack-en-2.34-40.el9.x86_64          10/18 
  Verifying        : glibc-gconv-extra-2.34-40.el9_1.1.x86_64      11/18 
  Verifying        : glibc-gconv-extra-2.34-40.el9.x86_64          12/18 
  Verifying        : glibc-common-2.34-40.el9_1.1.x86_64           13/18 
  Verifying        : glibc-common-2.34-40.el9.x86_64               14/18 
  Verifying        : glibc-all-langpacks-2.34-40.el9_1.1.x86_64    15/18 
  Verifying        : glibc-all-langpacks-2.34-40.el9.x86_64        16/18 
  Verifying        : glibc-2.34-40.el9_1.1.x86_64                  17/18 
  Verifying        : glibc-2.34-40.el9.x86_64                      18/18 

Upgraded:
  glibc-2.34-40.el9_1.1.x86_64                                           
  glibc-all-langpacks-2.34-40.el9_1.1.x86_64                             
  glibc-common-2.34-40.el9_1.1.x86_64                                    
  glibc-gconv-extra-2.34-40.el9_1.1.x86_64                               
  glibc-langpack-en-2.34-40.el9_1.1.x86_64                               
  glibc-langpack-zh-2.34-40.el9_1.1.x86_64                               
Installed:
  gcc-11.3.1-2.1.el9.x86_64                                              
  glibc-devel-2.34-40.el9_1.1.x86_64                                     
  glibc-headers-2.34-40.el9_1.1.x86_64                                   
  kernel-headers-5.14.0-162.18.1.el9_1.x86_64                            
  libxcrypt-devel-4.4.18-3.el9.x86_64                                    
  make-1:4.3-7.el9.x86_64                                                

Complete!
[user1@localhost wget2-2.0.1]$ 
[user1@localhost wget2-2.0.1]$ ./configure
...(略)
checking for library containing gnutls_global_init... no
configure: WARNING: *** GNUTLS was not found. Fallback to libnettle for hashing and checksumming.
checking for openssl... no
checking for library containing SSL_CTX_new... no
configure: WARNING: *** OpenSSL was not found.
checking for wolfssl... no
checking for library containing wolfSSL_Init... no
configure: WARNING: *** WolfSSL was not found.
configure: error: *** No SSL/TLS library not found.
[user1@localhost wget2-2.0.1]$ 
[user1@localhost wget2-2.0.1]$ sudo yum -y install gnutls openssl wolfssl
[sudo] password for user1: 
Last metadata expiration check: 0:35:44 ago on Fri 24 Mar 2023 10:43:56 AM CST.
Package gnutls-3.7.6-12.el9_0.x86_64 is already installed.
Package openssl-1:3.0.1-43.el9_0.x86_64 is already installed.
No match for argument: wolfssl
Error: Unable to find a match: wolfssl
[user1@localhost wget2-2.0.1]$

[user1@localhost wget2-2.0.1]$ sudo yum -y install gnutls-devel openssl-devel
Last metadata expiration check: 0:36:38 ago on Fri 24 Mar 2023 10:43:56 AM CST.
Dependencies resolved.
============================================================================
 Package             Arch        Version               Repository      Size
============================================================================
Installing:
 gnutls-devel        x86_64      3.7.6-18.el9_1        appstream      2.2 M
 openssl-devel       x86_64      1:3.0.1-47.el9_1      appstream      2.9 M
Upgrading:
 gnutls              x86_64      3.7.6-18.el9_1        baseos         1.0 M
 libtasn1            x86_64      4.16.0-8.el9_1        baseos          73 k
 openssl             x86_64      1:3.0.1-47.el9_1      baseos         1.1 M
 openssl-libs        x86_64      1:3.0.1-47.el9_1      baseos         2.1 M
Installing dependencies:
 gmp-c++             x86_64      1:6.2.0-10.el9        appstream       19 k
 gmp-devel           x86_64      1:6.2.0-10.el9        appstream      174 k
 gnutls-c++          x86_64      3.7.6-18.el9_1        appstream       33 k
 gnutls-dane         x86_64      3.7.6-18.el9_1        appstream       23 k
 libidn2-devel       x86_64      2.3.0-7.el9           appstream       56 k
 libtasn1-devel      x86_64      4.16.0-8.el9_1        appstream      328 k
 libtasn1-tools      x86_64      4.16.0-8.el9_1        appstream       23 k
 nettle-devel        x86_64      3.8-3.el9_0           appstream      661 k
 p11-kit-devel       x86_64      0.24.1-2.el9          appstream       84 k
 unbound-libs        x86_64      1.16.2-2.el9          appstream      547 k

Transaction Summary
============================================================================
Install  12 Packages
Upgrade   4 Packages

Total download size: 11 M
Downloading Packages:
(1/16): unbound-libs-1.16.2-2.el9.x86_64.rp 1.3 MB/s | 547 kB     00:00    
(2/16): libidn2-devel-2.3.0-7.el9.x86_64.rp 138 kB/s |  56 kB     00:00    
(3/16): gnutls-dane-3.7.6-18.el9_1.x86_64.r 212 kB/s |  23 kB     00:00    
(4/16): gnutls-c++-3.7.6-18.el9_1.x86_64.rp 388 kB/s |  33 kB     00:00    
(5/16): gmp-devel-6.2.0-10.el9.x86_64.rpm   1.0 MB/s | 174 kB     00:00    
(6/16): gmp-c++-6.2.0-10.el9.x86_64.rpm     492 kB/s |  19 kB     00:00    
(7/16): libtasn1-tools-4.16.0-8.el9_1.x86_6 327 kB/s |  23 kB     00:00    
(8/16): openssl-devel-3.0.1-47.el9_1.x86_64 2.4 MB/s | 2.9 MB     00:01    
(9/16): libtasn1-devel-4.16.0-8.el9_1.x86_6 664 kB/s | 328 kB     00:00    
(10/16): p11-kit-devel-0.24.1-2.el9.x86_64. 791 kB/s |  84 kB     00:00    
(11/16): nettle-devel-3.8-3.el9_0.x86_64.rp 1.5 MB/s | 661 kB     00:00    
(12/16): gnutls-devel-3.7.6-18.el9_1.x86_64 1.7 MB/s | 2.2 MB     00:01    
(13/16): gnutls-3.7.6-18.el9_1.x86_64.rpm   1.8 MB/s | 1.0 MB     00:00    
(14/16): openssl-3.0.1-47.el9_1.x86_64.rpm  1.8 MB/s | 1.1 MB     00:00    
(15/16): libtasn1-4.16.0-8.el9_1.x86_64.rpm 2.0 MB/s |  73 kB     00:00    
(16/16): openssl-libs-3.0.1-47.el9_1.x86_64 2.1 MB/s | 2.1 MB     00:01    
----------------------------------------------------------------------------
Total                                       2.5 MB/s |  11 MB     00:04     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                    1/1 
  Upgrading        : libtasn1-4.16.0-8.el9_1.x86_64                    1/20 
  Upgrading        : gnutls-3.7.6-18.el9_1.x86_64                      2/20 
  Upgrading        : openssl-libs-1:3.0.1-47.el9_1.x86_64              3/20 
  Running scriptlet: unbound-libs-1.16.2-2.el9.x86_64                  4/20 
  Installing       : unbound-libs-1.16.2-2.el9.x86_64                  4/20 
  Running scriptlet: unbound-libs-1.16.2-2.el9.x86_64                  4/20 
Created symlink /etc/systemd/system/timers.target.wants/unbound-anchor.timer → /usr/lib/systemd/system/unbound-anchor.timer.

  Installing       : gnutls-dane-3.7.6-18.el9_1.x86_64                 5/20 
  Installing       : gnutls-c++-3.7.6-18.el9_1.x86_64                  6/20 
  Installing       : libtasn1-tools-4.16.0-8.el9_1.x86_64              7/20 
  Installing       : libtasn1-devel-4.16.0-8.el9_1.x86_64              8/20 
  Installing       : p11-kit-devel-0.24.1-2.el9.x86_64                 9/20 
  Installing       : gmp-c++-1:6.2.0-10.el9.x86_64                    10/20 
  Installing       : gmp-devel-1:6.2.0-10.el9.x86_64                  11/20 
  Installing       : nettle-devel-3.8-3.el9_0.x86_64                  12/20 
  Installing       : libidn2-devel-2.3.0-7.el9.x86_64                 13/20 
  Installing       : gnutls-devel-3.7.6-18.el9_1.x86_64               14/20 
  Installing       : openssl-devel-1:3.0.1-47.el9_1.x86_64            15/20 
  Upgrading        : openssl-1:3.0.1-47.el9_1.x86_64                  16/20 
  Cleanup          : openssl-1:3.0.1-43.el9_0.x86_64                  17/20 
  Cleanup          : gnutls-3.7.6-12.el9_0.x86_64                     18/20 
  Cleanup          : libtasn1-4.16.0-7.el9.x86_64                     19/20 
  Cleanup          : openssl-libs-1:3.0.1-43.el9_0.x86_64             20/20 
  Running scriptlet: openssl-libs-1:3.0.1-43.el9_0.x86_64             20/20 
  Verifying        : libidn2-devel-2.3.0-7.el9.x86_64                  1/20 
  Verifying        : openssl-devel-1:3.0.1-47.el9_1.x86_64             2/20 
  Verifying        : unbound-libs-1.16.2-2.el9.x86_64                  3/20 
  Verifying        : gnutls-devel-3.7.6-18.el9_1.x86_64                4/20 
  Verifying        : gnutls-dane-3.7.6-18.el9_1.x86_64                 5/20 
  Verifying        : gnutls-c++-3.7.6-18.el9_1.x86_64                  6/20 
  Verifying        : gmp-devel-1:6.2.0-10.el9.x86_64                   7/20 
  Verifying        : gmp-c++-1:6.2.0-10.el9.x86_64                     8/20 
  Verifying        : libtasn1-tools-4.16.0-8.el9_1.x86_64              9/20 
  Verifying        : libtasn1-devel-4.16.0-8.el9_1.x86_64             10/20 
  Verifying        : nettle-devel-3.8-3.el9_0.x86_64                  11/20 
  Verifying        : p11-kit-devel-0.24.1-2.el9.x86_64                12/20 
  Verifying        : openssl-libs-1:3.0.1-47.el9_1.x86_64             13/20 
  Verifying        : openssl-libs-1:3.0.1-43.el9_0.x86_64             14/20 
  Verifying        : openssl-1:3.0.1-47.el9_1.x86_64                  15/20 
  Verifying        : openssl-1:3.0.1-43.el9_0.x86_64                  16/20 
  Verifying        : gnutls-3.7.6-18.el9_1.x86_64                     17/20 
  Verifying        : gnutls-3.7.6-12.el9_0.x86_64                     18/20 
  Verifying        : libtasn1-4.16.0-8.el9_1.x86_64                   19/20 
  Verifying        : libtasn1-4.16.0-7.el9.x86_64                     20/20 

Upgraded:
  gnutls-3.7.6-18.el9_1.x86_64       libtasn1-4.16.0-8.el9_1.x86_64         
  openssl-1:3.0.1-47.el9_1.x86_64    openssl-libs-1:3.0.1-47.el9_1.x86_64   
Installed:
  gmp-c++-1:6.2.0-10.el9.x86_64                                             
  gmp-devel-1:6.2.0-10.el9.x86_64                                           
  gnutls-c++-3.7.6-18.el9_1.x86_64                                          
  gnutls-dane-3.7.6-18.el9_1.x86_64                                         
  gnutls-devel-3.7.6-18.el9_1.x86_64                                        
  libidn2-devel-2.3.0-7.el9.x86_64                                          
  libtasn1-devel-4.16.0-8.el9_1.x86_64                                      
  libtasn1-tools-4.16.0-8.el9_1.x86_64                                      
  nettle-devel-3.8-3.el9_0.x86_64                                           
  openssl-devel-1:3.0.1-47.el9_1.x86_64                                     
  p11-kit-devel-0.24.1-2.el9.x86_64                                         
  unbound-libs-1.16.2-2.el9.x86_64                                          

Complete!
[user1@localhost wget2-2.0.1]$ 
[user1@localhost wget2-2.0.1]$ ./configure
...(略)
config.status: creating po/Makefile configure: Summary of build options: Version: 2.0.1 Host OS: linux-gnu Install prefix: /usr/local Compiler: gcc CFlags: -I/usr/include/p11-kit-1 -DNDEBUG -g -O2 LDFlags: Libs: -lidn2 -lgnutls Library types: shared=yes, static=yes Small libraries: no SSL/TLS support: gnutls GZIP compression: no BZIP2 compression: no LZMA compression: no Brotli compression: no Zstd compression: no Lzip compression: no IDNA support: IDNA 2008 (libidn2) PSL support: no HSTS support: no HTTP/2.0 support: no Documentation: no (neither Doxygen nor Pandoc found) Wget2 docs: Libwget docs: PCRE support: no Tests: Valgrind testing not enabled Assertions: no POSIX xattr: yes Microhttpd support: no (CFLAGS: -I/usr/include/p11-kit-1 -DNDEBUG -g -O2. LIBS: -lidn2 -lgnutls ) Fuzzing build: no, GPGME: no [user1@localhost wget2-2.0.1]$ make
...(略)
CCLD libtest-utils.la make[2]: Leaving directory '/home/user1/wget2-2.0.1/src' Making all in po make[2]: Entering directory '/home/user1/wget2-2.0.1/po' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/user1/wget2-2.0.1/po' Making all in fuzz make[2]: Entering directory '/home/user1/wget2-2.0.1/fuzz' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/user1/wget2-2.0.1/fuzz' Making all in unit-tests make[2]: Entering directory '/home/user1/wget2-2.0.1/unit-tests' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/user1/wget2-2.0.1/unit-tests' make[2]: Entering directory '/home/user1/wget2-2.0.1' make[2]: Leaving directory '/home/user1/wget2-2.0.1' make[1]: Leaving directory '/home/user1/wget2-2.0.1' [user1@localhost wget2-2.0.1]$
[user1@localhost wget2-2.0.1]$ make check
...(略)
============================================================================ Testsuite summary for wget2 2.0.1 ============================================================================ # TOTAL: 5 # PASS: 5 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================ make[3]: Leaving directory '/home/user1/wget2-2.0.1/unit-tests' make[2]: Leaving directory '/home/user1/wget2-2.0.1/unit-tests' make[1]: Leaving directory '/home/user1/wget2-2.0.1/unit-tests' make[1]: Entering directory '/home/user1/wget2-2.0.1' make check-local make[2]: Entering directory '/home/user1/wget2-2.0.1' make[2]: Leaving directory '/home/user1/wget2-2.0.1' make[1]: Leaving directory '/home/user1/wget2-2.0.1' GEN public-submodule-commit [user1@localhost wget2-2.0.1]$
[user1@localhost wget2-2.0.1]$ sudo make install
...(略)
[user1@localhost wget2-2.0.1]$

安裝、編譯主要套件

[user1@localhost wget2-2.0.1]$ wget2
Nothing to do - goodbye
[user1@localhost wget2-2.0.1]$ wget2 --version
GNU Wget2 2.0.1 - multithreaded metalink/file/website downloader

+digest +https +ssl/gnutls +ipv6 +iri +large-file +nls -ntlm -opie -psl -hsts
+iconv +idn2 -zlib -lzma -brotlidec -zstd -bzip2 -lzip -http2 -gpgme

Copyright (C) 2012-2015 Tim Ruehsen
Copyright (C) 2015-2021 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please send bug reports and questions to <bug-wget@gnu.org>.
[user1@localhost wget2-2.0.1]$ wget --help
GNU Wget 1.21.1, a non-interactive network retriever.
Usage: wget [OPTION]... [URL]...

Mandatory arguments to long options are mandatory for short options too.

Startup:
  -V,  --version                   display the version of Wget and exit
  -h,  --help                      print this help
  -b,  --background                go to background after startup
  -e,  --execute=COMMAND           execute a `.wgetrc'-style command

Logging and input file:
  -o,  --output-file=FILE          log messages to FILE
  -a,  --append-output=FILE        append messages to FILE
  -d,  --debug                     print lots of debugging information
  -q,  --quiet                     quiet (no output)
  -v,  --verbose                   be verbose (this is the default)
  -nv, --no-verbose                turn off verboseness, without being quiet
       --report-speed=TYPE         output bandwidth as TYPE.  TYPE can be bits
  -i,  --input-file=FILE           download URLs found in local or external FILE
  -F,  --force-html                treat input file as HTML
  -B,  --base=URL                  resolves HTML input-file links (-i -F)
                                     relative to URL
       --config=FILE               specify config file to use
       --no-config                 do not read any config file
       --rejected-log=FILE         log reasons for URL rejection to FILE

Download:
  -t,  --tries=NUMBER              set number of retries to NUMBER (0 unlimits)
       --retry-connrefused         retry even if connection is refused
       --retry-on-http-error=ERRORS    comma-separated list of HTTP errors to retry
  -O,  --output-document=FILE      write documents to FILE
  -nc, --no-clobber                skip downloads that would download to
                                     existing files (overwriting them)
       --no-netrc                  don't try to obtain credentials from .netrc
  -c,  --continue                  resume getting a partially-downloaded file
       --start-pos=OFFSET          start downloading from zero-based position OFFSET
       --progress=TYPE             select progress gauge type
       --show-progress             display the progress bar in any verbosity mode
  -N,  --timestamping              don't re-retrieve files unless newer than
                                     local
       --no-if-modified-since      don't use conditional if-modified-since get
                                     requests in timestamping mode
       --no-use-server-timestamps  don't set the local file's timestamp by
                                     the one on the server
  -S,  --server-response           print server response
       --spider                    don't download anything
  -T,  --timeout=SECONDS           set all timeout values to SECONDS
       --dns-timeout=SECS          set the DNS lookup timeout to SECS
       --connect-timeout=SECS      set the connect timeout to SECS
       --read-timeout=SECS         set the read timeout to SECS
  -w,  --wait=SECONDS              wait SECONDS between retrievals
                                     (applies if more then 1 URL is to be retrieved)
       --waitretry=SECONDS         wait 1..SECONDS between retries of a retrieval
                                     (applies if more then 1 URL is to be retrieved)
       --random-wait               wait from 0.5*WAIT...1.5*WAIT secs between retrievals
                                     (applies if more then 1 URL is to be retrieved)
       --no-proxy                  explicitly turn off proxy
  -Q,  --quota=NUMBER              set retrieval quota to NUMBER
       --bind-address=ADDRESS      bind to ADDRESS (hostname or IP) on local host
       --limit-rate=RATE           limit download rate to RATE
       --no-dns-cache              disable caching DNS lookups
       --restrict-file-names=OS    restrict chars in file names to ones OS allows
       --ignore-case               ignore case when matching files/directories
  -4,  --inet4-only                connect only to IPv4 addresses
  -6,  --inet6-only                connect only to IPv6 addresses
       --prefer-family=FAMILY      connect first to addresses of specified family,
                                     one of IPv6, IPv4, or none
       --user=USER                 set both ftp and http user to USER
       --password=PASS             set both ftp and http password to PASS
       --ask-password              prompt for passwords
       --use-askpass=COMMAND       specify credential handler for requesting 
                                     username and password.  If no COMMAND is 
                                     specified the WGET_ASKPASS or the SSH_ASKPASS 
                                     environment variable is used.
       --no-iri                    turn off IRI support
       --local-encoding=ENC        use ENC as the local encoding for IRIs
       --remote-encoding=ENC       use ENC as the default remote encoding
       --unlink                    remove file before clobber
       --xattr                     turn on storage of metadata in extended file attributes

Directories:
  -nd, --no-directories            don't create directories
  -x,  --force-directories         force creation of directories
  -nH, --no-host-directories       don't create host directories
       --protocol-directories      use protocol name in directories
  -P,  --directory-prefix=PREFIX   save files to PREFIX/..
       --cut-dirs=NUMBER           ignore NUMBER remote directory components

HTTP options:
       --http-user=USER            set http user to USER
       --http-password=PASS        set http password to PASS
       --no-cache                  disallow server-cached data
       --default-page=NAME         change the default page name (normally
                                     this is 'index.html'.)
  -E,  --adjust-extension          save HTML/CSS documents with proper extensions
       --ignore-length             ignore 'Content-Length' header field
       --header=STRING             insert STRING among the headers
       --compression=TYPE          choose compression, one of auto, gzip and none. (default: none)
       --max-redirect              maximum redirections allowed per page
       --proxy-user=USER           set USER as proxy username
       --proxy-password=PASS       set PASS as proxy password
       --referer=URL               include 'Referer: URL' header in HTTP request
       --save-headers              save the HTTP headers to file
  -U,  --user-agent=AGENT          identify as AGENT instead of Wget/VERSION
       --no-http-keep-alive        disable HTTP keep-alive (persistent connections)
       --no-cookies                don't use cookies
       --load-cookies=FILE         load cookies from FILE before session
       --save-cookies=FILE         save cookies to FILE after session
       --keep-session-cookies      load and save session (non-permanent) cookies
       --post-data=STRING          use the POST method; send STRING as the data
       --post-file=FILE            use the POST method; send contents of FILE
       --method=HTTPMethod         use method "HTTPMethod" in the request
       --body-data=STRING          send STRING as data. --method MUST be set
       --body-file=FILE            send contents of FILE. --method MUST be set
       --content-disposition       honor the Content-Disposition header when
                                     choosing local file names (EXPERIMENTAL)
       --content-on-error          output the received content on server errors
       --auth-no-challenge         send Basic HTTP authentication information
                                     without first waiting for the server's
                                     challenge

HTTPS (SSL/TLS) options:
       --secure-protocol=PR        choose secure protocol, one of auto, SSLv2,
                                     SSLv3, TLSv1, TLSv1_1, TLSv1_2 and PFS
       --https-only                only follow secure HTTPS links
       --no-check-certificate      don't validate the server's certificate
       --certificate=FILE          client certificate file
       --certificate-type=TYPE     client certificate type, PEM or DER
       --private-key=FILE          private key file
       --private-key-type=TYPE     private key type, PEM or DER
       --ca-certificate=FILE       file with the bundle of CAs
       --ca-directory=DIR          directory where hash list of CAs is stored
       --crl-file=FILE             file with bundle of CRLs
       --pinnedpubkey=FILE/HASHES  Public key (PEM/DER) file, or any number
                                   of base64 encoded sha256 hashes preceded by
                                   'sha256//' and separated by ';', to verify
                                   peer against

       --ciphers=STR           Set the priority string (GnuTLS) or cipher list string (OpenSSL) directly.
                                   Use with care. This option overrides --secure-protocol.
                                   The format and syntax of this string depend on the specific SSL/TLS engine.
HSTS options:
       --no-hsts                   disable HSTS
       --hsts-file                 path of HSTS database (will override default)

FTP options:
       --ftp-user=USER             set ftp user to USER
       --ftp-password=PASS         set ftp password to PASS
       --no-remove-listing         don't remove '.listing' files
       --no-glob                   turn off FTP file name globbing
       --no-passive-ftp            disable the "passive" transfer mode
       --preserve-permissions      preserve remote file permissions
       --retr-symlinks             when recursing, get linked-to files (not dir)

FTPS options:
       --ftps-implicit                 use implicit FTPS (default port is 990)
       --ftps-resume-ssl               resume the SSL/TLS session started in the control connection when
                                         opening a data connection
       --ftps-clear-data-connection    cipher the control channel only; all the data will be in plaintext
       --ftps-fallback-to-ftp          fall back to FTP if FTPS is not supported in the target server
WARC options:
       --warc-file=FILENAME        save request/response data to a .warc.gz file
       --warc-header=STRING        insert STRING into the warcinfo record
       --warc-max-size=NUMBER      set maximum size of WARC files to NUMBER
       --warc-cdx                  write CDX index files
       --warc-dedup=FILENAME       do not store records listed in this CDX file
       --no-warc-compression       do not compress WARC files with GZIP
       --no-warc-digests           do not calculate SHA1 digests
       --no-warc-keep-log          do not store the log file in a WARC record
       --warc-tempdir=DIRECTORY    location for temporary files created by the
                                     WARC writer

Recursive download:
  -r,  --recursive                 specify recursive download
  -l,  --level=NUMBER              maximum recursion depth (inf or 0 for infinite)
       --delete-after              delete files locally after downloading them
  -k,  --convert-links             make links in downloaded HTML or CSS point to
                                     local files
       --convert-file-only         convert the file part of the URLs only (usually known as the basename)
       --backups=N                 before writing file X, rotate up to N backup files
  -K,  --backup-converted          before converting file X, back up as X.orig
  -m,  --mirror                    shortcut for -N -r -l inf --no-remove-listing
  -p,  --page-requisites           get all images, etc. needed to display HTML page
       --strict-comments           turn on strict (SGML) handling of HTML comments

Recursive accept/reject:
  -A,  --accept=LIST               comma-separated list of accepted extensions
  -R,  --reject=LIST               comma-separated list of rejected extensions
       --accept-regex=REGEX        regex matching accepted URLs
       --reject-regex=REGEX        regex matching rejected URLs
       --regex-type=TYPE           regex type (posix|pcre)
  -D,  --domains=LIST              comma-separated list of accepted domains
       --exclude-domains=LIST      comma-separated list of rejected domains
       --follow-ftp                follow FTP links from HTML documents
       --follow-tags=LIST          comma-separated list of followed HTML tags
       --ignore-tags=LIST          comma-separated list of ignored HTML tags
  -H,  --span-hosts                go to foreign hosts when recursive
  -L,  --relative                  follow relative links only
  -I,  --include-directories=LIST  list of allowed directories
       --trust-server-names        use the name specified by the redirection
                                     URL's last component
  -X,  --exclude-directories=LIST  list of excluded directories
  -np, --no-parent                 don't ascend to the parent directory

Email bug reports, questions, discussions to <bug-wget@gnu.org>
and/or open issues at https://savannah.gnu.org/bugs/?func=additem&group=wget.
[user1@localhost wget2-2.0.1]$ 

測試

wget --no-check-certificate --mirror -p --convert-links -r https://www.xxx.idv.tw  

實際測試可以下載繁體中文名稱檔案。約 AM 11:32開始,11:45 結束,約13分鐘。傳輸速度 6.73 MB/s。

(完)

相關

[研究]Wget2 v2.0.1網站下載軟體安裝、試用 (Rocky Linux 9.1)

[研究]wget 1.21.1 網站下載軟體安裝、測試 (Rocky Linux 9.1)
https://shaurong.blogspot.com/2023/03/wget-1211-rocky-linux-91.html

[研究]Wget for Windows 1.21.3試用
https://shaurong.blogspot.com/2023/03/wget-for-windows-1213.html


[研究]Wget for Windows 1.21.3網站下載軟體安裝、試用

[研究]Wget for Windows 1.21.3網站下載軟體安裝、試用

2023-03-15

Wget - 維基百科,自由的百科全書
https://zh.wikipedia.org/wiki/Wget

GNU Wget(常簡稱為Wget)是一個在網路上進行下載的簡單而強大的自由軟體,其本身也是GNU計劃的一部分。它的名字是「World Wide Web」和「Get」的結合,同時也隱含了軟體的主要功能。目前它支援通過HTTP、HTTPS,以及FTP這三個最常見的TCP/IP協定協定下載。

*****

Wget:1995年問世,由作者Hrvoje Nikšić開發。Wget 是一個由自由軟體基金會(英語:Free Software Foundation,FSF)開發的命令列工具,它支援多種網路協定,包括 HTTP、HTTPS、FTP 等,並且可以自動遞迴地下載整個網站。Wget 目前的版本是1.21.2,官網為 https://www.gnu.org/software/wget/

GNU Wget:1996年問世,Wget和GNU Wget是同一款軟體的不同名稱,都是由自由軟體基金會(FSF)開發的自由軟體。在早期,該軟體的名稱是Wget,並且由作者Hrvoje Nikšić自行維護。之後,Wget被加入GNU計劃中,並改名為GNU Wget (1997年)。因此,Wget和GNU Wget是同一款軟體,只是名稱有所不同。現在,官方上只繼續維護GNU Wget這個名稱。它支援HTTP、HTTPS和FTP協議,具有下載續傳、遞迴下載等功能。目前最新版為wget 1.21 (2020-12-31) 和 wget2 2.0.1 (2022-05-27),可在以下網址下載:https://www.gnu.org/software/wget/

wget for Windows。官網為 

https://gnuwin32.sourceforge.net/packages/wget.htm, wget 1.11.4 (2008-12-31)

https://eternallybored.org/misc/wget/,wget 1.21.3 版 (2022-03-12)

根據:https://eternallybored.org/misc/wget/manual/wget-1.18.html
得知 by Hrvoje Nikšić and others 和 GNU Wget was written by Hrvoje Nikšić

根據:https://en.wikipedia.org/wiki/Wget
得知 the development of which commenced in late 1995

********************************************************************************

wget.exe https://www.xxx.org.tw/:只會下載一頁

wget.exe https://www.xxx.org.tw/ -r:遞迴

wget --mirror -p --convert-links -P ./LOCAL URL:mirror整個網站


$ wget \
     --recursive \
     --no-clobber \
     --page-requisites \
     --html-extension \
     --convert-links \
     --restrict-file-names=windows \
     --domains example.org \
     --no-parent \
         www.example.org/tutorials/html/

從這個頁面:http://www.linuxjournal.com/content/downloading-entire-web-site-wget


wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains sh168.osha.gov.tw --no-parent https://sh168.osha.gov.tw/default.aspx




wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains www.xxx.idv.tw --no-parent https://www.xxx.idv.tw/ -P C:\Wget\Web3 -r


Incomplete or invalid multibyte sequence encountered


Incomplete or invalid multibyte sequence encountered


很多大檔案沒抓下來




wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains xxx.idv.tw --no-parent https://www.xxx.idv.tw/ -P C:\Wget\Web4 


Incomplete or invalid multibyte sequence encountered


Incomplete or invalid multibyte sequence encountered


還是很多大檔案沒抓下來,它無法處理中文檔案名稱




解決中文檔案名稱  --restrict-file-names=nocontrol


wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=nocontrol --domains www.xxx.idv.tw --no-parent https://www.xxx.idv.tw/ -P C:\Wget\Web5 -r




-i,  --input-file=FILE  


wget -i --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=nocontrol -L --domains xxx.idv.tw --no-parent https://www.xxx.idv.tw/ -P C:\Wget\Web8 -r



wget "Incomplete or invalid multibyte sequence encountered" site:eternallybored.org


官方無解法




不檢查伺服器憑證


wget --no-check-certificate --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains www.xxx.idv.tw --no-parent https://www.xxx.idv.tw/

和extensions相關的
-E,  --adjust-extension          save HTML/CSS documents with proper extensions
-A,  --accept=LIST               comma-separated list of accepted extensions
-R,  --reject=LIST               comma-separated list of rejected extensions

和include相關的 
     --referer=URL               include 'Referer: URL' header in HTTP request
-I,  --include-directories=LIST  list of allowed directories

和exclude相關的 
     --exclude-domains=LIST      comma-separated list of rejected domains
-X,  --exclude-directories=LIST  list of excluded directories



D:\SOFTWARE\Wget64>wget --help
GNU Wget 1.21.3, a non-interactive network retriever.
Usage: wget [OPTION]... [URL]...

Mandatory arguments to long options are mandatory for short options too.

Startup:
  -V,  --version                   display the version of Wget and exit
  -h,  --help                      print this help
  -b,  --background                go to background after startup
  -e,  --execute=COMMAND           execute a `.wgetrc'-style command

Logging and input file:
  -o,  --output-file=FILE          log messages to FILE
  -a,  --append-output=FILE        append messages to FILE
  -d,  --debug                     print lots of debugging information
  -q,  --quiet                     quiet (no output)
  -v,  --verbose                   be verbose (this is the default)
  -nv, --no-verbose                turn off verboseness, without being quiet
       --report-speed=TYPE         output bandwidth as TYPE.  TYPE can be bits
  -i,  --input-file=FILE           download URLs found in local or external FILE
       --input-metalink=FILE       download files covered in local Metalink FILE
  -F,  --force-html                treat input file as HTML
  -B,  --base=URL                  resolves HTML input-file links (-i -F)
                                     relative to URL
       --config=FILE               specify config file to use
       --no-config                 do not read any config file
       --rejected-log=FILE         log reasons for URL rejection to FILE

Download:
  -t,  --tries=NUMBER              set number of retries to NUMBER (0 unlimits)
       --retry-connrefused         retry even if connection is refused
       --retry-on-http-error=ERRORS    comma-separated list of HTTP errors to retry
  -O,  --output-document=FILE      write documents to FILE
  -nc, --no-clobber                skip downloads that would download to
                                     existing files (overwriting them)
       --no-netrc                  don't try to obtain credentials from .netrc
  -c,  --continue                  resume getting a partially-downloaded file
       --start-pos=OFFSET          start downloading from zero-based position OFFSET
       --progress=TYPE             select progress gauge type
       --show-progress             display the progress bar in any verbosity mode
  -N,  --timestamping              don't re-retrieve files unless newer than
                                     local
       --no-if-modified-since      don't use conditional if-modified-since get
                                     requests in timestamping mode
       --no-use-server-timestamps  don't set the local file's timestamp by
                                     the one on the server
  -S,  --server-response           print server response
       --spider                    don't download anything
  -T,  --timeout=SECONDS           set all timeout values to SECONDS
       --dns-servers=ADDRESSES     list of DNS servers to query (comma separated)
       --bind-dns-address=ADDRESS  bind DNS resolver to ADDRESS (hostname or IP) on local host
       --dns-timeout=SECS          set the DNS lookup timeout to SECS
       --connect-timeout=SECS      set the connect timeout to SECS
       --read-timeout=SECS         set the read timeout to SECS
  -w,  --wait=SECONDS              wait SECONDS between retrievals
                                     (applies if more then 1 URL is to be retrieved)
       --waitretry=SECONDS         wait 1..SECONDS between retries of a retrieval
                                     (applies if more then 1 URL is to be retrieved)
       --random-wait               wait from 0.5*WAIT...1.5*WAIT secs between retrievals
                                     (applies if more then 1 URL is to be retrieved)
       --no-proxy                  explicitly turn off proxy
  -Q,  --quota=NUMBER              set retrieval quota to NUMBER
       --bind-address=ADDRESS      bind to ADDRESS (hostname or IP) on local host
       --limit-rate=RATE           limit download rate to RATE
       --no-dns-cache              disable caching DNS lookups
       --restrict-file-names=OS    restrict chars in file names to ones OS allows
       --ignore-case               ignore case when matching files/directories
  -4,  --inet4-only                connect only to IPv4 addresses
  -6,  --inet6-only                connect only to IPv6 addresses
       --prefer-family=FAMILY      connect first to addresses of specified family,
                                     one of IPv6, IPv4, or none
       --user=USER                 set both ftp and http user to USER
       --password=PASS             set both ftp and http password to PASS
       --ask-password              prompt for passwords
       --use-askpass=COMMAND       specify credential handler for requesting
                                     username and password.  If no COMMAND is
                                     specified the WGET_ASKPASS or the SSH_ASKPASS
                                     environment variable is used.
       --no-iri                    turn off IRI support
       --local-encoding=ENC        use ENC as the local encoding for IRIs
       --remote-encoding=ENC       use ENC as the default remote encoding
       --unlink                    remove file before clobber
       --keep-badhash              keep files with checksum mismatch (append .badhash)
       --metalink-index=NUMBER     Metalink application/metalink4+xml metaurl ordinal NUMBER
       --metalink-over-http        use Metalink metadata from HTTP response headers
       --preferred-location        preferred location for Metalink resources

Directories:
  -nd, --no-directories            don't create directories
  -x,  --force-directories         force creation of directories
  -nH, --no-host-directories       don't create host directories
       --protocol-directories      use protocol name in directories
  -P,  --directory-prefix=PREFIX   save files to PREFIX/..
       --cut-dirs=NUMBER           ignore NUMBER remote directory components

HTTP options:
       --http-user=USER            set http user to USER
       --http-password=PASS        set http password to PASS
       --no-cache                  disallow server-cached data
       --default-page=NAME         change the default page name (normally
                                     this is 'index.html'.)
  -E,  --adjust-extension          save HTML/CSS documents with proper extensions
       --ignore-length             ignore 'Content-Length' header field
       --header=STRING             insert STRING among the headers
       --compression=TYPE          choose compression, one of auto, gzip and none. (default: none)
       --max-redirect              maximum redirections allowed per page
       --proxy-user=USER           set USER as proxy username
       --proxy-password=PASS       set PASS as proxy password
       --referer=URL               include 'Referer: URL' header in HTTP request
       --save-headers              save the HTTP headers to file
  -U,  --user-agent=AGENT          identify as AGENT instead of Wget/VERSION
       --no-http-keep-alive        disable HTTP keep-alive (persistent connections)
       --no-cookies                don't use cookies
       --load-cookies=FILE         load cookies from FILE before session
       --save-cookies=FILE         save cookies to FILE after session
       --keep-session-cookies      load and save session (non-permanent) cookies
       --post-data=STRING          use the POST method; send STRING as the data
       --post-file=FILE            use the POST method; send contents of FILE
       --method=HTTPMethod         use method "HTTPMethod" in the request
       --body-data=STRING          send STRING as data. --method MUST be set
       --body-file=FILE            send contents of FILE. --method MUST be set
       --content-disposition       honor the Content-Disposition header when
                                     choosing local file names (EXPERIMENTAL)
       --content-on-error          output the received content on server errors
       --auth-no-challenge         send Basic HTTP authentication information
                                     without first waiting for the server's
                                     challenge

HTTPS (SSL/TLS) options:
       --secure-protocol=PR        choose secure protocol, one of auto, SSLv2,
                                     SSLv3, TLSv1, TLSv1_1, TLSv1_2, TLSv1_3 and PFS
       --https-only                only follow secure HTTPS links
       --no-check-certificate      don't validate the server's certificate
       --certificate=FILE          client certificate file
       --certificate-type=TYPE     client certificate type, PEM or DER
       --private-key=FILE          private key file
       --private-key-type=TYPE     private key type, PEM or DER
       --ca-certificate=FILE       file with the bundle of CAs
       --ca-directory=DIR          directory where hash list of CAs is stored
       --crl-file=FILE             file with bundle of CRLs
       --pinnedpubkey=FILE/HASHES  Public key (PEM/DER) file, or any number
                                   of base64 encoded sha256 hashes preceded by
                                   'sha256//' and separated by ';', to verify
                                   peer against
       --random-file=FILE          file with random data for seeding the SSL PRNG

       --ciphers=STR           Set the priority string (GnuTLS) or cipher list string (OpenSSL) directly.
                                   Use with care. This option overrides --secure-protocol.
                                   The format and syntax of this string depend on the specific SSL/TLS engine.
HSTS options:
       --no-hsts                   disable HSTS
       --hsts-file                 path of HSTS database (will override default)

FTP options:
       --ftp-user=USER             set ftp user to USER
       --ftp-password=PASS         set ftp password to PASS
       --no-remove-listing         don't remove '.listing' files
       --no-glob                   turn off FTP file name globbing
       --no-passive-ftp            disable the "passive" transfer mode
       --preserve-permissions      preserve remote file permissions
       --retr-symlinks             when recursing, get linked-to files (not dir)

FTPS options:
       --ftps-implicit                 use implicit FTPS (default port is 990)
       --ftps-resume-ssl               resume the SSL/TLS session started in the control connection when
                                         opening a data connection
       --ftps-clear-data-connection    cipher the control channel only; all the data will be in plaintext
       --ftps-fallback-to-ftp          fall back to FTP if FTPS is not supported in the target server
WARC options:
       --warc-file=FILENAME        save request/response data to a .warc.gz file
       --warc-header=STRING        insert STRING into the warcinfo record
       --warc-max-size=NUMBER      set maximum size of WARC files to NUMBER
       --warc-cdx                  write CDX index files
       --warc-dedup=FILENAME       do not store records listed in this CDX file
       --no-warc-compression       do not compress WARC files with GZIP
       --no-warc-digests           do not calculate SHA1 digests
       --no-warc-keep-log          do not store the log file in a WARC record
       --warc-tempdir=DIRECTORY    location for temporary files created by the
                                     WARC writer

Recursive download:
  -r,  --recursive                 specify recursive download
  -l,  --level=NUMBER              maximum recursion depth (inf or 0 for infinite)
       --delete-after              delete files locally after downloading them
  -k,  --convert-links             make links in downloaded HTML or CSS point to
                                     local files
       --convert-file-only         convert the file part of the URLs only (usually known as the basename)
       --backups=N                 before writing file X, rotate up to N backup files
  -K,  --backup-converted          before converting file X, back up as X.orig
  -m,  --mirror                    shortcut for -N -r -l inf --no-remove-listing
  -p,  --page-requisites           get all images, etc. needed to display HTML page
       --strict-comments           turn on strict (SGML) handling of HTML comments

Recursive accept/reject:
  -A,  --accept=LIST               comma-separated list of accepted extensions
  -R,  --reject=LIST               comma-separated list of rejected extensions
       --accept-regex=REGEX        regex matching accepted URLs
       --reject-regex=REGEX        regex matching rejected URLs
       --regex-type=TYPE           regex type (posix|pcre)
  -D,  --domains=LIST              comma-separated list of accepted domains
       --exclude-domains=LIST      comma-separated list of rejected domains
       --follow-ftp                follow FTP links from HTML documents
       --follow-tags=LIST          comma-separated list of followed HTML tags
       --ignore-tags=LIST          comma-separated list of ignored HTML tags
  -H,  --span-hosts                go to foreign hosts when recursive
  -L,  --relative                  follow relative links only
  -I,  --include-directories=LIST  list of allowed directories
       --trust-server-names        use the name specified by the redirection
                                     URL's last component
  -X,  --exclude-directories=LIST  list of excluded directories
  -np, --no-parent                 don't ascend to the parent directory

Email bug reports, questions, discussions to <bug-wget@gnu.org>
and/or open issues at https://savannah.gnu.org/bugs/?func=additem&group=wget.

D:\SOFTWARE\Wget64>

https://www.gnu.org/software/wget/manual/wget.html

********************************************************************************

‘--restrict-file-names=modes’

更改在生成本地文件名期間必須轉義遠程 URL 中的哪些字符。 受此選項限制的字符被轉義,即替換為‘%HH’,其中‘HH’是對應於受限字符的十六進制數。 此選項還可用於強制所有字母大小寫為小寫或大寫。

默認情況下,Wget 會轉義操作系統文件名中無效或不安全的字符,以及通常不可打印的控製字符。 此選項對於更改這些默認值很有用,可能是因為您正在下載到非本機分區,或者因為您想要禁用控製字符的轉義,或者您想要進一步將字符限制為僅在 ASCII 值範圍內的字符。

這些模式是一組以逗號分隔的文本值。 可接受的值為“unix”、“windows”、“nocontrol”、“ascii”、“lowercase”和“uppercase”。 值“unix”和“windows”是互斥的(一個將覆蓋另一個),“lowercase”和“uppercase”也是如此。 最後那些是特殊情況,因為它們不會更改將被轉義的字符集,而是強制將本地文件路徑轉換為小寫或大寫。

當指定“unix”時,Wget 轉義字符“/”和 0-31 和 128-159 範圍內的控製字符。 這是類 Unix 操作系統的默認設置。

當給出“windows”時,Wget 轉義字符 '\'、'|'、'/'、':'、'?'、'"'、'*'、'<'、'>' 和控件 0-31 和 128-159 範圍內的字符。除此之外,Windows 模式下的 Wget 使用“+”而不是“:”來分隔本地文件名中的主機和端口,並使用“@”而不是“?”。 將文件名的查詢部分與其餘部分分開。因此,在 Unix 模式下將保存為“www.xemacs.org:4300/search.pl?input=blah”的 URL 將保存為“www.xemacs” .org+4300/search.pl@input=blah' 在 Windows 模式下。此模式是 Windows 上的默認模式。

如果您指定“nocontrol”,那麼控製字符的轉義也會被關閉。 當您在可以以 UTF-8 格式保存和顯示文件名的系統上下載名稱包含 UTF-8 字符的 URL 時,此選項可能有意義(UTF-8 字節序列中使用的一些可能的字節值落在指定的值範圍內 由 Wget 作為“控件”)。

“ascii”模式用於指定值超出 ASCII 字符範圍(即大於 127)的任何字節都應進行轉義。 這在保存編碼與本地使用的編碼不匹配的文件名時很有用。

********************************************************************************

最終

wget --no-check-certificate --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains www.xxx.idv.tw --no-parent https://www.xxx.idv.tw/

(完)

相關

[研究]wget 1.21.1 網站下載軟體安裝、測試 (Rocky Linux 9.1)
https://shaurong.blogspot.com/2023/03/wget-1211-rocky-linux-91.html

[研究]Wget for Windows 1.21.3試用
https://shaurong.blogspot.com/2023/03/wget-for-windows-1213.html