srrfmfh / 91porn

// ==UserScript==
// @namespace     https://openuserjs.org/users/srrfmfh
// @name          91porn
// @description   Showing the current basic and recommended format for a User script.
// @copyright     2021, srrfmfh (https://openuserjs.org/users/srrfmfh)
// @license       MIT
// @version       1.0.0
// @include       https://www.91porn.com/*
// @grant none
// ==/UserScript==

// ==OpenUserJS==
// @author srrfmfh
// ==/OpenUserJS==

function getQueryVariable(variable)
{
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if(pair[0] == variable){return pair[1];}
  }
  return(false);
}

(() => {
  const viewkey = getQueryVariable('viewkey')
  if(!viewkey) return;
  window.location.href = `https://80wvdrf.jiuse800.com/video/view/${viewkey}`
})();