Export Youtube Playlist in plaintext

Shows a list of the playlist video names in plaintext to be easily copied

目前為 2019-05-31 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Export Youtube Playlist in plaintext
// @namespace    1N07
// @version      0.1
// @description  Shows a list of the playlist video names in plaintext to be easily copied
// @author       1N07
// @require      https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @match        https://www.youtube.com/playlist*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var list;

    setTimeout(function(){
        $("ytd-playlist-sidebar-secondary-info-renderer > #owner-container").parent().after("<button id='exportPlainTextList'>Export as Plaintext</button>");
        $("#exportPlainTextList").click(function(){
            list = "";
            $("ytd-playlist-video-renderer #content #video-title").each(function(){
                list += $(this).attr("title") + "\n";
            });
            $("body").append('<div id="listDisplayContainer" style="position: fixed; z-index: 9999; top: 5%; right: 5%; background-color: gray; padding: 10px; border-radius: 5px;"><button style="float: right;" id="closeTheListThing">Close</button><textarea style="width: 50vw; height: 80vh; max-width: 90vw; max-height: 90vh;">'+list+'</textarea></div>');
            $("#closeTheListThing").click(function(){
                $("#listDisplayContainer").remove();
            });
        });
    }, 100);
})();