LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-15-2006, 11:40 AM   #1
spx2
Member
 
Registered: Dec 2005
Distribution: debian
Posts: 160

Rep: Reputation: 30
wget problem


i want to sort out some mess im trying to figure out
i saw some site showing some mp3's
i took them from the .html source
i put them in one of my own here
http://spx.t35.com/h.html
now i want to do in console wget -r http://spx.t35.com/h.html to get them
the problem is that it doesn't seem to download them and i don't know why
if anyone knows what the problem might be please tell me
 
Old 08-15-2006, 01:42 PM   #2
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
Are sure those are mp3 files and not just jpeg graphic files?
That is one truely weird website in any case.
 
Old 08-15-2006, 01:52 PM   #3
danga1993
LQ Newbie
 
Registered: Oct 2005
Location: In a house......
Distribution: Debian
Posts: 21

Rep: Reputation: 15
As pointed out, yes, they are linking purely to jpg files. Why not just run a recursive wget on the original site with these links instead of making your own page?
 
Old 08-16-2006, 04:41 AM   #4
spx2
Member
 
Registered: Dec 2005
Distribution: debian
Posts: 160

Original Poster
Rep: Reputation: 30
they are mp3's ,they are to be renamed after download.
anyway,i told above that i am doing wget -r spx.t35...blabla
and i am getting nowhere.
but if the links are to be downloaded one by one things work
well.
i am not going to sit and click my mouse allot to download
them all,i think this might be a solution not only for me
but also for others to automate such tasks.
if so,it would be pretty helpful and neat if we are to think
of a solution.
one would be to use vim to
take out the html tags and have only the links and then
put "wget " in front of every line.
but how do i do that ?
 
Old 08-16-2006, 05:32 AM   #5
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
wget should be able to follow the links in the html document (using -r) of course.
What error message is wget giving you (if any)?

If you are getting the html page and then editing it, you could also try using 'sed' or 'awk' to do it for you, rather than editing the file in an editor like vim.
Once you get the file with all the URLs, wget's -i option should do the trick, I suppose.
 
Old 08-16-2006, 05:35 AM   #6
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
I got it to work. Apparently wget doesn't think h.html is valid html--maybe because it lacks a DOCTYPE line. But it works if you download h.html separately and then use wget like this:

$ wget -nd -A.jpg -ih.html --force-html

The optional "-nd" switch puts all the files in the current directory.
The optional "-A.jpg" causes only .jpg files to be accepted and doesn't keep others.
You could also try "-D web.tiscali.it" to only download from that domain.
 
Old 08-17-2006, 02:56 AM   #7
spx2
Member
 
Registered: Dec 2005
Distribution: debian
Posts: 160

Original Poster
Rep: Reputation: 30
nice solution,can you explain how you did it kenjackson
 
Old 08-17-2006, 05:25 AM   #8
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
Explain? I'm not sure if you are asking how to execute the command, explain why it works, or explain the process by which I came up with it.

Since I am developing a website as my new hobby, and learning all things web, it bothered me that h.html didn't have a DOCTYPE statement. I also read the man page for wget and noticed the "--force-html" switch (which I had seen before and wondered when you would ever use it). So I tried it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with wget COMMAND Fond_of_Opensource Linux - Newbie 2 06-30-2006 03:44 AM
problem using wget, please help squirrel001 Linux - Networking 8 03-01-2006 07:01 AM
wget problem with mirroring Tinku Linux - General 3 01-15-2006 08:18 AM
problem wiht wget true_atlantis Linux - Software 5 01-13-2004 07:52 PM
wget continuation problem ksd Linux - Software 2 10-20-2003 10:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration