Greasy Fork is available in English.

Çeşitli Siteler İçin URL'den Arama

URL'den arama yapmaya olanak sağlar (URL Örneği: https://subscene.com/subtitles/title?q=Dexter).

Version vom 06.05.2023. Aktuellste Version

Dieses Skript sollte nicht direkt installiert werden. Es handelt sich hier um eine Bibliothek für andere Skripte, welche über folgenden Befehl in den Metadaten eines Skriptes eingebunden wird // @require https://updategreasyfork.deno.dev/scripts/427315/1186611/%C3%87e%C5%9Fitli%20Siteler%20%C4%B0%C3%A7in%20URL%27den%20Arama.js

// ==UserScript==
// @name         Çeşitli Siteler İçin URL'den Arama
// @version      1.5
// @description  URL'den arama yapmaya olanak sağlar (URL Örneği: https://subscene.com/subtitles/title?q=Dexter).
// @author       nht.ctn
// @namespace    https://github.com/nhtctn

// @match      *://turktorrent.us/?p=torrents&pid=10&q=*
// @match      *://subscene.com/subtitles/title?q=*
// @include    *://*turkanime.co/?q=*
// @grant        none
// @run-at       document-start
// @icon         https://turktorrent.us/favicon.ico?lv=2.2
// @require	     https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// ==/UserScript==
/* global $ */
/*jshint esversion: 6 */

(function() {
	'use strict';

	const pageUrl = window.location.href;
	if (pageUrl.search(/https?:\/\/turktorrent\.us/) >= 0) {
		window.stop();

		let urlParams = new URLSearchParams(window.location.search);
		let postKeyword = urlParams.get('q');
		let postUrl = 'https://turktorrent.us/?p=torrents&pid=10';

		if (urlParams.get('q') && postKeyword !== '') {
			let postForm = document.createElement("form");
			postForm.setAttribute("method", "post");
			postForm.setAttribute("action", postUrl);
			let hiddenField = document.createElement("input");
			hiddenField.setAttribute("name", "keywords");
			hiddenField.setAttribute("value", postKeyword);
			hiddenField.setAttribute("type", "hidden");
			postForm.appendChild(hiddenField);
			let hiddenSelect = document.createElement("select");
			hiddenSelect.setAttribute("name", "search_type");
			let hiddenOpt = document.createElement("option");
			hiddenOpt.setAttribute("value", "name");
			hiddenSelect.appendChild(hiddenOpt);
			postForm.appendChild(hiddenSelect);
			console.log(postForm);
			document.getElementsByTagName('html')[0].appendChild(postForm);
			postForm.submit();
		}
		else {
			document.location = 'https://turktorrent.us/?p=torrents&pid=10';
		}
	}
	else if (pageUrl.search(/https?:\/\/subscene\.com/) >= 0) {
		window.stop();
		const myTimeout = setTimeout(function(){
		if ($("html").attr("searchByTitle") != 1) {
			$("html").attr("searchByTitle", 1);
			var urlParams = new URLSearchParams(window.location.search);
			var postKeyword = urlParams.get('q');
			var postUrl = '/subtitles/searchbytitle';

			if (urlParams.get('q') && postKeyword !== '') {
				var postForm = document.createElement("form");
				postForm.setAttribute("method", "post");
				postForm.setAttribute("action", postUrl);
				var hiddenField = document.createElement("input");
				hiddenField.setAttribute("name", "query");
				hiddenField.setAttribute("value", postKeyword);
				hiddenField.setAttribute("type", "hidden");
				postForm.appendChild(hiddenField);
				document.getElementsByTagName('html')[0].appendChild(postForm);
				postForm.submit();
			}
			else{
				document.location = 'https://subscene.com/subtitles';
			}
		}
		}, Math.round(Math.random()*1000));
	}
	else if (pageUrl.search(/https?:\/\/.+turkanime\.co/) >= 0) {
		window.stop();

		let urlParams = new URLSearchParams(window.location.search);
		let postKeyword = urlParams.get('q');

		if (urlParams.get('q') && postKeyword !== '') {
			let postForm = document.createElement("form");
			postForm.setAttribute("method", "post");
			postForm.setAttribute("action", "arama");
			let hiddenField = document.createElement("input");
			hiddenField.setAttribute("name", "arama");
			hiddenField.setAttribute("value", postKeyword);
			hiddenField.setAttribute("type", "hidden");
			postForm.appendChild(hiddenField);
			document.getElementsByTagName('html')[0].appendChild(postForm);
			postForm.submit();
		}
	}

})();