รายการ video ใน playlist ของ Youtube รับได้ไม่เกิน 5000 video, ถ้าเต็มแล้วจะไม่สามารถเพิ่ม video ลงไปใน playlist นั้นได้อีก
Playlist ที่เป็นของระบบของ Youtube จะไม่สามารถลบทั้งหมดได้ในคราวเดียวเหมือน playlist ที่เราสร้างขึ้นเอง ถ้าเป็นรายการที่สร้างขึ้นเอง เราก็สามารถลบ playlist นั้นไปเลยแล้วสร้างใหม่ได้ แต่ถ้าเป็นของระบบ เช่น รายการ ดูภายหลัง หรือ Watch Later จะลบ playlist นั้นไม่ได้ ทำได้แค่ ไล่ลบทีละ video ซึ่งถ้ามีไม่เยอะก็ไม่ยาก แต่ถ้ามีเป็นร้อยเป็นพันก็ไม่ไหว
เราจึงต้องอาศัย script เพื่อวิ่งวนไล่ลบทีละรายการออกจาก playlist นั้นจนหมด โดยอาศัย Developer Tool ของ Chrome
ขั้นตอน: *** ใช้ได้กับ Chrome บนเครื่องคอมพิวเตอร์เท่านั้น ***
1. เปลี่ยนภาษาของ Youtube เป็น English (US)

4. ในหน้า Console ให้พิมพ์ allow pasting แล้วกดปุ่่ม Enter (ถ้าเคย allow pating มาก่อนแล้ว อาจจะมี error ก็ไม่เป็นไร)
5. จากนั้น Copy โค้ดด้านล่างนี้ paste ลงไปในหน้า console แล้วกดปุ่ม Enter
var showUnavail=document.evaluate( '//yt-formatted-string[contains(text(),"Show unavailable")]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );if(showUnavail.snapshotLength>0) showUnavail.snapshotItem(0).click(); else {setInterval(function () {var beetemp=document.querySelector('ytd-item-section-renderer');beetemp.querySelector('tp-yt-iron-dropdown').setAttribute("aria-hidden","false");beetemp.querySelector('#button button[class="style-scope yt-icon-button"]').focus();beetemp.querySelector('#button button[class="style-scope yt-icon-button"]').click(); var things = document.evaluate( '//span[contains(text(),"Remove from")]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); for (var i = 0; i < things.snapshotLength; i++) {things.snapshotItem(i).focus(); things.snapshotItem(i).click(); } }, 1000);}


ไม่มีความคิดเห็น:
แสดงความคิดเห็น