Skip to content

Commit 3968a04

Browse files
authored
fix: autoTopList with new YouTube version
close #20
1 parent e70cd8a commit 3968a04

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

user script/yt-playlist-filter.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name YouTube Save to Playlist filter
33
// @namespace fred.vatin.yt-playlists-filter
4-
// @version 1.1.10
4+
// @version 1.1.11
55
// @description Tap P key to open the “save to playlist” menu where your can type to filter
66
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
77
// @author Fred Vatin
@@ -65,7 +65,7 @@
6565
const selector_ListType2 = "#playlists";
6666
const selector_ListItemsType1 = ".toggleableListItemViewModelHost";
6767
const selector_ListItemsType2 = ".ytd-add-to-playlist-renderer";
68-
const selector_SelItemsType1 = `:scope > yt-list-item-view-model[aria-pressed="true"]`;
68+
const selector_SelItemsType1 = `:scope > yt-list-item-view-model[aria-label~="Selected"]`;
6969
const selector_SelItemsType2 = `:scope > #checkbox[aria-checked="true"]`;
7070
const selector_ItemType1 = ".ytAttributedStringHost";
7171
const selector_ItemType2 = "#label";
@@ -658,7 +658,7 @@
658658
const sortedItems = Array.from(playlists.querySelectorAll(selector_ListItems));
659659
console.log("✅ [autoTopList] sortedItems number: ", sortedItems.length);
660660
} else {
661-
console.log("❌ [autoTopList] this video doesn’t belong to any existing playlist. No sorting needed.");
661+
console.log(`❌ [autoTopList] Selector "${selector_SelItems}" not found. This video may not belong to any existing playlist. Sorting aborted.`);
662662
}
663663
}
664664

0 commit comments

Comments
 (0)