How to export a list of media urls?

Hello friends
I have to add hundreds of documents and images to wp posts trough a code that uses the media url:

I've uploaded the documents to the media library. Is there a way to obtain a list of all the media url? Because getting it one by one can take ages.

Maybe a mysql querry? Thanks for your help!