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

Disable Autoplay #82

Closed
Tone866 opened this issue Oct 19, 2023 · 52 comments
Closed

Disable Autoplay #82

Tone866 opened this issue Oct 19, 2023 · 52 comments

Comments

@Tone866
Copy link

Tone866 commented Oct 19, 2023

Since I connected my TV with iSponsorBlockTV, autoplay on youtube is enabled.

I checked the settings in my youtube app and there autoplay is disabled.
So it must come from iSponsorBlockTV.

It would be nice to control autoplay over the settings file.

@dmunozv04
Copy link
Owner

That's something I didn't consider, but it seems like it can be detected to maintain autoplay settings when using iSponsorBlockTV

@tgkenney
Copy link

I've got the opposite problem here, I do have autoplay enabled in youtube settings, but since setting this up videos aren't autoplaying anymore. It would definitely be nice for iSponsorBlockTV to not mess with that setting and just leave it be

@dmunozv04
Copy link
Owner

@tgkenney iSponsorBlockTV doesn’t touch those settings but somehow they get modified

@tgkenney
Copy link

Yeah just seems like something weird is going on. For what it's worth, I didn't get this behavior using V1, it only started when I migrated to V2. Though that probably comes down to the different connection method

@dmunozv04
Copy link
Owner

@tgkenney v1 didn’t interact with YouTube, to the point that it could be any other app. V2 uses a YouTube specific feature that has some quirks. Autoplay seems to be one of them. Please test the new version to see if that works

@tgkenney
Copy link

tgkenney commented Oct 20, 2023

I just did some quick testing, using v2.0.2 of the docker image.

  • When autoplay is enabled in YouTube and the container is running: After the video ends it immediately drops back to the main page (unexpected)
  • When autoplay is disabled in Youtube and the container is running: The video ends and it recommends a different video but doesn't autoplay (as expected)
  • When autoplay is enabled in YouTube and the container is stopped: The video ends and starts a countdown to play the next video (as expected)

Edit to add: This is all on a Apple TV 4k

@dmunozv04
Copy link
Owner

@tgkenney that’s super odd. I’ve been using it for a few months on an Apple TV 4K with autoplay on and it’s always moved to the next video (albeit with the 5 second countdown)

@tgkenney
Copy link

I'm using version 3.01.12 of the YouTube app, and TvOS 17. I wonder if it something with those versions?

@Tone866
Copy link
Author

Tone866 commented Oct 20, 2023

  • When autoplay is disabled in Youtube and the container is running: The video ends and it recommends a different video but doesn't autoplay (as expected)

It doesn't work like that for me.
I'm also using the 2.0.2 docker image. The only difference is that my client is a LG TV with webos 4.

@CDeLeon94
Copy link

The youtube app on iphone has an autoplay setting "Mobile phone/tablet"

My TV keeps autoplaying, and that setting was previously enabled. (Disabling it made no difference)
I wonder if the state of that switch plays a factor somehow when setting up iSponsorBlockTV

@dmunozv04
Copy link
Owner

It shouldn’t make a difference. Somehow, I’m able to use the autoplay toggle on the YouTube app (with the v2.0.4 version) and it seems to just work; toggling autoplay correctly

@etienn01
Copy link

On CCwGTV, can't get rid of autoplay as well, whatever the autoplay setting in the Android TV app or the mobile app.
I tried v2.0.2 and the develop tags of the Docker image (which should include this commit 50b71d9) and it made no difference.

@dmunozv04
Copy link
Owner

The “fix” I attempted on the develop tag seems to not work for me.
Additionally, I’ve tried setting autoplay to off on a Tizen TV and it’s not working for me even without iSponsorBlockTV. This is just very confusing since it looks like different devices handle this differently

@simphide
Copy link

I can report the same problem on my AppleTV. Videos are now beeing autoplayed eventhough the settings are turned off...

@berstend
Copy link

Can confirm this issue with a Shield TV - in the YT app autoplay was turned off and once iSponsorBlockTV became active in the network (working great for skipping segments) videos are now autoplaying (with the setting still being off).

@AN1MATEK
Copy link
Contributor

AN1MATEK commented Dec 7, 2023

I also have the same issues with an ATV 4K 2022.

@dmunozv04
Copy link
Owner

If you're still experiencing issues with autoplay follow these steps:

  1. Update iSponsorBlockTV to the latest version (should be 2.0.4)
  2. Reset your YouTube app: open the YouTube app on your device/TV, go to settings, go down to reset app, and select that option. WARNING: you'll need to log in again to your YouTube account
  3. Add the device again to iSponsorBlockTV, since resetting the app also resets the screen id

Please let me know if autoplay is still broken after following ALL the steps

@Tone866
Copy link
Author

Tone866 commented Dec 29, 2023

If you're still experiencing issues with autoplay follow these steps:

  1. Update iSponsorBlockTV to the latest version (should be 2.0.4)
  2. Reset your YouTube app: open the YouTube app on your device/TV, go to settings, go down to reset app, and select that option. WARNING: you'll need to log in again to your YouTube account
  3. Add the device again to iSponsorBlockTV, since resetting the app also resets the screen id

Please let me know if autoplay is still broken after following ALL the steps

I followed your guide and autoplay is still enabled on my tv.

@bdougherty
Copy link

Same here. I even tried enabling autoplay and then disabling it again in the settings and that did not fix either. I'm on an Apple TV.

@sejmann
Copy link

sejmann commented Dec 31, 2023

tldr: same here; still causing forced autoplay
Long version: Using 2.0.4 on the latest Apple TV 4K (w/ A15) and the latest public beta (17.3) version of TVOS and the latest youtube apple TV (4.22.01/web_20231213_10_RC002) app, as soon as the "mobile" iSponsorBlockTV is connected, auto play is behavior is enabled via the remote link somehow. Resetting and repairing iSponsorBlockTV doesn't help.

@dmunozv04 -- as a work around until this can be fixed, can a STOP optionally be sent automatically within 5 seconds of video end?

@Adithyan007hack
Copy link

Adithyan007hack commented Jan 21, 2024

Is there an update on this situation? because it still autoplays for me

@dmunozv04
Copy link
Owner

I've been experimenting but haven't been able to make it work consistently

@TylerJaacks
Copy link

Does if have something to do with this

        elif event_type == "autoplayUpNext":
            if len(args) > 0 and (
                vid_id := args[0]["videoId"]
            ):  # if video id is not empty
                print(f"Getting segments for next video: {vid_id}")
                create_task(self.api_helper.get_segments(vid_id))```

@dmunozv04
Copy link
Owner

That shouldn’t modify anything, it just requests the segments on the sponsorblock database

@TylerJaacks
Copy link

So I was looking at the pyytlounge code and the youtube lounge api documentation. I see this

Set autoplay
Video Play
command name = `setAutoplayMode`
&count=1
&autoplayMode=ENABLED / ENABLED or DISABLED

it seems that is what is happening here

    async def set_auto_play_mode(self, enabled: bool):
        await super()._command(
            "setAutoplayMode", {"autoplayMode": "ENABLED" if enabled else "DISABLED"}
        )
POST https://www.youtube.com/api/lounge/bc/bind
content-type:application/x-www-form-urlencoded
name=devicename&app=app_name&loungeIdToken=loungeToken
234
[[0,[\"c\",\"FEWWEFWEFWEF\",\"\",8]]
,[1,[\"S\",\"wefwefwef\"]]
,[2,[\"loungeStatus\",{}]
,[3,[\"playlistModified\",{\"videoIds\":\"\"}]]
,[4,[\"onAutoplayModeChanged\",{\"autoplayMode\":\"UNSUPPORTED\"}]]
,[5,[\"onPlaylistModeChanged\",{\"shuffleEnabled\":\"false\",\"loopEnabled\":\"false\"}]]
]

I'm wondering if its possible to spoof the api into thinking the device doesn't support autoplay.

@TylerJaacks
Copy link

or never mind couldn't u just process this event onAutoplayModeChanged cause it doesn't look like that is currently happening.

@dmunozv04
Copy link
Owner

I attempted processing that event, and it managed to disable autoplay for people that wanted it enabled and also keep autoplay enabled for the ones that didn't want it. Feel free to experiment with it and report back, maybe it works now

@TylerJaacks
Copy link

@dmunozv04 do u have the code that you used?

@dmunozv04
Copy link
Owner

@dmunozv04 do u have the code that you used?

# elif event_type == "onAutoplayModeChanged":

This is what I tried

@TylerJaacks
Copy link

ok I added elif event_type == "setAutoplayMode": data = args[0] print(data) and this seems to disable them for me what is what I want, so I just forked for my self.

@TylerJaacks
Copy link

cause u probably could just and the event_type = setAutoplayMode and the toggle variable and maybe that will work.

@FarawaySounds
Copy link

Did this work?

@TylerJaacks
Copy link

i believe so

@FarawaySounds
Copy link

FarawaySounds commented Mar 26, 2024

I wasn't able to get your suggested solution to work.

However I think I found something that does.

elif event_type == "onAutoplayModeChanged":
            create_task(self.set_auto_play_mode(False))

This seems to work consistently as the onAutoplayModeChanged event is called regularly.
You could have it enable/disable if there was an option in the settings that would change what bool value was passed into the set auto play mode method.

@TylerJaacks
Copy link

Nice

@sejmann
Copy link

sejmann commented Apr 9, 2024

I tried @FarawaySounds' change, and it seems to work well most of the time on my Apple TV. and instead of showing the post-video screen (that allows replay), it exits to the main list screen, which I'm okay with. Once during my testing, one video ended, but the audio repeated from the beginning while the screen showed the post-video screen. It was a Jimmy Kimmel clip, but had no sponsors, and I'd jumped around a bit, and maybe that confused the YouTube.app. (https://www.youtube.com/watch?v=F7iANkAUB_k). Anyone else see any rare odd behavior?

Anyway, maybe this works well enough to be merged, if it has a flag in the config.json, or something?

@mureev
Copy link

mureev commented May 25, 2024

it would be nice to use suggested change with the docker image. did anyone forked/pushed already?

@dmunozv04
Copy link
Owner

I've pushed a new version, it might help with autoplay issues, regardless if you want it to be ON or OFF.
Please toggle autoplay at least one time after updating and let me know if it fixes the issues

@Tone866
Copy link
Author

Tone866 commented May 31, 2024

I've toggled it in the tv app, but it's still enabled.
Do I have to change something in the settings of isponserblocktv?

@dmunozv04
Copy link
Owner

dmunozv04 commented May 31, 2024

I've toggled it in the tv app, but it's still enabled. Do I have to change something in the settings of isponserblocktv?

I've done some testing, and after updating and toggling autoplay on and off again, the video end screen would show a "next up" message instead of "playing in x seconds". Please make sure that you have the latest version

@Tone866
Copy link
Author

Tone866 commented May 31, 2024

I updated to 2.0.8 today
On my device it still starts the next video in 5 seconds

@the8thsign
Copy link

the8thsign commented May 31, 2024

My experience has been it has not been fixed. Updated to 2.0.8, restarted the Youtube app on Apple TV. Set autoplay from on to off, then off to on, one last time. Restarted the YT app and tested with 3 videos. All had autoplay enabled.

@taylorthurlow
Copy link

No luck here either.

@RareBirdMe
Copy link

RareBirdMe commented Jun 12, 2024

Same issue on Sony Android TV. Autoplay in the youtube app is set to off but after the end of the video 5-sec autoplay countdown starts, with a note to prevent playing the next video "press the stop button on the mobile device" (which is obviously iSponsorBlockTV service).

Also, it looks like all the videos played in the current session are stored in a separate playlist (accessible when pausing a video, under the controls section). Possibly the autoplay is somehow active with regard to this playlist.

Latest version. Tried toggling it on and back off on the TV app, no effect.

@dmunozv04
Copy link
Owner

This is now fixed on v2.1.0 . Set the new config option auto_play to your desired choice!

@AN1MATEK
Copy link
Contributor

AN1MATEK commented Jul 9, 2024

Unfortunately it still autoplays for me on a ATV (I did edit the config file with the new option).

Should I open a new issue? What information can I provide for debugging?

@the8thsign
Copy link

@AN1MATEK Make sure you are using auto_play and not autoplay. The config.json template has the wrong one. Also restart both iSponsorBlockTV and the Youtube app after the change.

@dmunozv04
Copy link
Owner

Unfortunately it still autoplays for me on a ATV (I did edit the config file with the new option).

Should I open a new issue? What information can I provide for debugging?

@AN1MATEK do please open a new issue if you still are having problems

@AN1MATEK
Copy link
Contributor

@AN1MATEK Make sure you are using auto_play and not autoplay. The config.json template has the wrong one. Also restart both iSponsorBlockTV and the Youtube app after the change.

Well how in the hell I was supposed to know that lol. Thank you, I added it and we'll see if it works now.

@mureev
Copy link

mureev commented Jul 11, 2024

thanks a lot. everything worked after updating docker image, changing config by adding new line and a restart.

"auto_play": false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests