Greasy Fork is available in English.

Kej YouTube DL Helper

download extension for kej.tw/flvretriever

  1. // ==UserScript==
  2. // @name Kej YouTube DL Helper
  3. // @author DickyT
  4. // @license GPL version 3
  5. // @encoding utf-8
  6. // @date 17/05/2015
  7. // @modified 22/05/2015
  8. // @include http://kej.tw/*
  9. // @grant GM_xmlhttpRequest
  10. // @run-at document-end
  11. // @version 0.0.6
  12. // @description download extension for kej.tw/flvretriever
  13. // @namespace ytbkejhelper
  14. // ==/UserScript==
  15.  
  16.  
  17. exportFunction(function() {
  18. unsafeWindow.document.getElementById('videoInfo').value = '請求中... Requesting data...';
  19. GM_xmlhttpRequest({
  20. method: 'GET',
  21. url: unsafeWindow.document.getElementById('linkVideoInfoURL').href,
  22. onload: function(data) {
  23. if (data.status == 200) {
  24. unsafeWindow.document.getElementById('videoInfo').value = data.responseText;
  25. unsafeWindow.getYouTubeUrl();
  26. }
  27. else {
  28. unsafeWindow.document.getElementById('videoInfo').value = '請求失敗 請重試 Request Fail, please try again';
  29. }
  30. }
  31. });
  32. }, unsafeWindow, {defineAs: 'getVideoInfo'});
  33.  
  34. var dlAnchor = document.getElementById('linkVideoInfoURL');
  35. dlAnchor.innerHTML = '重新請求 Request again';
  36. unsafeWindow.window.getVideoInfo();
  37. dlAnchor.addEventListener('click', function(e) {
  38. e.preventDefault();
  39. unsafeWindow.window.getVideoInfo();
  40. });
  41.  
  42. var authorData = document.createElement('span');
  43. authorData.innerHTML = '<br><a href="http://kej.tw/flvretriever/" class="tdnone">Kej\'s YouTube FLV Retriever Helper (Userscript Extension)</a> is powered by <a href="http://me.idickyt.com/" class="tdnone">Dicky Tsang</a><br>';
  44. unsafeWindow.document.getElementsByClassName('setcenter')[0].appendChild(authorData);