File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- <!-- YouTube Subscription Feed Mock Structure -->
1+ <!-- YouTube Subscription Feed Mock Structure - pre 2026-04 - ->
22< div id ="page-manager ">
33 < ytd-browse page-subtype ="subscriptions ">
44 < div id ="primary ">
2727 < a id ="video-title " href ="/watch?v=video1234567 ">
2828 < span > Video 1</ span >
2929 </ a >
30- < div class ="ytBadgeShapeText "> 5:30</ div >
30+ < div class ="yt-badge-shape__text "> 5:30</ div >
3131 </ div >
3232 </ ytd-rich-item-renderer >
3333
3737 < a id ="video-title " href ="/watch?v=video2345678 ">
3838 < span > Video 2</ span >
3939 </ a >
40- < div class ="ytBadgeShapeText "> 10:00</ div >
40+ < div class ="yt-badge-shape__text "> 10:00</ div >
4141 </ div >
4242 </ ytd-rich-item-renderer >
4343
6666 < span > Members Only Video</ span >
6767 </ a >
6868 < div class ="yt-badge-shape--membership "> Members only</ div >
69- < div class ="ytBadgeShapeText "> 20:00</ div >
69+ < div class ="yt-badge-shape__text "> 20:00</ div >
7070 </ div >
7171 </ ytd-rich-item-renderer >
7272
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ function getVideoId(item) {
4343}
4444
4545function getVideoDuration ( item ) {
46+
4647 // Try old layout selector
4748 let durationDiv = item . containingDiv . querySelector ( ".ytBadgeShapeText" ) ;
4849 if ( ( durationDiv != null ) && ( durationDiv . textContent . includes ( ":" ) ) ) {
@@ -61,6 +62,12 @@ function getVideoDuration(item) {
6162 }
6263 }
6364
65+ // Try older layout selector pre 2026-04
66+ let durationDiv = item . containingDiv . querySelector ( ".yt-badge-shape__text" ) ;
67+ if ( ( durationDiv != null ) && ( durationDiv . textContent . includes ( ":" ) ) ) {
68+ return durationDiv . textContent ;
69+ }
70+
6471 return null ;
6572}
6673
You can’t perform that action at this time.
0 commit comments