Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript: (function() {
- var cors_api_url = 'https://cors-anywhere.herokuapp.com/'; /*redrict = document.domain; if (redrict == "www.youtube.com") window.location = "http://kej.tw/flvretriever/youtube.php?videoUrl=" + document.URL; */ /*var js = document.createElement("script"); js.type = "text/javascript"; js.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"; document.body.appendChild(js); */
- (function() {
- var newscript = document.createElement('script');
- newscript.type = 'text/javascript';
- newscript.async = true;
- newscript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js';
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(newscript);
- })();
- var result_div = document.createElement("div");
- result_div.id = "result_div";
- result_div.style = "padding: 7px 0px 0px;";
- var videoInfo = document.createElement("textarea");
- videoInfo.id = "videoInfo";
- if (document.getElementById('videoInfo') == null) document.getElementById('meta-contents').appendChild(videoInfo);
- if (document.getElementById('result_div') == null) document.getElementById('meta-contents').appendChild(result_div);
- var head = document.getElementsByTagName('head')[0];
- var auto_https = document.createElement('meta');
- auto_https.httpEquiv = "Content-Security-Policy";
- auto_https.content = "upgrade-insecure-requests";
- head.appendChild(auto_https); /*<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> */
- function doCORSRequest(options, printResult) {
- var x = new XMLHttpRequest();
- x.open(options.method, cors_api_url + options.url);
- x.onload = x.onerror = function() {
- printResult( /*options.method + ' ' + options.url + '\n' + x.status + ' ' + x.statusText + '\n\n' +*/ (x.responseText || ''));
- };
- if (/^POST/i.test(options.method)) {
- x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- }
- x.send(options.data);
- }
- var urlField = document.getElementById('linkVideoInfoURL');
- var dataField = '';
- var outputField = document.getElementById('videoInfo');
- function oneclick() {
- doCORSRequest({
- method: 'GET',
- url: 'http://kej.tw/flvretriever/youtube.php?videoUrl=' + document.URL,
- data: dataField.value
- }, function printResult(result) {
- var kej_page = jQuery(result);
- console.log(kej_page.find('#linkVideoInfoURL').attr('href'));
- youtube_getvideoinfo_url = kej_page.find('#linkVideoInfoURL').attr("href") + "";
- jQuery.get(youtube_getvideoinfo_url.replace(/^.*\/\/[^\/]+/, ''), function(getvideoinfo) {
- outputField.value = getvideoinfo;
- doCORSRequest({
- method: 'GET',
- url: 'http://kej.tw/flvretriever/script/parse.youtube.fmt_url_map.js?v=20180622_0805',
- data: dataField.value
- }, function printResult(result) {
- eval(result + ';getYouTubeUrl();');
- });
- });
- });
- }
- oneclick();
- })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement