-
Notifications
You must be signed in to change notification settings - Fork 1
/
m-team.upload.user.js
30 lines (27 loc) · 1.04 KB
/
m-team.upload.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// ==UserScript==
// @name mt upload
// @namespace https://github.com/tomyangsh/userscrips
// @include https://kp.m-team.cc/upload.php#info=*
// @version 1.1.1
// @grant none
// ==/UserScript==
(function() {
'use strict'
let url = location.hash.match(/(^|#)info=([^#]*)(#|$)/)[2]
let xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
let dic = JSON.parse(xhttp.responseText);
document.querySelector('#browsecat').value = dic.cat;
document.getElementsByName('small_descr')[0].value = dic.name;
document.getElementsByName('url')[0].value = `https://www.imdb.com/title/${dic.imdb}/`;
document.getElementsByName('codec_sel')[0].value = dic.code;
document.getElementsByName('standard_sel')[0].value = dic.res;
document.getElementsByName('processing_sel')[0].value = dic.area;
document.querySelector('#descr').value = dic.des;
document.querySelector("#l_sub").checked = dic.zhsub;
}
};
xhttp.open("GET", url, true);
xhttp.send();
})()