question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AirPlay play_url /play 404 response

See original GitHub issue

Describe the bug

I’m trying to play a video file from a URL, any idea why /play is responding with 404 with valid airplay credentials? Thanks in advance

Error log

2021-12-10 00:42:53 DEBUG [pyatv.support.net]: Binding on *:5353
2021-12-10 00:42:53 DEBUG [pyatv.support.net]: Binding on 127.0.0.1:0
...
2021-12-10 00:42:56 DEBUG [pyatv.protocols.airplay.player]: Starting to play https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4
2021-12-10 00:42:56 DEBUG [pyatv.support.http]: Sending HTTP/1.1 message: b'POST /play HTTP/1.1\r\nContent-Length: 257\r\nUser-Agent: MediaControl/1.0\r\nContent-Type: application/x-apple-binary-plist\r\n\r\nbplist00\xd3\x01\x02\x03\x04\x05\x06_\x10\x10Content-Location^Start-Position_\x10\x12X-Apple-Session-ID_\x10hhttps://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4\x10\x00_\x10$6505b070-6ac2-4826-b4b5-957c1f272e5d\x08\x0f"1F\xb1\xb3\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xda'
2021-12-10 00:42:56 DEBUG [pyatv.support.http]: Received: b'HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\nServer: AirTunes/377.25.06\r\n\r\n'
2021-12-10 00:42:56 DEBUG [pyatv.support.http]: Got HTTP response: HttpResponse(protocol='HTTP', version='1.1', code=404, message='Not Found', headers={'content-length': '0', 'server': 'AirTunes/377.25.06'}, body=''):
2021-12-10 00:42:56 ERROR [pyatv.scripts.atvremote]: Authentication error: status code: 404
2021-12-10 00:42:56 DEBUG [pyatv.scripts.atvremote]: Waiting for 0 remaining tasks
2021-12-10 00:42:56 DEBUG [pyatv.support.http]: Connection closed

How to reproduce the bug?

$ atvremote -n "[LG] webOS TV UM7300PUA" --airplay-credentials
641e7f20c7919a5c56c352294e1e7630dc0c64a97bbce09c07a306c7848950b9:fd9efcac8d477cf92f58e1f49f2e06e031c89d4023cb6f930f7540f77de805a3:35383a32383a42343a32333a31373a4244:32333666343966362d613162302d346564392d383030322d313165366333326330663230
--debug
play_url=https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4

What is expected behavior?

AirPlay to play video from URL

Operating System

macOS

Python

3.9

pyatv

master

Device

LG TV 55" UM7300PUA

Additional context

Trying to play mp4 video from URL on LG TV 55"

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
postlundcommented, Dec 10, 2021

The exception is a bit misleading as that is obviously not an authentication error (I should fix that). My guess is that your TV does not support the /play command. I must say that I am not very confident as to what feature flag corresponds what actual feature in the protocol, but https://openairplay.github.io/airplay-spec/features.html with your feature flags (0x7F8AD0,0x38BCB46) suggests that video is not supported. HTTP live streams and audio are supported though (only audio streaming is supported by pyatv). So we are likely out of luck here until I get around supporting video streaming and to be honest, I’m not sure that will ever happen as it is very CPU intensive and hard to do in python. If offloaded to another application, maybe it can be accomplished.

0reactions
postlundcommented, Dec 19, 2021

Yeah, I totally agree! It’s so strange that they aren’t focusing more on streaming videos directly from the target device, e.g. via URL. Doing so now usually just breaks everything and makes stuff stop working (like metadata).

Read more comments on GitHub >

github_iconTop Results From Across the Web

If screen mirroring or streaming isn't working on your AirPlay ...
Learn what to do if you can't stream content with AirPlay, mirror the screen on your iOS device or Mac to your Apple...
Read more >
Unable to use with SONOS (Ikea SYMFONISK): Authentication ...
Describe the bug I'm unable to stream any audio to my SONOS. ... 2021-08-22 20:33:32 ERROR [root]: Authentication error: status code: 404 ......
Read more >
iOS 10 HLS 404 playlist error handling - Stack Overflow
Swift 4 Solution. You can track the AVPlayerItemNewErrorLogEntry notification. For a 404 error, the following code would print "HTTP 404: File Not Found"...
Read more >
Airplay Not Working? How-To Fix - YouTube
Is Apple Airplay not working for you? This video outlines some tips and fixes to get your airplay connected devices back to working...
Read more >
Help | Error Code Troubleshooting Guide - DAZN
If this does not work, please contact customer service. 65-003-404/65-069-404. Why am I receiving this error? •[Playback] Please ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found