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

Not working with android TV? #24

Open
jariz opened this issue Aug 24, 2021 · 17 comments
Open

Not working with android TV? #24

jariz opened this issue Aug 24, 2021 · 17 comments
Labels
bug Something isn't working

Comments

@jariz
Copy link

jariz commented Aug 24, 2021

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.

@agneevX
Copy link

agneevX commented Aug 26, 2021

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

@erdnaxeli erdnaxeli added the bug Something isn't working label Aug 26, 2021
@erdnaxeli
Copy link
Owner

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!

@maxexcloo
Copy link

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

@jariz
Copy link
Author

jariz commented Aug 30, 2021

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

@maxexcloo
Copy link

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

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

@pchristod
Copy link

pchristod commented Dec 13, 2021

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 ?

@ajayyy
Copy link

ajayyy commented Dec 13, 2021

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

image

https://t.me/SmartTubeNext_en/8514

@pchristod
Copy link

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.

@erdnaxeli
Copy link
Owner

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.

@pchristod
Copy link

pchristod commented Dec 17, 2021

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 😄

@matthewmmorrow
Copy link

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.

@pchristod
Copy link

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?

@erdnaxeli
Copy link
Owner

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.

@erdnaxeli
Copy link
Owner

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

@pchristod
Copy link

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.

@JimboJoe
Copy link

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

@simeononsecurity
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants