📜 ⬆️ ⬇️

Decentralization of site content

I propose to give users the opportunity to choose the service for the delivery of content. On the page there is only information about the content (Title of the song, film, book).

Site information and content are separated or not directly related. Responsibility for the legality of the content is transferred to the provider who provides it (the site on which the file is located). Since there are a lot of services already now (Various video hosting, audio hosting, libraries, etc.), the user will not be able to switch from one to another (connect another script) in case of blocking content.

Example:


The page contains such content.
<audio> Vivaldi Summer mvt 1 Allegro non molto - John Harrison violin </audio> 

')
Service (user script) user connected reads this content and changes to specific sources.
 <audio> <source src="http://upload.wikimedia.org/wikipedia/commons/1/19/04_-_Vivaldi_Summer_mvt_1_Allegro_non_molto_-_John_Harrison_violin.ogg"> </audio> 


Moreover, it may even be local files.
 <audio> <source src="file:///d:/music/04_-_Vivaldi_Summer_mvt_1_Allegro_non_molto_-_John_Harrison_violin.ogg"> </audio> 


And do not re-download the file from the Internet due to the fact that this track is played on the web site.

For the user, everything happens unnoticed. He simply presses the play button and the file is played. And no matter where this comes from.

An example of the benefits of this approach now:


On the website Vkontakte removed music. At the same time in the user's playlist there is a line with the name of the composition. A simple script can use this information to find the same track on Yandex.Music (where it is legal) and reproduce it without requiring additional actions from the user.

Web radio.


You can also organize and web radio. It’s enough for radio stations to transmit only the name of the song and its position at the moment, and the service (user script) delivers the song itself. In this case, the care of the license on the track is shifted to the supplier.

I have already experimented with the help of a custom script with playing Vkontakte tracks playing on terrestrial and Internet radio. It turns out clumsily, does not find some tracks due to incorrect titles or their absence, but it works.

Small demo:


  <h4>Blender Foundation Movies Collection</h4> <h5>Blender Foundation - Sintel (2010)</h5> <video width=640 height=480>Blender Foundation - Sintel (2010)</video> <h5>Blender Foundation - Big Buck Bunny (2007)</h5> <video width=640 height=480>Blender Foundation - Big Buck Bunny (2007)</video> <h5>Blender Foundation - Elephants Dream (2006)</h5> <video width=640 height=480>Blender Foundation - Elephants Dream (2006)</video> 


 //        (Userscript) //    Video   var videos = document.getElementsByTagName("VIDEO") for (var i=videos.length-1; i >= 0 ; --i){ var video = videos[i]; GM_xmlhttpRequest({ method: "POST", url: "http://www.example.com/get_video", headers: { "Content-Type": "application/x-www-form-urlencoded" }, data: video.textContent, onload: function(response) { var url = response.responseText; if (url){ //   - . var iframe = document.createElement("IFRAME") iframe.style = video.style iframe.width = video.width iframe.height = video.height iframe.src = url video.parentNode.replaceChild(iframe, video) } } }); } 


Demo

Source: https://habr.com/ru/post/197864/


All Articles