I have a large text file which has a lot of links and I need python script to extract all the names of the files which end with .pdf format and (sorted without repeated result) ?

sample example from the file:

http://www.123.com/file.pdf http://www.123.com/pdfhello
http://www.456.com/hello/one.file.pdf http://www.123.com http://www.123.com
http://www.456.com/hello/one.file.pdf


I need...