Advertisement
RibaSoft

Converte link do GoogleDrive para link direto.

Feb 20th, 2024
922
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.51 KB | Software | 0 0
  1.   function ConverteLink(){
  2.     var Edit = document.getElementById('edit');
  3.     var Texto = Edit.value;
  4.      
  5.     if(Texto.substring(0, 32) != 'https://drive.google.com/file/d/'){
  6.         alert('Link Inválido!');      
  7.         return;
  8.     }
  9.      
  10.     var T = 'https://drive.google.com/file/d/';
  11.     var Inicio = T.length;
  12.     var Fim = Texto.indexOf('/view?usp=sharing');
  13.     var ID = Texto.substring(Inicio, Fim);
  14.     var NovoLink = 'https://docs.google.com/uc?export=download&id=' + ID;
  15.     Edit.value = NovoLink;
  16.     alert('Convertido!');
  17.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement