Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(content categorization /filtering by keywords (regex), starting with:) permanent speed-up "speed-watching" #1760

Open
Eyevou opened this issue Sep 11, 2023 · 35 comments
Assignees
Labels
Completition / Revision Rethink, complete, improve, tweak our feature or structure. Filtering & Discovery (of Content) good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) Set & forget (automatic feature) All permanent effects should be favorable by design. (Avoiding side-effects >99.8% of the time) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥

Comments

@Eyevou
Copy link

Eyevou commented Sep 11, 2023

I normally have playback speed set to 2x and have recently, within the past two days, started seeing the addon not always set the value. I went into settings and checked (force even for music) and it's now setting correctly. The playback speed was not being applied to NORMAL videos that had nothing to do with the Music category.

Turning the (force even for music) setting on fixed the playback speed for all normal videos. Seems like something isn't checking correctly.


also: #1776

@Eyevou Eyevou added Bug Bug or required update after YouTube changes good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ labels Sep 11, 2023
@ImprovedTube
Copy link
Member

ImprovedTube commented Sep 11, 2023

hi! so it has not been a week?
thanks! #1750

@Eyevou
Copy link
Author

Eyevou commented Sep 11, 2023

I only started noticing it since resetting my browser, which I did 3 days ago. I then did some testing to be sure it wasn't just a music category thing, set Force even with music. Thought about it yesterday and posted about it today.

It could very well have been around for longer than that.

Sorry for not noticing #1750

feel free to merge, delete, or close this ticket. 😄

@ImprovedTube
Copy link
Member

ImprovedTube commented Sep 12, 2023

thanks, can you tell if the moments or the videos had anything in common, or check again?

( i guess you already tried v4.335 and it is not exactly only after starting your browser ( like #1750 ) and you didnt enable Don't speed up the (rare) category: Education either )

  • guess you would have mentioned if you watch a lot about music that is not music or anything,
    however here is how the music-detection works now:
    • By default nearly the whole category "music" (~1/5th of youtube)
      • unless rarely when a word like 'interview' or 'backstage' is in title or tags and it also wont have a duration very common for a song.
    • Additionally terms like "official video" & "sing along" are considered music, if they come in a normal song duration.
    • Additionally we consider music, that YouTube mentiones below the video descriptions, if the duration is reasonable for a song or the amount of songs. - However this check is last and can take long, because videos might start seconds before descriptions appear, so in this last case the music might be detected late by those seconds (if it is not already in the category music etc.)
    • // Data:
      let category = document.querySelector('meta[itemprop=genre]')?.content || false;
      if (this.storage.player_dont_speed_education === true && category === 'Education') {return;}
      if (this.storage.player_force_speed_on_music === true) {return;}
      let titleAndKeywords = document.getElementsByTagName('meta')?.title?.content + " " + document.getElementsByTagName('meta')?.keywords?.content || false;
      let musicRegexMatch = /official (music )?video|lyrics|cover[\)\]]|[\(\[]cover|cover version|karaok|(sing|play)[- ]?along|卡拉OK|卡拉OK|الكاريوكي|караоке|カラオケ|노래방/i.test(titleAndKeywords) || false;
      let notMusicRegexMatch = /do[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(titleAndKeywords) || false; // (Tags/keywords shouldnt lie & very few songs titles might have these words)
      let duration = document.querySelector('meta[itemprop=duration]')?.content || false; // Example: PT1H20M30S
      function parseDuration(duration) { const [_, h = 0, m = 0, s = 0] = duration.match(/PT(?:(\d+)?H)?(?:(\d+)?M)?(\d+)?S?/).map(part => parseInt(part) || 0);
      return h * 3600 + m * 60 + s; }
      let durationInSeconds = parseDuration(duration);
      function testSongDuration(s) {
      if (135 <= s && s <= 260) {return 'veryCommon';}
      if (105 <= s && s <= 420) {return 'common';}
      if (420 <= s && s <= 720) {return 'long';}
      if (45 <= s && s <= 105) {return 'short';}
      let musicSectionLength = document.querySelector('div#items[class*="music-section"]')?.children?.length;
      if (musicSectionLength && (85 <= s / musicSectionLength && s / musicSectionLength<= 355)) {return 'multiple';}
      }
      let songDurationType = testSongDuration(durationInSeconds);
      // check if the video is PROBABLY MUSIC:
      if ( ( category === 'Music' && (!notMusicRegexMatch || songDurationType === 'veryCommon'))
      || ( musicRegexMatch && typeof songDurationType !== 'undefined' && !notMusicRegexMatch )
      || ( category === 'Music' && musicRegexMatch && typeof songDurationType !== 'undefined'
      || (/album|Álbum|专辑|專輯|एलबम|البوم|アルバム|альбом|앨범/i.test(titleAndKeywords)
      && 1150 <= durationInSeconds && durationInSeconds <= 5000)
      )
      // || location.href.indexOf('music.') !== -1 // (=currently we are only running on www.youtube.com anyways)
      ) { } //music player.setPlaybackRate(1); video.playbackRate = 1;
      else { player.setPlaybackRate(Number(option)); video.playbackRate = Number(option); // #1729 question2
      // Now this video might rarely be music
      // - however we can make extra-sure after waiting for the video descripion to load... (#1539)
      var tries = 0; var intervalMs = 150; if (location.href.indexOf('/watch?') !== -1) {var maxTries = 10;} else {var maxTries = 1;}
      // ...except when it is an embedded player?
      var waitForDescription = setInterval(() => {
      if (document.querySelector('div#description') || (++tries >= maxTries) ) {
      if (document.querySelector('h3#title[class*="music-section"]') // indicates buyable/registered music
      && typeof testSongDuration(parseDuration(document.querySelector('meta[itemprop=duration]')?.content)) !== 'undefined' ) // resonable duration
      {player.setPlaybackRate(1); video.playbackRate = 1; clearInterval(waitForDescription);}}

@Eyevou
Copy link
Author

Eyevou commented Sep 12, 2023

I hadn't tried 4.335, I was on version 4.323.

The speed discrepancy was when I opened new videos in separate tabs, no closing or opening new browser sessions needed.

I'll grab the one from the git repo now and compile a indepth list of videos and get back to you, if I find anything.

@ImprovedTube
Copy link
Member

ImprovedTube commented Sep 12, 2023

wonderful! sent v4.337 to the stores (pending approval) (5th time in 2 weeks)

@meechgalhuquot
Copy link

meechgalhuquot commented Oct 18, 2023

Did forced playback speed get removed in the latest update? I no longer see it anywhere in the settings
Nevermind, it was just reworded and hidden behind a toggle hi! @meechgalhuquot

@Eyevou
Copy link
Author

Eyevou commented Oct 20, 2023

This video played at elevated speed despite clearly having "song" in the title.

https://www.youtube.com/watch?v=AH29SKJ_urg (Hazbin Hotel | Happy Day In Hell Full Song | Prime Video)


Not sure what's tripping this video to play at normal speed, it's not a song/music video, forcing playback of music jumps it.

https://www.youtube.com/watch?v=GfQYj15LKCA (Discord's Halloween Event, Free Nitro, and More!)


Both checked against the latest version on git, 4.358.

@ImprovedTube
Copy link
Member

  1. we still don't have the word song in the list.

    • in the title, it might not be music when combined with spotify/itunes/write a/compose/my/our etc?)
      • thus for now will only match \bfull song\b|\bsong:|\bsong[\!\$$]|^song\b|( - .*\bSong\b|\bSong\b.* - ) in titles
  2. logging the following in the browser console to test (we should have a feature to show the keywords)
    category: Entertainment//title & keywords: Discord's Halloween Event, Free Nitro, and More!$discord, discord server, discord nitro free, how to get discord nitro free, discord nitro free trial, discord nitro free 2023, free discord nitro, how to get discord nitro for free, discord nitro, discord memes, discord mod, discord call sound, discord halloween, discord halloween call sound, discord ringtone, discord ringtone remix, discord poll, discord nitro gift, discord easter egg, discord bug, discord secret//music word match: true// not music word match:false//duration: PT8M54S//song duration type: long

    • limiting the match remix: if it appears in the keywords, then it must appear as a single keyword
      • adding song and music as single keyword matches too!
        • = lets see who spams these

Thank you!

@ImprovedTube
Copy link
Member

ImprovedTube commented Oct 21, 2023

  • adding the words instrumental|backing track|medley|bootleg|mashup

  • and more words to consider album durations: mixtape|concert|\b(live|cd|vinyl|lp|ep)\b

keywords

...you can watch keywords: https://chrome.google.com/webstore/detail/youtube-tags/fffiogeaioiinfekkflcfebaoiohkkgp

@Eyevou
Copy link
Author

Eyevou commented Oct 21, 2023

Instead of maintaining a list on the back end, and hoping it works for everything, what if we were to allow the user to add their own custom list that we can provide a general pre-populated list of suggestions for.

ImprovedTube added a commit that referenced this issue Oct 21, 2023
@ImprovedTube
Copy link
Member

ImprovedTube commented Oct 21, 2023

yes, can / could. Also you can start with a link from the feature to this post & 1000s of people will review it.

  • Other Keywords people may not want to speed up: ambience, asmr, poetry, performed by, skit
  • Smarter Speed-up #1636

Also excited to see, if at our current approach, you soon wont find any more examples

music words:

  • too broad: Remastered, live at (would need to exclude movies, news)

  • music identifies:

    • Just added Studio version|Radio edit|radio version|Album version|Guest vocals|Guest musician
      Title track|Opening track|Closing track|Live acoustic|Extended version|Interlude|Bonus track|Hidden track|Alternate version|Featuring|Recorded at
    • Matching for title & keywords:
      var musicIdentifiers = new RegExp("(official|music|lyrics)[ -]video|(cover|studio|radio|album|alternate)[- ]version|theme song|soundtrack|unplugged|\bmedley\b|\blo-fi\b|\blofi\b|a(lla)? cappella|feat\.|(piano|guitar|jazz|ukulele|violin|reggae)[- ](version|cover)|karaok|backing[- ]track|instrumental|(sing|play)[- ]?along|卡拉OK|卡拉OK|الكاريوكي|караоке|カラオケ|노래방|bootleg|mashup|Radio edit|Guest (vocals|musician)|(title|opening|closing|bonus|hidden)[ -]track|live acoustic|interlude|featuring|recorded (at|live)" , "i");
      var musicRegexMatch = musicIdentifiers.test(title);
      if (!musicRegexMatch) { musicRegexMatch = /lyrics|\bremix|\bfull song\b|\bsong:|\bsong[\!$]|^song\b|( - .*\bSong\b|\bSong\b.* - )|cover[\)\]]|[\(\[]cover|\bconcert\b/i.test(title);
      if (!musicRegexMatch) { musicRegexMatch = musicIdentifiers.test(keywords);
      if (!musicRegexMatch) { musicRegexMatch = /, (lyrics|remix|song|music),|\bfull song\b/i.test(keywords);
      }
      }
      }
  • music exclusions:

    let notMusicRegexMatch = /\bdo[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(title + " " + keywords); // (Tags/keywords shouldnt lie & very few songs titles might have these words)

  • albums / longer than songs durations:

    || (/album|Álbum|专辑|專輯|एलबम|البوم|アルバム|альбом|앨범|mixtape|concert|\b(live|cd|vinyl|lp|ep)\b/i.test(title + " " + keywords)

@Eyevou
Copy link
Author

Eyevou commented Nov 1, 2023

Not quite sure why but this video:

https://www.youtube.com/watch?v=hTSTjzJZBWk (Windows 11 Major Annual Update 2023 - Biggest Changes (23H2))
Tags - windows 11, windows 23h2, windows major update, windows update, windows new features, windows latest features, windows feature update

Is triggering a false positive for the music slowdown on build 4001

@ImprovedTube
Copy link
Member

ImprovedTube commented Nov 1, 2023

works here. might been the issue i mentioned?, that, when you click another video on youtube, then the <meta ..>-data we process might be the same one again as for your the previous video.

also since the YouTube update a few days ago uninstalls multiplied #1809 so we might research this first. (Venryx has experience with the Youtube DOM, so hopefully he will find some time)

@Eyevou
Copy link
Author

Eyevou commented Nov 2, 2023

I put together a short 2min video showing/testing the slow down to normal. I normally have non-music videos playing at 2x. it doesn't appear to be related to session carryover.

https://www.youtube.com/watch?v=UfT8TvznMyg

@ImprovedTube
Copy link
Member

...ups sorry!

we show in the Browser console:

"category: Science & Technology//title: Windows 11 Major Annual Update 2023 - Biggest Changes (23H2)//keywords: windows 11, windows 23h2, windows major update, windows update, windows new features, windows latest features, windows feature update//music word match: true// not music word match:false//duration: PT5M51S//song duration type: common"

it was matching feat. instead of feat\. ( . is wildcard in regex )

(fixed)

@Eyevou
Copy link
Author

Eyevou commented Nov 3, 2023

https://www.youtube.com/watch?v=LlNFuWw0hgA (Now on Stacked: Digimon Tamers Abridged Episode 01!!)
Tags - Digimon, digimon theme song, digimon movie, digimon world next order, digimon fusion, digimon tamers, digimon tamers opening, digimon tamers evolution, digimon tcg, digimon tri, RedbeastVFX, stormsage, coffin jockey, grimmjack, grimmjack demon slayer, guilmon, guilmon dark digivolution, guilmon digivolve, guilmon digivolutions, Renamon, Renamon digivolve, terriermon, terriermon digivolve, terriermon deck, abridged, abridged anime, MENT, Parody, team four star, team four star buu saga

Is being incorrectly attributed to the music speed slowdown (pulled from 4.401 version on github)

@Eyevou
Copy link
Author

Eyevou commented Nov 4, 2023

https://www.youtube.com/watch?v=BNQvbEXcgN8 (The Future of Classic... Classic+ & Cataclysm Confirmed!)
Tags - wotlk classic, season of mastery 2, world of warcraft vanilla, world of warcraft, world of warcraft classic, wow classic, classic+, world of warcraft classic+, som world of warcraft, wow classic pvp, classic wow, wotlk, wrath of the lich king, asmongold reacts, classic cata, classic cataclysm, release date, announcement, trailer, season of discovery, season of discovery changes, sod class changes, sod new featues, sod new raids, sod new dungeons, sod new content

Is being incorrectly attributed to the music speed slowdown, as well. (pulled from 4.401 version on github)

@ImprovedTube
Copy link
Member

", digimon theme song" saw issues with theme song tags coming.
while not an absolute lie, this one has 30 tags, which might be over-ambitious (489 chars in 500 allowed ones).
(Also intentionally risked to misinterpret spammy tags, which might be good to relax before leaving the spam).

  • remedy:

    • more than 8% of tags (~1/12th) should be music, according to our regex, which might not be hard, since the regex is more extensive. 85772a7
    • requiring a tag to by exactly "theme song" (no other chars)
    • alternatively, are there any more words missing in our music exclusions list?

      music exclusions:

      let notMusicRegexMatch = /\bdo[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(title + " " + keywords); // (Tags/keywords shouldnt lie & very few songs titles might have these words)

  • and there is a chance you would anyways decide to use such features (to come):

    • Have a notification "this might be spammy?: ..." if ( keywords > 19 && chars > 479 chars) ?
    • Speed up the whole categories entertainment & gaming (being 37% of Youtube)

  • the second video is another instance of feat. (the fix is not yet in the store versions)
    • as a tester / contributor / git users, one could somehow keep the unpacked installation folder updated/synced
      • we can automatically send the repo to the stores at every edit ("alpha version") with a github action
    • its is also using 26 tags & 467 chars for the keywords. (So maybe still greedy, only decisively modest in the end. Yet only "sacrificing to modesty" space for 1 or 2 more possible keywords)

@Eyevou
Copy link
Author

Eyevou commented Nov 5, 2023

Yeah, at some point we're just gonna have to make a reasonable cutoff point - or scrap the feature all together as edge cases will always creep their way in. An idea I had was to only officially support channels that have the "official artist" badge.

For example: https://www.youtube.com/@justinbieber, whos music isn't caught by the filter. Perhaps with a checkbox inside the player or a checkbox beside the users channel name.

https://www.youtube.com/watch?v=fRh_vgS2dFE (Justin Bieber - Sorry (PURPOSE : The Movement))

at some point it's just gonna be too much.

Another Idea I was toying around with is to be able to whitelist channels for speed. So instead of us doing all the edge cases we let the user decide to speed up or slow down channels on a personal basis.

@ImprovedTube ImprovedTube added Set & forget (automatic feature) All permanent effects should be favorable by design. (Avoiding side-effects >99.8% of the time) Completition / Revision Rethink, complete, improve, tweak our feature or structure. and removed Bug Bug or required update after YouTube changes labels Nov 6, 2023
@ImprovedTube ImprovedTube changed the title Force Playback Speed not always working Content by keywords Nov 6, 2023
@ImprovedTube
Copy link
Member

ImprovedTube commented Nov 6, 2023

hi @Eyevou its a nice puzzle / challenge though and not yet challenging😎. Interested as long as you find any. (Or as long as more than 1 in 10000). While the keywords are individual per category the logical and JS can be similar for more categories / features.

Say we could test it against a natural random sample of millions:
S% of non-music will be slow (false matches) (irrelevant only for bad spam)
M% music wont be noticed.
Hopefully S% now drops back from tooo high (after only adding more music identifiers before, so maybe M% is already below 1 in 1000 and stays there.)

But S% should be much smaller while the purpose is speed & less than a quarter of YouTube might be music.

  • later, one could still make this proportion dynamic/personal, depending the user's proportion ( non-music : music ). If the user has our analyzer enabled
    • i think there also existed a plain list youtube.com/_____ showing one's watch history.. 🤔

@ImprovedTube ImprovedTube changed the title Content by keywords content categorization /filtering by keywords (regex) Nov 6, 2023
@ImprovedTube
Copy link
Member

ImprovedTube commented Nov 6, 2023

at some point it's just gonna be too much.

Another Idea I was toying around with is to be able to whitelist channels for speed. So instead of us doing all the edge cases we let the user decide to speed up or slow down channels on a personal basis.

yes! will be happy to see that Pull-Request. You might like to check the labels added. (A true set & forget feature is better than another button.)

I have this project- & service-perspective. So is already an achievement if we make something better by 1 pixel automatically for everyone. (That's why the structure label also exists #1445)

  • While we could easily enough reach many times more users still, there also will be a hard limit, that might
    be just a few% of the billions of YouTube users, because using our tool requires a little effort (many people might leave a browser extension again already as soon as they notice that there are more than a few buttons..)
    • this matters more, the more software already exists easily available and the less time a single feature might save a user (Hypothetically disciplined, educated/longsighted user could / should install & learn something for 1 Minute (set & forget), if only that will save a minute every other year),

badge

Is the artist badge musicians only?
we can match it by ytd-badge-supported-renderer .badge badge-style-type-verified-artist

<ytd-channel-name id="channel-name" class="style-scope ytd-video-owner-renderer"><!--css-build:shady--><!--css-build:shady--><div id="container" class="style-scope ytd-channel-name">
  <div id="text-container" class="style-scope ytd-channel-name">
    <yt-formatted-string id="text" link-inherit-color="" title="Justin Bieber" class="style-scope ytd-channel-name complex-string" ellipsis-truncate="" ellipsis-truncate-styling="" has-link-only_=""><a class="yt-simple-endpoint style-scope yt-formatted-string" spellcheck="false" href="/channel/UCIwFjwMjI0y7PDBVEO9-bkQ" dir="auto">Justin Bieber</a></yt-formatted-string>
  </div>
  <tp-yt-paper-tooltip fit-to-visible-bounds="" class="style-scope ytd-channel-name" role="tooltip" tabindex="-1" style="inset: -14.5px auto auto 48.2812px;"><!--css-build:shady--><div id="tooltip" class="style-scope tp-yt-paper-tooltip hidden" style-target="tooltip">
  
    Justin Bieber
 
</div>
</tp-yt-paper-tooltip>
</div>
<ytd-badge-supported-renderer class="style-scope ytd-channel-name" system-icons=""><!--css-build:shady--><!--css-build:shady--><div role="status" class="badge badge-style-type-verified-artist style-scope ytd-badge-supported-renderer style-scope ytd-badge-supported-renderer" aria-label="Official Artist Channel"><yt-icon size="16" class="style-scope ytd-badge-supported-renderer"><!--css-build:shady--><!--css-build:shady--><yt-icon-shape class="style-scope yt-icon"><icon-shape class="yt-spec-icon-shape"><div style="width: 100%; height: 100%; fill: currentcolor;"><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24" focusable="false" style="pointer-events: none; display: block; width: 100%; height: 100%;"><path d="M12 4v9.38c-.73-.84-1.8-1.38-3-1.38-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V8h6V4h-7z"></path></svg></div></icon-shape></yt-icon-shape></yt-icon><p class="style-scope ytd-badge-supported-renderer"></p><tp-yt-paper-tooltip position="top" class="style-scope ytd-badge-supported-renderer" role="tooltip" tabindex="-1" style="left: 76.9609px; top: -11px;"><!--css-build:shady--><div id="tooltip" class="style-scope tp-yt-paper-tooltip hidden" style-target="tooltip">
  Official Artist Channel
</div>
</tp-yt-paper-tooltip></div><dom-repeat id="repeat" as="badge" class="style-scope ytd-badge-supported-renderer"><template is="dom-repeat"></template></dom-repeat></ytd-badge-supported-renderer>
</ytd-channel-name>

youtube.com/watch?v=fRh_vgS2dFE (Justin Bieber - Sorry (PURPOSE : The Movement))

More examples? This is matched through category: Music
and alternatively this is considered too: youtube music
(even if it takes a moment to load)

@Eyevou
Copy link
Author

Eyevou commented Nov 10, 2023

Is the artist badge musicians only?

From what I can tell, yes.

https://support.google.com/youtube/answer/7336634?hl=en#zippy=%2Cofficial-artist-channels-policies-and-programs%2Cprogram-criteria-and-eligibility

makes direct reference to Music Videos, songs, and bands under their criteria and eligibility.

This is matched through category: Music

Oops, yeah - you're right. It took a moment but did load correctly.

@Eyevou
Copy link
Author

Eyevou commented Nov 11, 2023

https://www.youtube.com/watch?v=Y9EKzvTo3g0 (CLASSIC - WOW - 𝓓𝓐𝓝𝓒𝓘𝓝)

It had a song appended to its description (youtube identified) but I figure it doesn't have any of the metadata we look for.

@ImprovedTube
Copy link
Member

ImprovedTube commented Nov 11, 2023

thanks! @Eyevou Yes,

however it should be noticed as of:

// Now this video might rarely be music
// - however we can make extra-sure after waiting for the video descripion to load... (#1539)
var tries = 0; var intervalMs = 150; if (location.href.indexOf('/watch?') !== -1) {var maxTries = 10;} else {var maxTries = 1;}
// ...except when it is an embedded player?
var waitForDescription = setInterval(() => {
if ((++tries >= maxTries) || document.querySelector('div#description')) {
if (document.querySelector('h3#title[class*="music-section"]') // indicates buyable/registered music
&& typeof testSongDuration(parseDuration(document.querySelector('meta[itemprop=duration]')?.content)) !== 'undefined' ) // resonable duration
{player.setPlaybackRate(1); video.playbackRate = 1; } clearInterval(waitForDescription); }
intervalMs *= 1.4;
}, intervalMs);
}


  • Commonly when/if YouTube updates we might have to add an alternative CSS selector (without removing the old one, which usually should stay as an alternative)
    • document.querySelector('h3#title[class*="music-section"]')

  • Also, this paragraph wasn't tested much and there could be an untested typo in the most recent edit/s
    • Even who doesn't know or like much JavaScript, can paste such paragraph in an AI which might lead to finding a solution faster.

@ImprovedTube
Copy link
Member

CSS selector

changed indeed. (also used here: let musicSectionLength = document.querySelector('div#items[class*="music-section"]')?.children?.length;)

<ytd-horizontal-card-list-renderer class="style-scope ytd-structured-description-content-renderer" at-start="" at-end="" inline-structured-description="" card-list-style="HORIZONTAL_CARD_LIST_STYLE_TYPE_ENGAGEMENT_PANEL_SECTION" has-subtitle="" has-video-attribute-view-models="" style="--ytd-horizontal-card-list-item-width:415px;"><!--css-build:shady--><!--css-build:shady--><div id="header-container" class="style-scope ytd-horizontal-card-list-renderer">
  <h2 id="header" class="style-scope ytd-horizontal-card-list-renderer"><ytd-rich-list-header-renderer class="style-scope ytd-horizontal-card-list-renderer" modern-typography=""><!--css-build:shady--><!--css_build_scope:ytd-rich-list-header-renderer--><!--css_build_styles:video.youtube.src.web.polymer.shared.ui.styles.yt_base_styles.yt.base.styles.css.js,video.youtube.src.web.polymer.main_desktop.ui.renderers.sections.ytd_rich_list_header_renderer.ytd.rich.list.header.renderer.css.js--><div class="title-row style-scope ytd-rich-list-header-renderer">
  <div id="avatar" class="style-scope ytd-rich-list-header-renderer"></div>
  
    <div id="title-text" class="style-scope ytd-rich-list-header-renderer">
      <yt-formatted-string id="title" class="style-scope ytd-rich-list-header-renderer">Music</yt-formatted-string>
      <yt-formatted-string id="subtitle" class="style-scope ytd-rich-list-header-renderer">1 songs</yt-formatted-string>
    </div>

@ImprovedTube
Copy link
Member

ImprovedTube commented Nov 13, 2023

updated: 40f651d

@Eyevou
Copy link
Author

Eyevou commented Nov 22, 2023

Seems to be a false positive on:

https://www.youtube.com/watch?v=Y1EHRKrPHMQ (Food Substitutes To Try This Thanksgiving | SciShow Compilation)

using: 4.408 (just pulled from repo)

@ImprovedTube
Copy link
Member

hi @Eyevou! 100d1b3 missing parenthesis let the "over-length identifier" words like album & compilation skip the other conditions. (because logical AND's are generally handled with a higher precedence than logical OR's)

Do you know if every link (or autoplay) from one video to the next one, wont update the <meta> info's or is there an exception? (We can call the html source in that case (~800kb) (or another API), for such smart / data features (yet will be precise since 800kb still takes ~ 0.13s at the current average global internet speed and < 0.03s for most of our users - not sure how many people use our low video quality options).

@Eyevou
Copy link
Author

Eyevou commented Dec 6, 2023

I've been thinking about some stuff related to this feature and I think it would be a better overall experience to always assume +speed and check for category, tags, title, ect. after it loads. (Reverse of how it currently works)

With the way I currently use it: I'd rather a video slow down than a video speed up. False-positives seem to be quite rare.

If anyone else has feedback on this it would be much appreciated!

@ImprovedTube
Copy link
Member

hi @Eyevou! not sure i understood. Do you want to match music more agressively? Or not start with speed, while finding out
sometimes might takes a few seconds?

@Eyevou
Copy link
Author

Eyevou commented Dec 7, 2023

Do you want to match music more agressively? Or not start with speed, while finding out
sometimes might takes a few seconds?

Sorry if I didn't explain it very well.

I'm suggesting that all videos start with your custom speed, music checks are run, then if it matches the "is music" criteria to change the value down to 1x. A throttle down for playing music seems preferable to waiting for the checks.

Currently if you have "(Force playback speed even for music?)" as OFF, the extension assumes 1x, waits for load, checks, then sets as defined. If "(Force playback speed even for music?)" is ON the speed problems do not happen.

Is the current functionality unintended/bugged? Is it because of the previous-playback-check/tab bug?


On a personal note: I'm heavily considering jumping back into Javascript to work on this more directly. It's obvious I'm extremely invested in it.

@ImprovedTube
Copy link
Member

ImprovedTube commented Jan 7, 2024

hi! @Eyevou btw, did it work well/better for you these weeks?
(after i published an extra checks to including clicking on related videos)
(there are a few reports saying speed is unreliable.)

A throttle down for playing music seems preferable to waiting for the checks.

ah, right, and you answered on the previous.
i just hoped it also meant we can match more aggressively (if false positives are rare), because that could be relevant/interesting.
maybe you have more example videos?

speed up was happening early after a quick test and rarely set twice revised/slowed down if youtube showed music in the description late.

  • but recently, when clicking related videos the first decision might have been delayed by 0.2 to 3 seconds.
    • and for today i just move it to be set always, so twice if undone for the 20% music or the 4% education: 096dfb1
      - disadvantage: if somebody previously set a specific music or education video to 0.75x then we previously didnt interfere but not set to speed and then set to 1x. So i might revert this edit later and just set speed in advance at the few specific moments.
      • ...added the a requirement that speed isnt set already, if ( video.playbackRate < 1 || video.playbackRate > 1 ) { return; }

On a personal note: I'm heavily considering jumping back into Javascript to work on this more directly. It's obvious I'm extremely invested in it.

yay! i should've read/reacted earlier. Was wondering if i'm just bothering with documenting code.

@Eyevou
Copy link
Author

Eyevou commented Jan 12, 2024

I checked a few days ago but didn't see much improvement, there was also a bug preventing videos from playing - that seems resolved tho. Checked today flipping to slowdown from speed up is working but seems to take slightly longer to get going (6s up from 3s). I spoke with a friend who is quite knowledgeable on regex, ect. and they seem to think that regex is calculating too much too quickly and looping - which might be making the whole process take longer than it actually needs.

Overall, it's a better User Experience. Still some pain points tho.

@Eyevou
Copy link
Author

Eyevou commented Jan 12, 2024

I just had a video auto slow down when unfocused several minutes in - not sure what that was all about "music" list in the description, perhaps?:

https://www.youtube.com/watch?v=OaG4Y9ba7Ps

@ImprovedTube
Copy link
Member

hi @Eyevou!

(6s up from 3s)

can you tell which situations or specific videos changed?
per your wish speedup might be slightly faster to start

I just had a video auto slow down when unfocused several minutes in - not sure what that was all about "music" list in the description, perhaps?

makes sense x). as the page might only fully loads when active might have to adjust.

  • to-do: check for alternative/extra implementation (maybe depending if the tab is active)

@ImprovedTube ImprovedTube changed the title content categorization /filtering by keywords (regex) (content categorization /filtering by keywords (regex), starting with:) permanent speed-up "speed-watching" Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Completition / Revision Rethink, complete, improve, tweak our feature or structure. Filtering & Discovery (of Content) good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) Set & forget (automatic feature) All permanent effects should be favorable by design. (Avoiding side-effects >99.8% of the time) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥
Projects
None yet
Development

No branches or pull requests

3 participants