postlund / pyatv

A client library for Apple TV and AirPlay devices
https://pyatv.dev
MIT License
827 stars 87 forks source link

Playing videos on AirPlay is broken #2393

Open AlmogBaku opened 4 weeks ago

AlmogBaku commented 4 weeks ago

Describe the bug

When using the same command from the docs, I'm running into an error

Error log

atvremote -n "[LG] webOS TV" play_url=http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4

Traceback (most recent call last):
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 978, in _run_application
    return await cli_handler(loop)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 723, in cli_handler
    return await _handle_commands(args, config, storage, loop)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 862, in _handle_commands
    ret = await _handle_device_command(args, cmd, atv, storage, loop)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 916, in _handle_device_command
    return await _exec_command(atv.stream, cmd, True, *cmd_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 945, in _exec_command
    value = await tmp(*args)
            ^^^^^^^^^^^^^^^^
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/core/facade.py", line 356, in play_url
    await self.relay("play_url")(url, **kwargs)
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/protocols/airplay/__init__.py", line 136, in play_url
    return await self._play_task
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/contextlib.py", line 222, in __aexit__
    await self.gen.athrow(typ, value, traceback)
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/protocols/airplay/player.py", line 31, in timing_server
    yield server
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/protocols/airplay/player.py", line 52, in play_url
    resp = await self.stream_protocol.play_url(server.port, url, position)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/protocols/raop/protocols/airplayv2.py", line 244, in play_url
    await self.rtsp.exchange(
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/support/rtsp.py", line 293, in exchange
    resp = await self.connection.send_and_receive(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/almogbaku/.pyenv/versions/3.11.1/lib/python3.11/site-packages/pyatv/support/http.py", line 495, in send_and_receive
    raise exceptions.HttpError(
pyatv.exceptions.HttpError: RTSP/1.0 method PUT failed with code 501: Not Implemented

How to reproduce the bug?

run the same command

What is expected behavior?

it should work

Operating System

MacOS

Python

Other

pyatv

recent

Device

WebOS LG TV

Additional context

-