Skip to content

play_url HTTP 500 error on tvOS 26.2 (regression of #2512) #2821

@timtimtimtimtimtimtimtim

Description

Description

The play_url() function fails with pyatv.exceptions.HttpError when attempting to stream video to an Apple TV 4K running tvOS 26.2. This appears to be a regression of #2512, which was originally reported for tvOS 18.0 and fixed in v0.16.1.

Environment

  • pyatv version: 0.17.0
  • tvOS version: 26.2
  • Device: Apple TV 4K (gen 3)
  • Python version: 3.11
  • Platform: macOS (Darwin 22.6.0)

Error

pyatv.exceptions.HttpError: HTTP/1.1 method GET failed with code 500: Internal Server Error

Full traceback:

Traceback (most recent call last):
  File ".../pyatv/scripts/atvremote.py", line 998, in _run_application
    return await cli_handler(loop)
  File ".../pyatv/scripts/atvremote.py", line 727, in cli_handler
    return await _handle_commands(args, config, storage, loop)
  File ".../pyatv/scripts/atvremote.py", line 877, in _handle_commands
    ret = await _handle_device_command(args, cmd, atv, storage, loop)
  File ".../pyatv/scripts/atvremote.py", line 933, in _handle_device_command
    return await _exec_command(atv.stream, cmd, True, *cmd_args)
  File ".../pyatv/scripts/atvremote.py", line 965, in _exec_command
    value = await tmp(*args)
  File ".../pyatv/core/facade.py", line 375, in play_url
    await self.relay("play_url")(url, **kwargs)
  File ".../pyatv/protocols/airplay/__init__.py", line 137, in play_url
    return await self._play_task
  File ".../pyatv/protocols/airplay/player.py", line 68, in play_url
    await self._wait_for_media_to_end()
  File ".../pyatv/protocols/airplay/player.py", line 84, in _wait_for_media_to_end
    resp = await self.rtsp.connection.get("/playback-info")
  File ".../pyatv/support/http.py", line 422, in get
    return await self.send_and_receive("GET", path, allow_error=allow_error)
  File ".../pyatv/support/http.py", line 495, in send_and_receive
    raise exceptions.HttpError(
pyatv.exceptions.HttpError: HTTP/1.1 method GET failed with code 500: Internal Server Error

Steps to Reproduce

  1. Pair with Apple TV running tvOS 26.2:

    atvremote --address <IP> --protocol airplay pair
  2. Attempt to play any URL:

    atvremote --id <DEVICE_ID> --address <IP> play_url="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
  3. Error occurs immediately after playback attempt

Observations

  • Device scan works: atvremote scan correctly finds the Apple TV
  • Status check works: atvremote playing returns device state correctly
  • Pairing is valid: Credentials are stored and other commands work
  • Public URLs also fail: Tested with Google's Big Buck Bunny test video - same error
  • Error location: Fails in _wait_for_media_to_end() when querying /playback-info

Relation to #2512

This is the same error as #2512 which was reported for tvOS 18.0. That issue was marked as completed, and v0.16.1 release notes mention "Connection issues with tvOS 18.4+" being addressed. However, tvOS 26.2 appears to have reintroduced the problem, likely due to further API changes by Apple.

Possible Cause

Apple may have changed the /playback-info RTSP endpoint behavior in tvOS 26.x, causing it to return HTTP 500 where it previously worked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions