erdnaxeli/castblock

Not working with android TV?

Opened this issue ยท 17 comments

jariz commented

I know this project focuses on chromecast, but considering new chromecasts are now running on Android TV, and android TV having 'build-in chromecast', I do think it's relevant to this project.

The youtube app does not seem to expose the contentId, rather, it leaves it blank.

castblock_1     | 2021-08-24T18:39:29.234384Z   INFO - castblock.chromecast: Starting go-chromecast watcher -- name: "55OLED803/12", uuid: "f033e63692e4a6bd0f82461e5a6e7c80"
castblock_1     | 2021-08-24T18:39:29.438298Z  ERROR - castblock.sponsorblock: Error from Sponsorblock -- status_code: 400, video_id: ""

Running with --debug doesn't really give us any more info

castblock_1     | 2021-08-24T18:41:05.268471Z  DEBUG - castblock.chromecast: Unhandled payload: Missing JSON attribute: customData
castblock_1     |   parsing Castblock::Chromecast::WatchMessagePayload::PayloadStatus at line 1, column 48
castblock_1     |   parsing Castblock::Chromecast::WatchMessagePayload#status at line 1, column 38
castblock_1     | 2021-08-24T18:41:05.662804Z  DEBUG - castblock.blocker: Received message -- application: "YouTube"
castblock_1     | 2021-08-24T18:41:05.662808Z  DEBUG - castblock.blocker: Youtube video playing -- id: "", current_time: 43.631
castblock_1     | 2021-08-24T18:41:05.662827Z  DEBUG - http.client: Performing request -- method: "GET", host: "sponsor.ajay.app", port: 443, resource: "/api/skipSegments?categories=%5B%22sponsor%22%5D&videoID="
castblock_1     | 2021-08-24T18:41:05.793259Z  ERROR - castblock.sponsorblock: Error from Sponsorblock -- status_code: 400, video_id: ""
castblock_1     | 2021-08-24T18:41:05.793262Z  DEBUG - castblock.blocker: Unknown video -- id: ""

I then decided to manually run go-chromecast watch, and there we can see the contentId appears to be left blank ๐Ÿ˜ž: (edited for brevity)

{
    "requestId": 0,
    "type": "MEDIA_STATUS",
    "status": [
        {
            "mediaSessionId": 11,
            "playerState": "PLAYING",
            "playbackRate": 1,
            "currentTime": 56.629,
            "supportedMediaCommands": 207,
            "volume": {
                "level": 0,
                "muted": false
            },
            "activeTrackIds": [],
            "media": {
                "contentId": "", // <--- empty??
                "streamType": "BUFFERED",
                "metadata": {
                    "metadataType": 0,
                    "title": "How Caffeine Addiction Changed History (ft. Michael Pollan) | WIRED",
                    "artist": "WIRED"
                },
                "duration": 353.04
            },
            "currentItemId": 1,
            "repeatMode": "REPEAT_OFF",
            ...
        }
    ]
}

So, maybe it's not possible at all, but would like to at least get a discussion going around this.

This puzzled me as well, as I moved from Chromecast to an Android TV with built-in Chromecast. Sucks unfortunately.

Hmm, that sucks. Without the contentId we cannot ask the sponsorblock api if the video has sponsor segments. I do have an android-tv (well, the youtube app built in my smart tv, but my phone see it as a chromecast), I will try to check it.

Thanks for the report!

Having the same issue too - would it maybe be possible to look up the video ID from the video title?

jariz commented

@maxexcloo That would definitely be a final resort imo because of the high possibility of false positives.

Ah I misunderstood, I thought Google were actually suppressing that info - my bad there!

If there's any way to help, happy to!

Hi,
may I ask if anything new has come to light here? I set up this fantastic Docker Container yesterday and while it works for all the other Chromecast Devices I have, the Chromecast with Google TV has exactly this problem:

2021-12-13T11:12:13.121092Z ERROR - castblock.sponsorblock: Error from Sponsorblock -- status_code: 400, video_id: "",
2021-12-13T11:12:15.160721Z ERROR - castblock.sponsorblock: Error from Sponsorblock -- status_code: 400, video_id: "",
2021-12-13T11:12:17.196981Z ERROR - castblock.sponsorblock: Error from Sponsorblock -- status_code: 400, video_id: "",
2021-12-13T11:12:19.215848Z ERROR - castblock.sponsorblock: Error from Sponsorblock -- status_code: 400, video_id: "",
2021-12-13T11:12:21.293483Z ERROR - castblock.sponsorblock: Error from Sponsorblock -- status_code: 400, video_id: ""

Shame really, because it's just great on all the other Devices ๐Ÿ‘

Edit: From the mentioning of the Issue above I see that someone has provided (in another repo) the workaround that was discussed here too nichobi/sponsorblockcast#17
Is that something which could also be implemented in castblock @erdnaxeli ?

For AndroidTV, you can install SmartTubeNext and cast to specifically to the app

image

https://t.me/SmartTubeNext_en/8514

Really appreciate the suggestion, I know the App. However in my case I'd like to stay on stock Apps. Same reason I'm not using e.g. Vanced on Android.

Edit: From the mentioning of the Issue above I see that someone has provided (in another repo) the workaround that was discussed here too nichobi/sponsorblockcast#17
Is that something which could also be implemented in castblock @erdnaxeli ?

Thanks for the hint, I will look at it this week-end.

Edit: From the mentioning of the Issue above I see that someone has provided (in another repo) the workaround that was discussed here too nichobi/sponsorblockcast#17

Is that something which could also be implemented in castblock @erdnaxeli ?

Thanks for the hint, I will look at it this week-end.

Thanks. Please mention me if it is a feasable option and you need someome to try it at any point ๐Ÿ˜„

Just a heads up, I opened this issue nichobi/sponsorblockcast#20 in the similar sponsorblockcast which uses the fix of looking up the title/artist to get the ID. But each search endpoint call counts as 100 out of 10000 queries per day. So if you implement the lookup in this project watch out, you'll only be able to get 100 video lookups per day.

Edit: From the mentioning of the Issue above I see that someone has provided (in another repo) the workaround that was discussed here too nichobi/sponsorblockcast#17

Is that something which could also be implemented in castblock @erdnaxeli ?

Thanks for the hint, I will look at it this week-end.

@erdnaxeli A bit of time has passed and it seems the project is more active again. May I ask if something regarding Android TV/Google TV has been implemented yet?

So we have not a lot of choices:

  • using the official youtube API, which need to provide an API key. I don't really like this idea, as it makes the app not so user friendly to use anymore
  • using the mobile site to do the search, and scrap the html page returned to get the video id

I think I will try to implement both solution. If you provide an API key, let's use it, else let's fallback to the scrapping way. It should not be too hard to implement.

To clarify, it seems news Chromecast (v4) behaves like android TV already does. So this issue really need to be fixed.

Great solution! Sounds like this will cover the best of both worlds, as tech savvy users can use the API (which shouldn't be too hard anyways) and others can use the fallback/default. Looking forward to this.

Has that workaround been tested as working? Do you expect to merge and/or publish on docker hub soon?
Thanks!

To clarify, it seems news Chromecast (v4) behaves like android TV already does. So this issue really need to be fixed.

Tested this on multiple modern android tv devices. Still get the same status error.