16

I would like to obtain a link to an mp3 hosted in Google Drive that has the format filename.mp3, so I can link to it from sites that provide in-line audio players when linking to mp3 files.

I have searched the web and different SE sites, but the closest thing to a solution I have found is obtaining a direct download link for the file or advice on hosting it elsewhere. However, for (future) convenience I would prefer to host and link directly from / to Google Drive.

Can anyone provide some insight or point out why this might not work?

7 Answers 7

8

EDIT: This answer is outdated. googledrive.com/host has been deprecated as of August 31st 2016 and no longer works.

Yes, it is possible.

  1. First, change the directory permission to public in which your mp3 files reside.

  2. Copy the folder ID, that will be at the end of URL when you are inside the directory. It will be something like this

     0C2QKl-TsV6cVTE7wbWNOelRiRlk
    
  3. Next you can access the mp3 files using hosted mode:

     https://googledrive.com/host/0C2QKl-TsV6cVTE7wbWNOelRiRlk/filename.mp3
    

Note that the beginning part of the URL changes to https://googledrive.com/host/ for hosted mode compared to "normal" shared link mode URL https://drive.google.com/open?id=.

5
  • Thank you, Baljeet! This comes very close to what I had in mind. Do you know whether there is any way in which this procedure can be altered so the directory permission does not need to be set to "Public", but can instead be set to "Anyone with the link" while maintaining full functionality? Jul 27, 2014 at 15:02
  • 1
    @nholtappels I think currently this is the only way Jul 27, 2014 at 15:51
  • Unfortunately I don't think this works anymore. I made my folder public but this is the url i get https://drive.google.com/open?id=0B0GRVvnH21RdT3MwQ3lzN3Vjdnc&authuser=0 and my filename inside it is intro.wav
    – JGallardo
    May 27, 2015 at 10:35
  • It does work. @JGallardo you must use the googldrive.com/host url instead of the url it gives you when you click share
    – Tim
    Dec 15, 2015 at 11:10
  • 7
    This answer is outdated. googledrive.com/host has been deprecated as of August 31st 2016 and no longer works.
    – browly
    Jan 25, 2017 at 22:45
14

If you share an MP3 by link, you obtain a link like this

https://drive.google.com/file/d/XXXXXXXXXXXXXXXXXX/view?usp=sharing 

where XXXXXXXXXXXXXXXXXX is the ID of your MP3 file. Then you can obtain a direct link to this audio by

http://docs.google.com/uc?export=open&id=XXXXXXXXXXXXXXXXXX

In particular you can use

<audio controls>
   <source src="http://docs.google.com/uc?export=open&id=XXXXXXXXXXXXXXXXXX" type="audio/mp3">
   <p>Your browser does not support HTML5 audio :(</p>
</audio> 
3
  • 2
    The URL starting with googledrive.com/host... in the accepted answer no longer works. This should now be the correct answer.
    – saltface
    Jul 28, 2021 at 21:35
  • 1
    The accepted answer googledrive.com/host... should be downvoted until removed (people waste their time trying)
    – JinSnow
    Dec 1, 2021 at 6:15
  • for people coming after 2023, this answer worked for me
    – BigOther
    Jan 5 at 10:54
9

Don't know if this still helps anybody, but this can be done. With an “anybody with the link can view the file” link:

  • prefix the file ID with uc?id= and append it with &export=download

So it would look like this:

https://docs.google.com/uc?id=FILE-ID&export=download
1
  • 1
    Thank's, this should be the accepted answer! If you want your .mp3 to start playing immediately in the browser use &export=open.
    – drake7
    Mar 19, 2021 at 0:19
3

This example works:

<audio controls="">
   <source src="http://docs.google.com/uc?export=open&amp;id=1uZd99P8_xWM3fYsoSl4xHa8md2MWHa68" type="audio/mp3"></source>
   Your browser does not support HTML5 audio <br />

</audio>
1
  • +1 for being the first user to post this method (Kpym is the second one), but please add explanations so others can understand why are they doing something, i.e. why something works. Thanks!
    – Aleksandar
    Jan 12, 2019 at 19:56
1

spent an entire day on this problem. like others say it https://docs.google.com/uc?export=open&id=XXXXXXXXXXXXXXXXXXXXXXX worked few minutes then it got blocked.

I used Github. basically, you can drag and drop an MP4 file to an issue then use that link to upload in my code works. NOT MP3 because GitHub allows only certain files to be uploaded. then I googled mp3 convert to mp4 (which https://www.zamzar.com/). works.

0

I researched this topic today for about an hour. As of recently (i.e. 2015/05), I also don't believe it's possible any more, but I'd love to be proved wrong.

References

1
  • I edited the answer on 5/26/2016. I did not know that there is a hosted mode for Google Drive. Note that the beginning part of the URL changes to https://googledrive.com/host/ for hosted mode compared to "normal" shared link mode URL https://drive.google.com/open?id=.
    – Greg
    May 26, 2016 at 11:07
0

I had the same issue and got it work with the following URL:

https://docs.google.com/uc?export=open&id=XXXXXXXXXXXXXXXXXXXXXXX
2

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