6

I am trying to download a .txt file using terminal. Here is the link (the download starts immediately you open the link):

https://es.osdn.net/projects/sfnet_kaldi/downloads/wsj0-train-spkrinfo.txt

I tried to download it with the command

wget "https://es.osdn.net/projects/sfnet_kaldi/downloads/wsj0-train-spkrinfo.txt"

Unfortunately the only thing I got after running that command was the page source :(

Could someone tell me what the correct way to download this file from Terminal is?

Thanks in advance!

1
  • @RuiFRibeiro - try it before you suggest it, please Commented Feb 25, 2018 at 21:25

3 Answers 3

13

If you follow their HTML, they do some tricks to hide the actual source of contents.

The file you want to download, can be downloaded from the source where they are getting it with the command:

 wget http://jaist.dl.sourceforge.net/project/kaldi/wsj0-train-spkrinfo.txt

So, it is not you are lacking in Unix knowledge, at the end of the day, they are just being obtuse on purpose.

You can also access all the files of this project (kaldi) in their main page at https://sourceforge.net/projects/kaldi/files/ (older version, pointed by your original link)

And going there, you see there is a newer version at https://github.com/kaldi-asr/kaldi

3
  • 1
    Wooow it never occurred to me to check the HTML code. I don't like that kind of tricky websites at all... I do not know why they have to hide the "real link" users are looking for. Anyway your answer made my day. Thank you :) Commented Feb 25, 2018 at 21:41
  • 2
    @little_mice I haven't looked at your link specifically, but there are various reasons sites do this. Mainly revolving around their desire to have you visit their actual page to get the resource rather than bypassing it (e.g. they want to display ads, promote their brand, etc.).
    – JBentley
    Commented Feb 26, 2018 at 1:20
  • 1
    @JBentley True indeed, but in this case a site dedicated to Open Source obfuscating what helps them grow is a bit ... twisted. Commented Feb 26, 2018 at 5:56
2

Your link "looks" like a text file link that should download the way you tried, using wget - you did everything correctly. The problem is that the people running the website are behaving "trick-ily" - they've configure the website so that the link is not really a text file, and they want to force you to navigate through their web interface and perform at least one more click. I hate such websites, but its their content, so its their rules.

Maybe someone else will step forward with a workaround, but be aware, that no workaround will be generic to all websites, or even necessarily different pages on the same site.

0
2

As it actually says on the page itself:

wget -O wsj0-train-spkrinfo.txt \
     'https://es.osdn.net/frs/g_redir.php?m=kent&f=kaldi%2Fwsj0-train-spkrinfo.txt'

But there is no general rule for this unfortunately, it depends on the implementation of the page.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .