home-assistant-libs / pychromecast

Library for Python 3 to communicate with the Google Chromecast.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Data difference when using GoogleTV Youtube vs Casting

dasadavid opened this issue · comments

Hi,

Not sure if this is limitations of what google provide but I'm getting inconsistencies in data available about what's playing currently when casting manually vs when using the google tv youtube app. (My main concern is the content_id doesn't appear to be available when using youtube app directly). Is there any way this data could be retrieved?

Using tv youtube app (have edited data format a bit so it looks nice with json, but not removed/added anything):

{
    "metadata_type": 0,
    "title": "All Aboard It Is Sleepy Time",
    "series_title": "None",
    "season": "None",
    "episode": "None",
    "artist": "Bababouy",
    "album_name": "None",
    "album_artist": "None",
    "track": "None",
    "subtitle_tracks": {},
    "images": [],
    "supports_pause": true,
    "supports_seek": true,
    "supports_stream_volume": true,
    "supports_stream_mute": true,
    "supports_skip_forward": false,
    "supports_skip_backward": false,
    "current_time": 5857.229,
    "content_id": "",
    "content_type": "None",
    "duration": 30031.06,
    "stream_type": "BUFFERED",
    "idle_reason": "None",
    "media_session_id": 47,
    "playback_rate": 1,
    "player_state": "PLAYING",
    "supported_media_commands": 207,
    "volume_level": 0,
    "volume_muted": false,
    "media_custom_data": {},
    "media_metadata": {
        "metadataType": 0,
        "title": "All Aboard It Is Sleepy Time",
        "artist": "Bababouy"
    },
    "current_subtitle_tracks": [],
    "last_updated": "datetime.datetime(2023, 4, 6, 16, 40, 49, 72315)"
}

vs casting video manually via chromecast:

{
    "metadata_type": 0,
    "title": "All Aboard It Is Sleepy Time",
    "series_title": "None",
    "season": "None",
    "episode": "None",
    "artist": "None",
    "album_name": "None",
    "album_artist": "None",
    "track": "None",
    "subtitle_tracks": {},
    "images": [MediaImage(url="https://i.ytimg.com/vi/DTba0bNEV14/hqdefault.jpg", height=None, width=None)
    ],
    "supports_pause": true,
    "supports_seek": true,
    "supports_stream_volume": false,
    "supports_stream_mute": false,
    "supports_skip_forward": false,
    "supports_skip_backward": false,
    "current_time": 7.295,
    "content_id": "DTba0bNEV14",
    "content_type": "x-youtube/video",
    "duration": 30031.061,
    "stream_type": "BUFFERED",
    "idle_reason": "None",
    "media_session_id": 1473984041,
    "playback_rate": 1,
    "player_state": "PLAYING",
    "supported_media_commands": 262147,
    "volume_level": 1,
    "volume_muted": false,
    "media_custom_data": {},
    "media_metadata": {
        "metadataType": 0,
        "title": "All Aboard It Is Sleepy Time",
        "subtitle": "Bababouy",
        "images": [
            {
                "url": "https://i.ytimg.com/vi/DTba0bNEV14/hqdefault.jpg"
            }
        ]
    },
    "current_subtitle_tracks": [],
    "last_updated": datetime.datetime(2023, 4, 6, 16, 44, 30, 53806)
}