gabrielmagno / nano-dlna

A minimal UPnP/DLNA media streamer
MIT License
186 stars 45 forks source link

HTTP Error #11

Closed vredesbyyrd closed 3 years ago

vredesbyyrd commented 3 years ago

Hi, thanks for sharing this tool, it appears to be exactly what i was looking for.

Although I am unable to get any media to play. I am trying to stream from arch linux + python 3.9 to a sony bdp-s390 bluray play. The device is found using nanodlna list, but when trying: nanodlna play movie.mp4 it returns the following error.

Traceback (most recent call last):
  File "/home/clu/.local/bin/nanodlna", line 8, in <module>
    sys.exit(run())
  File "/home/clu/.local/lib/python3.9/site-packages/nanodlna/cli.py", line 96, in run
    args.func(args)
  File "/home/clu/.local/lib/python3.9/site-packages/nanodlna/cli.py", line 73, in play
    dlna.play(files_urls, device)
  File "/home/clu/.local/lib/python3.9/site-packages/nanodlna/dlna.py", line 54, in play
    send_dlna_action(device, video_data, "SetAVTransportURI")
  File "/home/clu/.local/lib/python3.9/site-packages/nanodlna/dlna.py", line 29, in send_dlna_action
    urllibreq.urlopen(request)
  File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.9/urllib/request.py", line 523, in open
    response = meth(req, response)
  File "/usr/lib/python3.9/urllib/request.py", line 632, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.9/urllib/request.py", line 561, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error

Any thoughts you may have would be very appreciated!

gabrielmagno commented 3 years ago

Hi @vredesbyyrd ! Thank you for the interest in nano-dlna!

Would you mind sharing the output of the command nanodlna list?

Then, if possible, share the content of the "location" URL of the device listed?

Please check if there's any personal information you would like to redact (ex: hosts, IPs, or user names), and remove it before sending.

Thank you!

vredesbyyrd commented 3 years ago

No sweat. Thanks for taking a look.


Device 1:
{
    "location": "http://192.168.0.101:redacted/dmr.xml",
    "hostname": "192.168.0.101",
    "friendly_name": "Blu-ray Disc Player",
    "action_url": "http://192.168.0.101:redacted/upnp/control/AVTransport",
    "st": "urn:schemas-upnp-org:service:AVTransport:1"
}

Location output:

1 0 urn:schemas-upnp-org:device:MediaRenderer:1 Blu-ray Disc Player Sony Corporation http://www.sony.net/ Blu-ray Disc Player uuid:00000000-0000-1010-8000-5453edee79a5 DMR-1.50 playcontainer-1-0 image/jpeg 120 120 24 /bdp_ax_device_icon_large.jpg image/png 120 120 24 /bdp_ax_device_icon_large.png image/jpeg 48 48 24 /bdp_ax_device_icon_small.jpg image/png 48 48 24 /bdp_ax_device_icon_small.png urn:schemas-upnp-org:service:RenderingControl:1 urn:upnp-org:serviceId:RenderingControl /RenderingControlBdpSCPD.xml /upnp/control/RenderingControl /upnp/event/RenderingControl urn:schemas-upnp-org:service:ConnectionManager:1 urn:upnp-org:serviceId:ConnectionManager /ConnectionManagerSCPD.xml /upnp/control/ConnectionManager /upnp/event/ConnectionManager urn:schemas-upnp-org:service:AVTransport:1 urn:upnp-org:serviceId:AVTransport /AVTransportSCPD.xml /upnp/control/AVTransport /upnp/event/AVTransport urn:schemas-sony-com:service:Party:1 urn:schemas-sony-com:serviceId:Party /PartySCPD.xml /upnp/control/Party /upnp/event/Party 64 1.1

gabrielmagno commented 3 years ago

I've implemented a log/debug feature. The plan is to include this feature in the next version.

@vredesbyyrd Would you mind running with this new debug feature? It is still experimental, so you will need to clone the code from an specific branch and manually install it.

Instal the current experimental version:

git clone https://github.com/gabrielmagno/nano-dlna.git
cd nano-dlna
git checkout feature/debug-log
sudo python setup.py install

Then, try playing your video, making sure to add the new debug parameter:

nanodlna --debug play my_video.mp4

It will inform that it will save the log in some file:

nano-dlna log will be saved here: nanodlna-XXXXXXXXXXX.log

This file will have valuable information for me to debug the problem. If you can, send it to me. It will have some potentially private information (name of the file, folder name, local IP address, etc) that you might want to remove before sending it, so please check.

Thank you!

vredesbyyrd commented 3 years ago

@gabrielmagno Hi, sorry for the delay.

Here is the log. nanodlna-2021-01-19_10-49-02.log

Let me know if there is anymore info that could be useful.

gabrielmagno commented 3 years ago

@vredesbyyrd thank you for the log.

After analyzing it, I have a hypothesis of what is the problem. I've updated the feature/debug-log branch with a candidate fix.

Would you mind updating your local copy of the branch, reinstalling, and trying to play your video again?

If it works, please let me know, and if it doesn't, please send the log created by this new version.

Thanks!

vredesbyyrd commented 3 years ago

@gabrielmagno

It worked :) Thanks a ton for working it out, its very appreciated. Nano-dlna is a neat piece of software for sure. I am trying to avoid buying a chromecast or something similar and this fits the bill. If you do not mind me asking, looking at the todos you have list:

CLI interface to send controller actions (play, pause, stop, etc) to the MediaRenderer

Are said control features still on the roadmap perhaps? I've been working on a simple little media database browser using rofi and it could be handy to have an option to play a selected video locally or cast via nano-dlna, and it would be a bonus if playback control was feasible.

Thanks again!

EDIT: I admit I do not know how difficult that would be to implement all done over dlna

gabrielmagno commented 3 years ago

I'm glad the bug was fixed, and happy to know that nano-dlna is being useful for you :-) I will include the bug fix in the next release. For now you can keep using the version from that branch.

Regarding the controller actions features, it is indeed possible to do it with DLNA, it is just a matter of being implemented in nano-dlna. Considering that you are showing interest on this feature, and that I've recently became more motivated to continue nano-dlna development, I will take a shot!

vredesbyyrd commented 3 years ago

Considering that you are showing interest on this feature, and that I've recently became more motivated to continue nano-dlna development, I will take a shot!

Right on! I would help if I had adequate programming knowledge, but I am just not there... yet. But I can definitely help test new features, haha.

Glad to hear you are interested/motivated to continue development on nano-dlna. In my hunt for a dlna cli program none of them were capable of controlling playback as far as i know. So yeah that would be another thing that sets yours apart, in addition to being python rather than node.js + a thousand depends.

I look forward to it.