Greasy Fork is available in English.

Youtube - Auto Like

Auto likes a video near the end, the goal being to keep track of watched videos since youtube history is limited

< Youtube - Auto Likeについてのフィードバック

レート:可 - スクリプトは動作するがバグがある

§
投稿日: 2023/11/29

It doesn't work anymore since 2 weeks :(

my pecs: chrome version 120.0.6099.35 and violentmonkey

Dry Spoon作者
§
投稿日: 2023/12/01

I fixed an issue 2 weeks ago with version 0.8. I changed the selector for the video `document.querySelector('video.video-stream')`.

§
投稿日: 2023/12/01

I fixed an issue 2 weeks ago with version 0.8. I changed the selector for the video `document.querySelector('video.video-stream')`.

If you want you can tell me how can i fix it by myself by changing a certain voice in the script

Dry Spoon作者
§
投稿日: 2023/12/01

Are you using version 0.8 of the script `// @version 0.8`? Maybe it didn't auto update and you need to manually reinstall the script.

It works for me on Chrome. The like is triggered after watching 90% of the video `if(video.currentTime/video.duration > 0.9)`. Otherwise, I am not sure what could be the issue.

The script works by finding the video `let video = document.querySelector('video.video-stream')` and adding a listener `video.addEventListener('timeupdate'`. To find the like button, I use `document.querySelector('#segmented-like-button button')`. Maybe there is an issue with one of these query selectors.

§
投稿日: 2023/12/01

Are you using version 0.8 of the script `// @version 0.8`? Maybe it didn't auto update and you need to manually reinstall the script.

It works for me on Chrome. The like is triggered after watching 90% of the video `if(video.currentTime/video.duration > 0.9)`. Otherwise, I am not sure what could be the issue.

The script works by finding the video `let video = document.querySelector('video.video-stream')` and adding a listener `video.addEventListener('timeupdate'`. To find the like button, I use `document.querySelector('#segmented-like-button button')`. Maybe there is an issue with one of these query selectors.

Yeah i updated it manually to the latest one but it doesn't work 😭

Dry Spoon作者
§
投稿日: 2023/12/02

Oh that's weird. To confirm, do you wait until the end of the video for the like to trigger?

I just tested it on Firefox and it also works. I am using Tampermonkey but that shouldn't make a difference.

Do the query selectors (for video and like button) highlight the corresponding elements when typed in the console (see image)?

Dry Spoon作者
§
投稿日: 2023/12/02

Does version 0.7 work? The findVideo is slighly more inefficient because it finds more than one video element.

function findVideo(onVideoFound){
let videos = [] // for some reason there is more than 1 video found
const observer = new MutationObserver((mutations, observer) => {
// Keep trying to find video
let video = document.querySelector('video')
if(video){
let alreadyFound = videos.includes(video)
if(!alreadyFound){
videos.push(video)

l('videos found:', videos)
onVideoFound(video)
}
}
})
observer.observe(document, {childList:true, subtree:true})
}

§
投稿日: 2023/12/02

Does version 0.7 work? The findVideo is slighly more inefficient because it finds more than one video element.

function findVideo(onVideoFound){
let videos = [] // for some reason there is more than 1 video found
const observer = new MutationObserver((mutations, observer) => {
// Keep trying to find video
let video = document.querySelector('video')
if(video){
let alreadyFound = videos.includes(video)
if(!alreadyFound){
videos.push(video)

l('videos found:', videos)
onVideoFound(video)
}
}
})
observer.observe(document, {childList:true, subtree:true})
}

I just tried to install the 0.6 and it works 🤔😂 with the 0.7 doesn't work neither🤷🏻

Dry Spoon作者
§
投稿日: 2023/12/02

Oh that's really strange. 0.7 should work if 0.6 works (the findVideo method is more general). Maybe Youtube is testing different layouts and we aren't receiving the same page.

§
投稿日: 2024/06/26

Oh that's really strange. 0.7 should work if 0.6 works (the findVideo method is more general). Maybe Youtube is testing different layouts and we aren't receiving the same page.

Since 1 week it started to work randomly :( 3 times out of 10 it doesn't work anymore idk why.

返信を投稿

返信を投稿するにはログインしてください。