Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function IMDBName(){
  2.         var filename = document.getElementById("torrent").value;
  3.         var filename = filename.toString();
  4.         var lowcase = filename.toLowerCase();
  5.         var start = lowcase.lastIndexOf("\\"); //for Google Chrome on windows
  6.                
  7.         if (start == -1){
  8.             start = lowcase.lastIndexOf("\/"); // for Google Chrome on linux
  9.             if (start == -1){
  10.                 start == 0;
  11.             }
  12.             else{
  13.                 start = start + 1;
  14.             }
  15.         }
  16.         else{
  17.             start = start + 1;
  18.         }
  19.         var end = lowcase.lastIndexOf("torrent");
  20.         var noext = filename.substring(start,end-1);
  21.         noext = noext.toLowerCase();
  22.         noext = noext.replace(/480p|720p|720i|1080p|1080i|x264|h.264|sd|blueray|bluray|xvid|dvd|dvdr|rip|dvd-rip|pdtv|tvrip|dsrip|webrip|proper|vcd|xxx|cam|ts|tc|scr|screen|screener|dvdscr|dvdscreen|pal|ntsc|complete|limited|extended|dc|internal|subbed|se|no|de|dutch|nordic|it|multi|multisubs|italian|german|swedish|norwegian|rated|unrated|r1|r2|r3|r4|r5|r6|repack|rerip|readnfo/g,''); //Big ass filter
  23.         noext = noext.replace(/\./g,' ');
  24.         noext = noext.replace(/-.*/g,'');
  25.         noext = noext.replace(/^[ ]+|[ ]+$/g,'');
  26.         noext = noext.replace(/\s+/g,'%20');                
  27.         return noext;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement