YT video tab by default

Open "Video" tab of youtube channel by default

< Σχολιασμός για τον κώδικα YT video tab by default

Αναφορά: Καλός - ο κώδικας λειτουργεί

§
Δημοσιεύτηκε: 30/10/2022
Επεξεργάστηκε: 30/10/2022

Thank you very much for this awesome script.

I've been using it since first version and I can see you've managed to fix the few little bugs the script had.

The only thing that's still not perfect (at least for me), is the "After switching the tab channel preview video kept playing" thing.
IT IS SOLVED if you open the channel page in the same tab. But if you middle click a channel name (to open it in a different new tab), even though the redirection works fine, the preview video (from the channel main page) most of the times keeps playing.

Sorry for my english which may be not perfect, but still hope you can understand the issue I'm trying to explain.

Thanks again for your time and work.

max44Δημιουργός
§
Δημοσιεύτηκε: 30/10/2022

There is a problem: maybe because Youtube changes its interface to a new design, I do not see preview videos at all since yesterday - they are just absent on any channel. So I cannot amend the script's behaviour. We can only wait until preview videos become available for me.

§
Δημοσιεύτηκε: 30/10/2022

Thank you for your quick reply.
I provide you a few examples: All of this movie channels have autoplayed videos in their main page. They're not only "preview" videos, but full movies in some cases:

https://www.youtube.com/c/MEOMERomanceMovies

https://www.youtube.com/c/THREfrenValdivia

https://www.youtube.com/c/RomComsOfficial

https://www.youtube.com/c/MOVIECLIPS

https://www.youtube.com/c/CultCinemaClassics

I received the new Youtube design on video watch pages, but not on channels pages. I don't know if you're seeing another design. Don't you get any autoplayed video on that channels pages? If you don't, it seems that we're seeing different interfaces for the same channel page.

Anyway the script is awesome, thanks again for that.

max44Δημιουργός
§
Δημοσιεύτηκε: 31/10/2022

Aha, what I've found: I can see preview video on a new channel only. As soon as I add it to subscription to make experiments, preview is gone (I do not know what for). So, now I won't subscribe.

What I see is that if you watch any video from this channel and click the channel's name under the video, the channel is opened and sometimes my script works normally (preview is paused and tab switches to "video"), but sometimes preview goes and tab does not switch to "video". Is it the problem you told about?

§
Δημοσιεύτηκε: 31/10/2022
Επεξεργάστηκε: 31/10/2022

In my case, the script redirection (switch from main channel page to "video" section) ALWAYS WORK.

What doesn't always work is the abortion or pause of the video that autoplays on channels main page.

Since the script sometimes take a little while in switching to video page, in the meantime the video (on channel main page) autoplays and kept playing, even after the redirection. That was so, in first versions of the script.

For version 1.1.2, the changelog states: "Fixed: after switching the tab channel preview video kept playing." That is something you fixed, starting from that version. But that fix only works if you remain on the same tab. But if you are watching a video and from there you open the channel page IN A NEW TAB, in that new tab the problem persists: The redirection works but the preview video doesn't pause, keeps playing, even when you already left that channel main page.

That is what what I was trying to explain in previous message.

Thanks again for the script.

max44Δημιουργός
§
Δημοσιεύτηκε: 31/10/2022

I see. I'll try to fix it

§
Δημοσιεύτηκε: 31/10/2022
Επεξεργάστηκε: 31/10/2022

Additionally, I can confirm that in my case too, the fact of being suscribed to the channel avoids the autoplay of a preview video. In fact, there is no "preview video" at all. And as far as I can see by now, that applies to ANY channel. Youtube only shows that annoying autoplayed video if it is a channel you're not suscribed to. I've never realized that before. So, thank you for that too. We've both found out something new.

max44Δημιουργός
§
Δημοσιεύτηκε: 31/10/2022

Sometimes we find out too much of something new :)

I've changed the logic of my script. Please try the new version. I hope it deals better with the described situation.

§
Δημοσιεύτηκε: 01/11/2022

I did the update and I cannot see any visible changes. For me the script works exactly the same as in latest previous version.

The redirection works fine on every scenario. The only flaw is still the same: when you open a channel IN A NEW TAB, the preview video keeps playing even after the switch to "videos" section is made. On the contrary, if you open the channel page on the same tab, the script manages to pause or abort the preview video and then switch to Videos section (that's the desired behaviour).

For some reason, opening a new tab causes that the script cannot pause or abort the preview video.

max44Δημιουργός
§
Δημοσιεύτηκε: 01/11/2022

Hm... What I did in the new version: now script waits until container with preview video is loaded, pauses the video and then switches tab. I made many experiments and for me it works well, even if opening a new tab.

Could you please make a screencapture video with your actions and script's behaviour? Browser's url box should be visible too. Maybe I miss something important.

§
Δημοσιεύτηκε: 03/11/2022
Επεξεργάστηκε: 03/11/2022

I made the video for you. It's kind of bad quality, but was the best I could do and I think may be enough for you to see the issue.

3 things to consider that may be relevant:

1) I use the Youtube interface in spanish, cos it's my native language. I don't know if it matters, but sometimes scripts select things by name and in those cases the change of interface language may be relevant. I dont think that's the case here, but just in case I mention it.

2) I use a somewhat outdated version of Google Chrome browser (with latest Tampermonkey addon). In most cases the browser works perfect, but now and then I have found some particulars in which it behaves a little different than latest version. That its the most likely here, I guess.

3) Even when the main channel page (in the video example) is https://www.youtube.com/c/Adyfilk, and the script redirects it to https://www.youtube.com/c/Adyfilk/videos, when I switch back to channel main page, the URL is https://www.youtube.com/c/Adyfilk/featured. All of that you can see in the video. That URL change is kind of strange, because if the script is off and I access the channel main page it remains only https://www.youtube.com/c/Adyfilk, but if I change to "Videos" tab (manually or via the script) and then back to main page, the URL become https://www.youtube.com/c/Adyfilk/featured. I don't know if that occurs in your browser, and don't know if could be the cause of the malfunction.

Anyway, thank you very much for the script and here's the link to the video.

https://drive.google.com/file/d/12HU2cWpoPqV7bjGAaEN1inmgcY0k-89m/view?usp=sharing

max44Δημιουργός
§
Δημοσιεύτηκε: 03/11/2022

I changed Youtube language to Spanish, took Chrome and repeat all the steps from your video. Everything works fine for me. Tell me please your version of Chrome, I'll try it too.

I don't know if that occurs in your browser, and don't know if could be the cause of the malfunction.

This is normal or Youtube. When you open a channel, the first page is without any extension like "/videos" or "/featured". But if you manually click "Home" tab, you are redirected to "/featured" page which is the same as the default channel page.

§
Δημοσιεύτηκε: 03/11/2022

Ok, so that confirms the most likely scenario I told you before. The cause of the problem is my outdated Chrome browser. I guess the version is 80, it's been a couple of years without updating it. So don't worry, it's not your fault at all and if you checked that the scripts works fine in latest browser version, that should be enough for you and most other uses.

In my case I chose to keep my old browser version, because with every update Chrome used to get more and more heavy and resources consuming, and I also have some very old addons and scripts that are abandoned and don't work on latest versions, but still work fine in my old version. This should be the opposite case, so it's my fault and I'll have to deal with that. I'll try to block that annoying preview video via Adblock Plus, with personalized filter that I write choosing selectors from the Console. That's something I often do with success, on Youtube and many more other pages.

Thanks again for your time and patience.

max44Δημιουργός
§
Δημοσιεύτηκε: 03/11/2022

You should try addon Enhancer for Youtube: https://chrome.google.com/webstore/detail/enhancer-for-youtube/ponfpcnoihfmfllpaingbgckeeldkhle
It has an option to block autoplay, so maybe it can help your old Chrome to deal with this issue.

§
Δημοσιεύτηκε: 04/11/2022

I have found a solution. But I still need some help. I would really appreciate it if you could help me. If not, I would understand it anyway and there would be no problem.

Searching in Greasy Fork, I found this script, it's very short, less than 20 lines of code and the ONLY THING IT DOES IS PAUSE THE PREVIEW VIDEO ON CHANNEL MAIN PAGES. It's an old script, not updated since 2019 and works perfect in my old browser. In all cases (both in the same tab and in a new tab).

https://greasyfork.org/en/scripts/32952-youtube-channels-disable-featured-video-autoplay

The problem is that when both scripts are enabled, yours redirects the page quickly to the Videos tab, BEFORE the other script gets to pause the video. And therefore the video is still playing.

I need to do one of two things: either replace some lines of your script with those of the other one (so that the browser takes the video pause correctly), or set a much longer interval before your script takes effect (two seconds or so).

If you could tell me how to do that (or anything else you can think of), I might be able to fix the issue.

Thanks again for your time and patience.

max44Δημιουργός
§
Δημοσιεύτηκε: 04/11/2022

This script performs more subtly. I integrated it into my script. Not fully, because they have different approach to web page, but I hope it should work for your browser too. Please try the new version and give a feedback to me.

§
Δημοσιεύτηκε: 04/11/2022
Επεξεργάστηκε: 04/11/2022

Hello my friend Max, I did the update and I have some good news and some bad news.

The good one is that now the video pause is done correctly, both in the same tab and in a new one.

But there are two bad things:
1) The redirection to the video tab, IS ONLY WORKING IF THERE IS a preview video on the main channel page. That means that for all the channels you are subscribed to (that don't show preview) and for all the other channels that don't have preview (there are many that don't), the redirection is now not working at all. In the previous version it did.

2) The other issue is not so important, but notice that when the other script pauses the video, it continues paused even when you manually switch to videos page and then return to the main (featured) page. The way your script does it, even when the video is paused, the autoplay is activated again if you return to the main page. This was already the case in previous versions, but I noticed it now.

max44Δημιουργός
§
Δημοσιεύτηκε: 04/11/2022

OMG, I was so concentrated on dealing with non-subscribed channels that forgot to test the new version on subscribed ones :)
It is fixed.

Thank you, your suggestions makes my script to be more universal.

when the other script pauses the video

Give a link to this script, I will look at the way it uses to pause the video. Maybe I'll do that my script won't pause already paused videos.

§
Δημοσιεύτηκε: 04/11/2022

https://greasyfork.org/en/scripts/32952-youtube-channels-disable-featured-video-autoplay

That's the other script, it's the one I told you about in the previous message earlier today.

Now I understand what it's happening: Your script pauses the video and redirects to Videos tab. But when the users switch back manually to channel home page, the script hits "pause" again on an already paused video, so it resumes to play. That would be the situation if I understood correctly. Take a look at the code in the other script because it doesn't cause the video to resume when you switch back to channel main page.

Now I'm gonna try the new version and get back to you later.

Thank you very much.

§
Δημοσιεύτηκε: 04/11/2022
Επεξεργάστηκε: 04/11/2022

Unfortunately, this 1.1.7 version for me is equal to 1.1.5: The redirection always work, but preview video doesn't pause if the channel page is opened in a new tab. (It does pause if opened in the same tab).

That you had it fixed in Version 1.1.6 earlier, when you integrated parts of the other script. But somehow now that reverted to 1.1.5 behavior. At least for me.

I wouldn't mind keeping both scripts installed, one for the pause preview video thing, and the other for the redirection. But in that case I would need only the part of your script that does the redirection, to prevent that both scripts hit the pause button. And that redirection needs to be after a couple of seconds, so the other script gets to pause the video first.

max44Δημιουργός
§
Δημοσιεύτηκε: 04/11/2022

One more try - version 1.1.8

§
Δημοσιεύτηκε: 04/11/2022

It's the same, Max. The redirection always work, but preview video doesn't pause if the channel page is opened in a new tab. (It does pause if opened in the same tab).

In version 1.1.6 you had managed to pause the preview video for me, even in new tab. But something else was wrong in that version, because the redirection didn't work on suscribed channels and those that doesn't have preview. Remember? What I don't understand is why when you fixed this in 1.1.7, it reverted the behavior of the script to not pausing the video when opened in a new tab (for me).

I hope we can work it out, I wish I could help more, but I doubt I can. Remember that the other script (not updated since 2019, i.e. older than my browser), works perfectly for me pausing the video on both: same and new tab. And even remain paused after you switch back and forward between main page and Videos page.

I guess the best solution for my case would be to keep that script, and after an interval, have your script intervene just to do the redirect. If that's possible.

max44Δημιουργός
§
Δημοσιεύτηκε: 05/11/2022

I've found a repository with old versions of Chrome in order not to bother you with new and new versions, but to test them by myself.

§
Δημοσιεύτηκε: 05/11/2022

Wait, wait. Don't waste anymore time trying Old Chromes, because I already found the solution. Just give me 10 minutes and I'll explain myself.

§
Δημοσιεύτηκε: 05/11/2022

Max, you're a genius and I cannot thank you enough for your willingness to help.

Let me explain what I did today. Remember I was yesterday talking about setting a longer interval before your script does the redirection (two seconds or so). In order to let the other script pause the preview video first.

Well, today I tried that. I only modified line 63 of your script, instead of 100, I put 2000 (I assume there must be miliseconds).

By doing that, your script takes a little longer before doing the redirection and the preview video pauses correctly.

But my surprise came when I noticed that the other script is no longer needed for me. That is to say, YOUR SCRIPT by itself is pausing correctly the preview video (even in new tab), BEFORE redirecting. So, that's the desired and expected behavior.

It was all about the interval needed to let the script pause the video first, AND THEN perform the redirection.

So, don't investigate Old browsers any more, lol. That's no longer needed, and I guess even the old browser has never been the problem, it's all about "time".

I imagine that PCs with different speeds (or internet connections, etc.) need a little more time of delay before the redirection is made. So, the only change that I suggest (if you wanna do it) is to increase that interval on line 63. And that's it. Works perfect, both in the same and new tab, and even in old browsers, ha ha.

The only thing you could improve in the future is that the script doesn't press pause again when the user returns manually to the main page (because preview video is already paused and so by pressing pause it starts again). But that's not a big problem because nobody's planning to return to main page, ha ha.

So thank you very much again and I hope my bad English could be understood in this message because I wrote it very fast with no translator assistance.

§
Δημοσιεύτηκε: 05/11/2022

I'm guessing right now but I think that the only reason why pausing the preview video worked on the same tab but not on a new one was that in latter case, the page takes a little longer in showing all elements (among them the preview video). So the redirection is made when the preview hasn't appeared yet. But finally (when you are already seeing the videos page) the preview video finishes loading in the background... and starts playing.

As I said, it was all about the time of the intervals needed betwenn one action and the other.

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.