Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. javascript: (function() {
  2. 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); */
  3. (function() {
  4. var newscript = document.createElement('script');
  5. newscript.type = 'text/javascript';
  6. newscript.async = true;
  7. newscript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js';
  8. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(newscript);
  9. })();
  10. var result_div = document.createElement("div");
  11. result_div.id = "result_div";
  12. result_div.style = "padding: 7px 0px 0px;";
  13. var videoInfo = document.createElement("textarea");
  14. videoInfo.id = "videoInfo";
  15. if (document.getElementById('videoInfo') == null) document.getElementById('meta-contents').appendChild(videoInfo);
  16. if (document.getElementById('result_div') == null) document.getElementById('meta-contents').appendChild(result_div);
  17. var head = document.getElementsByTagName('head')[0];
  18. var auto_https = document.createElement('meta');
  19. auto_https.httpEquiv = "Content-Security-Policy";
  20. auto_https.content = "upgrade-insecure-requests";
  21. head.appendChild(auto_https); /*<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> */
  22. function doCORSRequest(options, printResult) {
  23. var x = new XMLHttpRequest();
  24. x.open(options.method, cors_api_url + options.url);
  25. x.onload = x.onerror = function() {
  26. printResult( /*options.method + ' ' + options.url + '\n' + x.status + ' ' + x.statusText + '\n\n' +*/ (x.responseText || ''));
  27. };
  28. if (/^POST/i.test(options.method)) {
  29. x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  30. }
  31. x.send(options.data);
  32. }
  33. var urlField = document.getElementById('linkVideoInfoURL');
  34. var dataField = '';
  35. var outputField = document.getElementById('videoInfo');
  36.  
  37. function oneclick() {
  38. doCORSRequest({
  39. method: 'GET',
  40. url: 'http://kej.tw/flvretriever/youtube.php?videoUrl=' + document.URL,
  41. data: dataField.value
  42. }, function printResult(result) {
  43. var kej_page = jQuery(result);
  44. console.log(kej_page.find('#linkVideoInfoURL').attr('href'));
  45. youtube_getvideoinfo_url = kej_page.find('#linkVideoInfoURL').attr("href") + "";
  46. jQuery.get(youtube_getvideoinfo_url.replace(/^.*\/\/[^\/]+/, ''), function(getvideoinfo) {
  47. outputField.value = getvideoinfo;
  48. doCORSRequest({
  49. method: 'GET',
  50. url: 'http://kej.tw/flvretriever/script/parse.youtube.fmt_url_map.js?v=20180622_0805',
  51. data: dataField.value
  52. }, function printResult(result) {
  53. eval(result + ';getYouTubeUrl();');
  54. });
  55. });
  56. });
  57. }
  58. oneclick();
  59. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement