5

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!

  • @RuiFRibeiro - try it before you suggest it, please – user1404316 Feb 25 '18 at 21:25
12

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

| improve this answer | |
  • 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 :) – little_mice Feb 25 '18 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 Feb 26 '18 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. – Rui F Ribeiro Feb 26 '18 at 5:56
1

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.

| improve this answer | |
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.