Final changes before branching
This commit is contained in:
parent
3bb393bbc7
commit
1606ef8c0e
@ -1,13 +1,17 @@
|
|||||||
class TrackController < ApplicationController
|
class TrackController < ApplicationController
|
||||||
require 'net/http'
|
require 'net/http'
|
||||||
require 'uri'
|
require 'uri'
|
||||||
|
|
||||||
|
@@token_salt = '8FW*W#dWOH*FHW4j:Q@RQ{Qo[qF;fw0`0w4fkl'
|
||||||
|
|
||||||
def listen
|
def listen
|
||||||
pp track = Track.where(:id => params[:id].to_i).first
|
pp track = Track.where(:id => params[:id].to_i).first
|
||||||
|
|
||||||
data = Vkontakte.get(track.artist_name, track.name, (track.length / 1000).round)
|
data = Vkontakte.get(track.artist_name, track.name, (track.length / 1000).round)
|
||||||
# data = Vkontakte.get(1, 1, 1)
|
# data = Vkontakte.get(1, 1, 1)
|
||||||
url = URI.parse(data['url'])
|
url = URI.parse(data['url'])
|
||||||
nginx_url = '/proxy-stream/no-token/' << data['remixsid'] << '/' << '5' << '/' << url.host << url.path
|
token = Digest::SHA256.hexdigest(params[:id] << @@token_salt)
|
||||||
|
nginx_url = '/proxy-stream/' << token << '/' << data['remixsid'] << '/' << '5' << '/' << url.host << url.path
|
||||||
|
|
||||||
headers['Content-Type'] = 'audio/mpeg'
|
headers['Content-Type'] = 'audio/mpeg'
|
||||||
headers['X-Accel-Redirect'] = nginx_url
|
headers['X-Accel-Redirect'] = nginx_url
|
||||||
|
@ -45,13 +45,13 @@ Paganini: # Tom_Orrow
|
|||||||
user_agent: "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
|
user_agent: "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
|
||||||
|
|
||||||
# Stolen
|
# Stolen
|
||||||
Stolen_Moroz:
|
# Stolen_Moroz:
|
||||||
user_id: 9444259
|
# user_id: 9444259
|
||||||
email: 89232979779@mail.ru
|
# email: 89232979779@mail.ru
|
||||||
password: beatcobot1
|
# password: beatcobot1
|
||||||
remixsid: d5b1289ae534887319f41bdebf435f9ed3721ccf9203d7
|
# remixsid: d5b1289ae534887319f41bdebf435f9ed3721ccf9203d7
|
||||||
remixchk: 5
|
# remixchk: 5
|
||||||
user_agent: "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
|
# user_agent: "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
|
||||||
|
|
||||||
Stolen_NarutoSasuke:
|
Stolen_NarutoSasuke:
|
||||||
user_id: 29280365
|
user_id: 29280365
|
||||||
|
5
nginx/proxy.conf
Normal file → Executable file
5
nginx/proxy.conf
Normal file → Executable file
@ -30,9 +30,8 @@ location ~* ^/proxy-stream/(.*?)/(.*?)/(.*?)/(.*?)/(.*) {
|
|||||||
# backend does not support Content-Disposition
|
# backend does not support Content-Disposition
|
||||||
# headers used to specify file name browsers use
|
# headers used to specify file name browsers use
|
||||||
# when save content to the disk
|
# when save content to the disk
|
||||||
proxy_ignore_headers Cache-Control;
|
proxy_ignore_headers Cache-Control Expires;
|
||||||
#add_header Content-Disposition 'attachment; filename=audio.mp3';
|
|
||||||
#add_header Connection 'close';
|
|
||||||
|
|
||||||
# Do not touch local disks when proxying
|
# Do not touch local disks when proxying
|
||||||
# content to clients
|
# content to clients
|
||||||
|
Loading…
x
Reference in New Issue
Block a user