Fix parsing file information from link url
Correctly choose file and link urls