Hey guys, is it possible to write such routine, that everyone can listen to an MP3, but not download them? My father wants to experiment with such stuff, that people can listen to certain music, but not download it, because of copoyrights. Thanks!
Consider: playing back an audio file inherently requires receiving a copy of it in some form. The best you can do is make it difficult for unsophisticated individuals to make additional copies.

Easy solutions include Soundcloud or Bandcamp.
My idea was to store the MP3 in a subfolder, and use some tricks to rewrite the URL as a PHP variable, so test.com/folder/subfolder/file.mp3 turns into test.com?path=folder/subfolder/file.mp3 for example. Then I could simply write a code snippet that checks if variable path points to the mp3 file or not.

EDIT: nevermind, that only works with paths, not with files Sad
Is that not the idea of streaming? Of course from a technological standpoint, that's horrible because the hosting servers have to resend large files just cause people don't want to store them (which I mean, a subscription to a streaming service costs almost as much as buying a hard drive and downloading the files you want). On top of that, it eats up your bandwidth and requires the hosting server to also have gigantic bandwidths. As stated above, streaming requires a copy to be sent, which means anyone with sufficient skill can intercept it and put the file back together, but that quickly becomes unpractical when you consider downloading things illegally instead (which is presumably just as illegal as saving a file that you reportedly streamed). The safest way would be to have a secured app, sending and receiving encrypted data through a VPN tunnel, but that is also impractical for average users. The idea is that you can't easily intercept the packets because they are in a secured tunnel, and if you do, its encrypted and only the app is able to decrypt it. If the app is water-tight (which is very hard to achieve) then you have something that is essentially safe.
You'd basically wind up reinventing DRM. The best solution is to not include content that isn't copyrighted by you, if you are afraid of legal repercussions (although to be frank with you, you're not very likely to get sued because most companies don't have time to deal with people in court and just file cease-and-desist claims en masse).
Sorry for bumping this topic. So, rather than preventing them at all from downloading, which seems to be impossible, I tried several tricks to hide them, or making it really hard to find. I tried htaccess, but if I then block the MP3, <audio> doesn't work anymore, so that doesn't help. Another idea was to copy the MP3 to a temp folder, load it in the <audio> tag, and then immediately remove the folder, but I can't get that working yet + an experienced person can easily remove the JS code to remove the folder. Also, in HTML5, there is an option to download the MP3 IMMEDIATELY. I can remove that with CSS, but again, an experienced user can display it again, and download it.

c4ooo said I can maybe stream it, so downloading them second by second, which might work, so I might give that a try.

Any more ideas? Smile
It sounds like you've already figured out how to stream it and play it with the JS audio API. The only problem is that that's still relatively trivial to capture that stream and store it on the client-side, but as discussed previously, that's fairly unavoidable.
KermMartian wrote:
It sounds like you've already figured out how to stream it and play it with the JS audio API. The only problem is that that's still relatively trivial to capture that stream and store it on the client-side, but as discussed previously, that's fairly unavoidable.

And, as i said before, the user could always sound capture with recording software, or loopback his audio out jack into the mic jack.
Can someone try to get the mp3 from this website WITHOUT recording it? http://www.oefenfiles.nl/ Very Happy (I made something which should prevent downloading it, hopefully Wink )
Cute. It also doesn't work.

The 404 is when I hit the play button.

Relatively easy to scrape it by loading the page so it generates a key (directory name) then grabbing that, bypassing your script.
Code:
$ curl -O http://www.oefenfiles.nl/$(curl http://www.oefenfiles.nl/ | egrep -o '"[^\\.]+\.mp3"' | tr -d \")
One could also just disable scripts in the browser so it will never make the XHR to delete.php.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement