URL Based Search for Some Websites

If you enter required parameter in URL, it trigger a search on website. (URL example: https://subscene.com/subtitles/title?q=Avatar).

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/427315/1220388/URL%20Based%20Search%20for%20Some%20Websites.js

  1. // ==UserScript==
  2. // @name Çeşitli Siteler İçin URL'den Arama
  3. // @version 1.6
  4. // @description URL'den arama yapmaya olanak sağlar (URL Örneği: https://subscene.com/subtitles/title?q=Dexter).
  5. // @author nht.ctn
  6. // @namespace https://github.com/nhtctn
  7.  
  8. // @match *://turktorrent.us/?p=torrents&pid=10&q=*
  9. // @match *://subscene.com/subtitles/title?q=*
  10. // @include *://*turkanime.co/?q=*
  11. // @grant none
  12. // @run-at document-start
  13. // @icon https://turktorrent.us/favicon.ico?lv=2.2
  14. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
  15. // ==/UserScript==
  16. /* global $ */
  17. /*jshint esversion: 6 */
  18.  
  19. (function() {
  20. 'use strict';
  21.  
  22. const pageUrl = window.location.href;
  23. if ($('meta#redirecting648').length < 1) {
  24. if (pageUrl.search(/https?:\/\/turktorrent\.us/) >= 0) {
  25. window.stop();
  26. $('head').append('<meta id="redirecting648">');
  27.  
  28. let urlParams = new URLSearchParams(window.location.search);
  29. let postKeyword = urlParams.get('q');
  30. let postUrl = 'https://turktorrent.us/?p=torrents&pid=10';
  31.  
  32. if (urlParams.get('q') && postKeyword !== '') {
  33. let postForm = document.createElement("form");
  34. postForm.setAttribute("method", "post");
  35. postForm.setAttribute("action", postUrl);
  36. let hiddenField = document.createElement("input");
  37. hiddenField.setAttribute("name", "keywords");
  38. hiddenField.setAttribute("value", postKeyword);
  39. hiddenField.setAttribute("type", "hidden");
  40. postForm.appendChild(hiddenField);
  41. let hiddenSelect = document.createElement("select");
  42. hiddenSelect.setAttribute("name", "search_type");
  43. let hiddenOpt = document.createElement("option");
  44. hiddenOpt.setAttribute("value", "name");
  45. hiddenSelect.appendChild(hiddenOpt);
  46. postForm.appendChild(hiddenSelect);
  47. console.log(postForm);
  48. document.getElementsByTagName('html')[0].appendChild(postForm);
  49. postForm.submit();
  50. }
  51. else {
  52. document.location = 'https://turktorrent.us/?p=torrents&pid=10';
  53. }
  54. }
  55. else if (pageUrl.search(/https?:\/\/subscene\.com/) >= 0) {
  56. window.stop();
  57. $('head').append('<meta id="redirecting648">');
  58.  
  59. if ($("html").attr("searchByTitle") != 1) {
  60. $("html").attr("searchByTitle", 1);
  61. let urlParams = new URLSearchParams(window.location.search);
  62. let postKeyword = urlParams.get('q');
  63. let postUrl = '/subtitles/searchbytitle';
  64.  
  65. if (urlParams.get('q') && postKeyword !== '') {
  66. let postForm = document.createElement("form");
  67. postForm.setAttribute("method", "post");
  68. postForm.setAttribute("action", postUrl);
  69. let hiddenField = document.createElement("input");
  70. hiddenField.setAttribute("name", "query");
  71. hiddenField.setAttribute("value", postKeyword);
  72. hiddenField.setAttribute("type", "hidden");
  73. postForm.appendChild(hiddenField);
  74. document.getElementsByTagName('html')[0].appendChild(postForm);
  75. postForm.submit();
  76. }
  77. else{
  78. document.location = 'https://subscene.com/subtitles';
  79. }
  80. }
  81. }
  82. else if (pageUrl.search(/https?:\/\/.+turkanime\.co/) >= 0) {
  83. window.stop();
  84. $('head').append('<meta id="redirecting648">');
  85.  
  86. let urlParams = new URLSearchParams(window.location.search);
  87. let postKeyword = urlParams.get('q');
  88.  
  89. if (urlParams.get('q') && postKeyword !== '') {
  90. let postForm = document.createElement("form");
  91. postForm.setAttribute("method", "post");
  92. postForm.setAttribute("action", "arama");
  93. let hiddenField = document.createElement("input");
  94. hiddenField.setAttribute("name", "arama");
  95. hiddenField.setAttribute("value", postKeyword);
  96. hiddenField.setAttribute("type", "hidden");
  97. postForm.appendChild(hiddenField);
  98. document.getElementsByTagName('html')[0].appendChild(postForm);
  99. postForm.submit();
  100. }
  101. }
  102. }
  103.  
  104. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址