If you use a download manager (JDownloader2 for example, though there are many others), you can just mark all the text with your mouse, copy to clipboard and it'll sort out all the links by itself.
Just a suggestion, but it makes stuff like this literally take seconds.