agula forma de descargar el video de esta api tipo descarga directa

  • Autor Autor Armandolqr
  • Fecha de inicio Fecha de inicio
[{"file":"\/\/flashpro.gratisweb.site\/videoplayback\/13c4250a020377055b4a09afdb84ae3b\/a710cfa4010bc7f656d4c9a252be8953\/p\/v.mp4?token=10d683b315aecbfbf563d3762fa7ad605e4c4c91","type":"video\/mp4","label":"p"}],"tracks":[]}
este es el apartado de video con token
 
Usando fetch

JavaScript:
// Tu ves como obtienes el URL en un string
let url ='http://sample.example.file.doc'
const authHeader ="Bearer 6Q************"

const options = {
  headers: {
    Authorization: authHeader
  }
};
 fetch(url, options)
  .then( res => res.blob() )
  .then( blob => {
    var file = window.URL.createObjectURL(blob);
    window.location.assign(file);
  });

Fuente: https://stackoverflow.com/questions/32545632/how-can-i-download-a-file-using-window-fetch
 
Usando fetch

JavaScript:
// Tu ves como obtienes el URL en un string
let url ='http://sample.example.file.doc'
const authHeader ="Bearer 6Q************"

const options = {
  headers: {
    Authorization: authHeader
  }
};
 fetch(url, options)
  .then( res => res.blob() )
  .then( blob => {
    var file = window.URL.createObjectURL(blob);
    window.location.assign(file);
  });

Fuente: https://stackoverflow.com/questions/32545632/how-can-i-download-a-file-using-window-fetch
lo probare
 
Atrás
Arriba