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

"Force video to play from the beginning" doesnt show up in search with "Force" #1886

Closed
ShalokShalom opened this issue Dec 14, 2023 · 2 comments
Assignees
Labels
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! ♥

Comments

@ShalokShalom
Copy link

Type in "Force" in the search bar.
See, that the option called "Force video to play from the beginning" does not appear.
Type in "Video" and scroll down, to see that its working this way.

Screenshot_20231215_003805
Screenshot_20231215_003817

@ShalokShalom ShalokShalom 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 Dec 14, 2023
@ImprovedTube
Copy link
Member

ImprovedTube commented Dec 15, 2023

thanks! search matters! - Our search also stops matching after one word, if you type a space, etc. #1171 (#339)

( Our search also is minimal just yet: #1171, #748

youtube/js&css/satus.js

Lines 3130 to 3180 in d59edf9

# SEARCH
--------------------------------------------------------------*/
satus.search = function(query, object, callback) {
var elements = ['switch', 'select', 'slider', 'shortcut', 'radio', 'color-picker'],
threads = 0,
results = {},
excluded = [
'baseProvider',
'layersProvider',
'parentObject',
'parentSkeleton',
'namespaceURI'
];
query = query.toLowerCase();
function parse(items, parent) {
threads++;
for (var key in items) {
if (excluded.indexOf(key) === -1) {
var item = items[key];
if (item.component) {
//console.log(key, item.component);
if (elements.indexOf(item.component) !== -1 && key.indexOf(query) !== -1) {
results[key] = Object.assign({}, item);
}
}
if (
satus.isObject(item) &&
!satus.isArray(item) &&
!satus.isElement(item) &&
!satus.isFunction(item)
) {
parse(item, items);
}
}
}
threads--;
if (threads === 0) {
callback(results);
}
}
parse(object);

)

just 1kb yet! Didn't write it, so no efficiency bonus over who else might possibly be willing to have a look 😳 ( - sending greetings and smiles to people who have amazed / surprised recently: @MAZ01001 @Lauviah0622 @Huhni @chasevis @PG-257811 @asifurrahaman754 @yashi-15 @JustEmo @jarrodsmeyers @jscongdon @HanzCEO not a complete list! )

More: search in:title is:open
More exciting: #1565

@raszpl
Copy link
Contributor

raszpl commented Mar 4, 2024

Our search also stops matching after one word, if you type a space

spaces do work

just 1kb

and not good code :(

  • unreadable
  • searches by brute force over raw JS objects, even irrelevant elements :(
  • recursive, personally not a fan :)

I just modified it to search over less useless stuff (1758 items vs 2204), and only compare against Locale translated labels. Result of search for letter "a", left column old, right column new:

layout                          | layout = Layout
layerAnimationScale             | layerAnimationScale = Layer animation scale
                                | youtubeLanguage = YouTube language
use24HourFormat                 | use24HourFormat = Use 24-hour format
                                | activate = Activate
defaultContentCountry           | defaultContentCountry = Country (virtual travel)
ads                             | ads = Ads
removeRelatedSearchResults      | removeRelatedSearchResults = Remove related search results
openNewTab                      | openNewTab = Open in a new tab
removeShortsReelSearchResults   | removeShortsReelSearchResults = Remove Shorts reel from search
hideHomePageShorts              | hideHomePageShorts = Hide Shorts on the home page
                                | atSubscriptions = at 'Subscriptions'
                                | atTrending = at 'Trending'
                                | atHistory = at 'History'
collapseOfSubscriptionSections  | collapseOfSubscriptionSections = Fold subscriptions' sections
youtubeHomePage                 | youtubeHomePage = YouTube home page
Hide_Pause_Overlay              | Hide_Pause_Overlay = Hide Pause Overlay
embedded_Hide_Share             | embedded_Hide_Share = Embedded Hide Share
hideAnimatedThumbnails          | hideAnimatedThumbnails = Hide animated thumbnails
disableThumbnailPlayback        | disableThumbnailPlayback = Disable video playback on hover
                                | popupWindowButtons = Add a popup-player-button to each thumbnail
hideThumbnailOverlay            | hideThumbnailOverlay = Hide buttons on thumbnails
thumbnailsQuality               | thumbnailsQuality = Thumbnails Quality
markWatchedVideos               | markWatchedVideos = Mark watched videos
trackWatchedVideos              | trackWatchedVideos = Track watched videos
confirmationBeforeClosing       | confirmationBeforeClosing = Confirmation before closing
scrollBar                       | scrollBar = Scroll Bar
addScrollToTop                  | addScrollToTop = Add «Scroll to top»
autopauseWhenSwitchingTabs      | autopauseWhenSwitchingTabs = Auto-pause while I'm not in the tab
onlyOnePlayerInstancePlaying    | onlyOnePlayerInstancePlaying = Pause while I watch a 2nd video
Auto_PiP_picture_in_picture     | Auto_PiP_picture_in_picture = Auto-PiP (picture in picture)
forcedVolume                    |
volume                          |
loudnessNormalization           | loudnessNormalization = Loudness normalization
forcedPlaybackSpeed             | forcedPlaybackSpeed = Speed-watching: Permanent speed
forcedPlaybackSpeedMusic        | forcedPlaybackSpeedMusic = (Force playback speed even for music?)
player_dont_speed_education     | player_dont_speed_education = Don't speed up the (rare) category:
playbackSpeed                   | playbackSpeed = Playback speed
autoplay                        | autoplay = Autoplay
upNextAutoplay                  | upNextAutoplay = Up next autoplay
forcedPlayVideoFromTheBeginning | forcedPlayVideoFromTheBeginning = Force video to play from the
autoFullscreen                  | autoFullscreen = Auto-fullscreen
subtitles                       |
language                        | language = Language
Allow_auto_generate             | Allow_auto_generate = Allow auto generate
fontFamily                      | fontFamily = Font family
backgroundColor                 | backgroundColor = Background color
backgroundOpacity               | backgroundOpacity = Background opacity
windowOpacity                   | windowOpacity = Window opacity
characterEdgeStyle              | characterEdgeStyle = Character edge style
fontOpacity                     | fontOpacity = Font opacity
cropChapterTitles               | cropChapterTitles = Crop chapter titles
customMiniPlayer                | customMiniPlayer = Custom Mini-Player
quality                         | quality = Quality
blockAv1                        | blockAv1 = Block AV1
allow60fps                      | allow60fps = Allow 60fps
                                | forceSDR = Avoid HDR, keep SDR
popupPlayer                     | popupPlayer = Popup player
repeat                          | repeat = Repeat
alwaysActive                    | alwaysActive = Always active
Screenshot                      | Subtitle_Capture_including_the_current_words = Subtitle (Capture
saveAs                          | saveAs = Save as
player_fit_to_win_button        |
rotate                          | rotate = Rotate
Hamburger_Menu                  | Hamburger_Menu = Hamburger Menu
screenshot                      |
pictureInPicture                |
loop                            |
position                        |
improveLogo                     |
hideRightButtons                |
Transparent                     | Transparent = 
hideCountryCode                 |
hideVoiceSearchButton           | hideVoiceSearchButton = Hide voice search button
forcedTheaterMode               | forcedTheaterMode = Forced theater mode
playerSize                      | playerSize = Player size
hidePlayerControlsBar           | hidePlayerControlsBar = Hide player controls bar
playPause                       | playPause = Play / Pause
previousVideo                   |
nextVideo                       |
volume                          |
autoplay                        | autoplay = Autoplay
settings                        |
subtitles                       |
nativeMiniPlayer                | nativeMiniPlayer = Native mini player
viewMode                        |
screen                          |
remote                          | remote = Play on TV
hideGradientBottom              | hideGradientBottom = Hide shadow around player-bar
hideSkipOverlay                 | hideSkipOverlay = Hide 5 second skip animation
showRemainingDuration           | showRemainingDuration = Show video remaining duration
durationWithSpeed               | durationWithSpeed = Show time remaining with reference to
alwaysShowProgressBar           | alwaysShowProgressBar = Always show progress bar
playerColor                     | playerColor = Progress bar color
transparentBackground           | transparentBackground = Transparent background
hideAnnotations                 | hideAnnotations = Hide annotations
hideCards                       | hideCards = Hide cards
showCardsOnMouseHover           | showCardsOnMouseHover = Show cards on mouse hover
hideEndscreen                   |
hdThumbnail                     | hdThumbnail = HD thumbnail
hideScrollForDetails            | hideScrollForDetails = Hide «Scroll for details»
screenshot                      |
pictureInPicture                |
loop                            |
youTubeButtons                  |
'share'                         | 'share' = 
Download                        | Download = 
thanks                          | thanks = Thanks
save                            | save = Save
hideDetails                     | hideDetails = Hide details
displayDayOfTheWeak             | displayDayOfTheWeak = Display day of the week
hideDate                        | hideDate = Hide date
howLongAgoTheVideoWasUploaded   | howLongAgoTheVideoWasUploaded = Show video's age (how long ago it
showChannelVideosCount          | showChannelVideosCount = Show channel videos count
sidebar                         | sidebar = Sidebar
with_scrollbars                 | with_scrollbars = with scrollbars?
Sidebar_simple_alternative      | Sidebar_simple_alternative = Sidebar (simple alternative)
                                | columns = Extra sidebar column (without moving the related
squaredUserImages               | squaredUserImages = Squared user images
hide_author_avatars             | hide_author_avatars = Hide author avatars
relatedVideos                   | relatedVideos = Related videos
moveSidebarLeft                 |
moveThumbnailsRight             | moveThumbnailsRight = Thumbnails to the right!
hideThumbnails                  | hideThumbnails = Hide thumbnails
Transcript                      | Transcript = Transcript
compact_Spacing                 | compact_Spacing = 
To_the_side_No_page_margin      | To_the_side_No_page_margin = To the side! (No page margin)
chapters                        | chapters = Chapters
liveChat                        | liveChat = Live chat
hidePlaylist                    | hidePlaylist = Hide playlist
Hide_sidebar                    | Hide_sidebar = Hide sidebar 
auto                            | auto = Auto
increaseVolume                  | increaseVolume = Increase volume
decreaseVolume                  | decreaseVolume = Decrease volume
step                            |
increasePlaybackSpeed           | increasePlaybackSpeed = Increase playback speed
decreasePlaybackSpeed           | decreasePlaybackSpeed = Decrease playback speed
reset                           |
playPause                       | playPause = Play / Pause
seekBackward10Seconds           | seekBackward10Seconds = Seek backward 10 seconds
seekForward10Seconds            | seekForward10Seconds = Seek forward 10 seconds
seekNextChapter                 | seekNextChapter = Seek Next Chapter
seekPreviousChapter             | seekPreviousChapter = Seek Previous Chapter
activateFullscreen              | activateFullscreen = Activate fullscreen
activateCaptions                | activateCaptions = Activate captions
toggleCards                     | toggleCards = Toggle cards
popupPlayer                     | popupPlayer = Popup player
statsForNerds                   | statsForNerds = Show Stats for Nerds
autoPictureInPicture            | autoPictureInPicture = Auto Picture-In-Picture
                                | toggleControls = Toggle player controls
toggleAutoplay                  | toggleAutoplay = Toggle autoplay
customMiniPlayer                | customMiniPlayer = Custom Mini-Player
goToSearchBox                   | goToSearchBox = Go to search box
shortcut_chapters               | shortcut_chapters = Show chapters Sidebar
transcript                      | transcript = 
darkTheme                       | darkTheme = Dark theme
defaultChannelTab               | defaultChannelTab = Default channel tab
trailerAutoplay                 | trailerAutoplay = Trailer autoplay
playAllButton                   | playAllButton = \Play all\button
hideFeaturedContent             | hideFeaturedContent = Hide featured content
compactTheme                    | compactTheme = Compact Theme
autoplay                        | autoplay = Autoplay
upNextAutoplay                  | upNextAutoplay = Up next autoplay
reverse                         |
repeat                          | repeat = Repeat
shuffle                         |
popupPlayer                     | popupPlayer = Popup player
null,                           |
primaryColor                    | primaryColor = Primary color
null,                           |
null,                           |
null,                           |
null,                           |
null,                           |
null,                           |
null,                           |
null,                           |
activate                        | activate = Activate
activate                        | activate = Activate

old one:

  • throws in stuff like forcedVolume because its caller player_forced_Volume, or pictureInPicture becaue its called below_player_pip, useless.
  • pushes a ton of null results as successful searches triggering on "Radio" buttons with no labels

@raszpl raszpl self-assigned this Mar 4, 2024
@raszpl raszpl moved this to In Progress in Priority A Mar 4, 2024
@raszpl raszpl closed this as completed May 17, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Priority A May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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! ♥
Projects
Status: Done
Development

No branches or pull requests

3 participants