Fórum Ubuntu CZ/SK
Ubuntu pro osobní počítače => Internet a sítě => Téma založeno: Martin Šácha 25 Února 2012, 15:39:06
-
Ahoj, potřebuji postahovat všechny linky z html souboru se *zachováním stromové struktury těch linků, problém je že jsou v URL mezery, diakritika a další podivný znaky. Spojení se naváže, soubor najde, ale nestáhne...
je to španělský systém tak se moc nedivte:)
--2012-02-25 15:02:20-- http://www.example.com/uploader/files/carlos/skola/fjfi/angli%C4%8Dtina/ap%20-%20%C4%8D%C3%A1pov%C3%A1/ukol%20-%20cover%20letter.docx
Conectando a www.example.com|192.168.0.88|:80... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 13200 (13K) [application/vnd.openxmlformats-officedocument.wordprocessingml.document]
www.example.com/uploader/files/carlos/skola/fjfi/angli�%8Dtina/ap - �%8Dápová: No existe el fichero o el directorio
www.example.com/uploader/files/carlos/skola/fjfi/angli�%8Dtina/ap - �%8Dápová/ukol - cover letter.docx: No existe el fichero o el directorio
No se puede escribir en «www.example.com/uploader/files/carlos/skola/fjfi/angli\304%8Dtina/ap - \304%8Dápová/ukol - cover letter.docx» (No existe el fichero o el directorio).
Zkoušel jsem a výstup stejný:(
~$ wget --input-file="/dev/shm/upl.txt" --force-html --force-directories --header="Accept-Encoding: utf-8"
~$ wget --input-file="/dev/shm/upl.txt" --force-html --force-directories --restrict-file-names="nocontrol"
~$ wget --input-file="/dev/shm/upl.txt" --force-html --force-directories --remote-encoding="UTF-8"
Esta version no permite IRI
Díky za nakopnutí...
-
No existe el fichero o el directorio
neznamena to nahodou, ze soubor nebo adresar neexistuje?
-
Ano, ale tam je jasne videt ze si z textaku ten link vezme, pripoji se na server, dostane 200 OK, a az pak ho neulozi.
-
A poradi si spanelsky system s diakritikou? Mozna by pomohlo: (man wget)
--restrict-file-names=modes
Change which characters found in remote URLs must be escaped
during generation of local filenames. Characters that are
restricted by this option are escaped, i.e. replaced with %HH,
where HH is the hexadecimal number that corresponds to the
restricted character. This option may also be used to force all
alphabetical cases to be either lower- or uppercase.
...
...
If you specify nocontrol, then the escaping of the control
characters is also switched off. This option may make sense when
you are downloading URLs whose names contain UTF-8 characters, on
a system which can save and display filenames in UTF-8 (some
possible byte values used in UTF-8 byte sequences fall in the
range of values designated by Wget as "controls").
The ascii mode is used to specify that any bytes whose values are
outside the range of ASCII characters (that is, greater than 127)
shall be escaped. This can be useful when saving filenames whose
encoding does not match the one used locally.
-
--restrict-file-names=nocontrol/unix/ascii jsem zkoušel a nic:( A přitom ze serveru odpověd přijde, soubor existuje, pošle jeho velikost a mime-type...viz výpis nahoře.
-
Problém byl mezi NTFS, truecryptem a wokenim kodovanim nazvů souborů. Nicméně stačí někde v unixovém prostoru udělat simlink a už to funguje jak má :)
Howto fix:
~$ mkdir /cesta/k/cilovemu/adresari
~$ cd /dev/shm
~$ ln -s /cesta/k/cilovemu/adresari
~$ cd ./<nazev_adresare>
~$ wget [volby] --restrict-file-names=ascii