Youtube Playlist Video Link Extractor

tries to extract Youtube Video links from playlists page to be able to copy links to external music players like Daum PotPlayer

  1. // ==UserScript==
  2. // @name Youtube Playlist Video Link Extractor
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description tries to extract Youtube Video links from playlists page to be able to copy links to external music players like Daum PotPlayer
  6. // @author Yooness Rostamy
  7. // @match https://www.youtube.com/playlist?list=*
  8. // @grant none
  9. // @resource http://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css
  10. // @require https://code.jquery.com/jquery-1.12.4.min.js
  11. // @require https://code.jquery.com/ui/1.12.1/jquery-ui.min.js
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. var opt = {
  18. title: 'Youtube Playlist Links'
  19. };
  20.  
  21. if ($('#unique-selector').length === 0) {
  22. // code to run if it isn't there
  23. $("head").append('<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" type="text/css">');
  24. $("body").append ( ' \
  25. <div id="dialog" title="Basic dialog" style="z-index:9999999 !important;"> \
  26. <textarea rows="20" cols="50" id="vlinks" spellcheck="false"></textarea> \
  27. <strong id="vcount"><strong> \
  28. </div> \
  29. ' );
  30. }
  31.  
  32.  
  33. var ar=[];
  34. $("ytd-playlist-video-renderer > #content > a").each(function(index){var item = $(this).attr("href").replace(/&list.*/g,'');ar[index]=item;});//console.log(index+1 + " :" + $(this).attr("href").replace(/&list.*/g,''));});
  35. $("#vlinks").val(ar.map(x=> "https://www.youtube.com"+x).join("\n"));
  36. $("#vcount").text("count: " + ar.length);
  37. try{
  38. if(ypdialog.dialog('isOpen') == true)
  39. ypdialog.dialog('close');
  40. }
  41. catch(e){
  42. }
  43. window.ypdialog = $("#dialog").dialog(opt);
  44. ypdialog.dialog('open');
  45. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址