Need help with dlnap?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

cherezov
134 Stars 46 Forks MIT License 104 Commits 13 Opened issues

Description

Simple python over the network media player to playback on DLNA/UPnP devices

Services available

!
?

Need anything else?

Contributors list

# 354,624
C
Shell
smartca...
Objecti...
82 commits
# 113,773
Objecti...
C
Shell
web-ser...
2 commits
# 491,989
PHP
CSS
cms-fra...
1 commit
# 414,633
HTML
Shell
pelican
transla...
1 commit

dlnap

Enjoy music on your favorite sound system or share a picture or YouTube video with your folks and friends on smart TV. Simple network player for DLNA/UPnP devices allows you discover devices and playback media on them.

Requires

  • Python (whatever you like: python 2.7+ or python3)
  • youtube-dl to playback YouTube links

TODO

  • [ ] Fix '&' bug
  • [ ] Set next media
  • [x] Volume control
  • [ ] Position control
  • [ ] Add support to play media from local machine, e.g --play /home/username/media/music.mp3 for py3
  • [ ] Try it on Windows
  • [ ] Add AVTransport:2 and further support
  • [ ] Play on multiple devices
  • [x] Integrate local download proxy
  • [x] Stop/Pause playback
  • [x] Investigate if it possible to play images/video's on DLNA/UPnP powered TV (possible via download proxy)

Supported devices/software

  • [x] Yamaha RX577
  • [x] Samsung Smart TV (UE40ES5507) via proxy
  • [x] Marantz MR611
  • [x] Kodi
  • [ ] Volumio2 (?)
  • please email me if it works or doesn't work with your device

Usage

Overview

dlnap.py [] [] []

Selectors:

--ip 
ip address for faster access to the known device
--device 
discover devices with this name as substring
Commands:
--list
default command. Lists discovered UPnP devices in the network
--play 
set current url for play and start playback it. In case of empty url - continue playing recent media
--pause
pause current playback
--stop
stop current playback
Features:
--all
flag to discover all upnp devices, not only devices with AVTransport ability
--proxy
use sync local download proxy, default is ip of current machine
--proxy-port
port for local download proxy, default is 8000
--timeout 
discover timeout

Discover UPnP devices

List devices which are able to playback media only ```

dlnap.py Discovered devices: [a] Receiver rx577 @ 192.168.1.40 [a] Samsung TV @ 192.168.1.35 ```

List all available UPnP devices ```

dlnap.py --all Discovered devices: [x] ZyXEL Keenetic Giga @ 192.168.1.1 [a] Samsung TV @ 192.168.1.35 [x] Data @ 192.168.1.50 [a] Receiver rx577 @ 192.168.1.40 ```
where
[a] means that devices allows media playback
[x] means that device doesn't allow media playback

Playback media

Playback music ```

dlnap.py --ip 192.168.1.40 --play http://somewhere.com/music.mp3 Receiver rx577 @ 192.168.1.40

**Playback video**
dlnap.py --device tv --play http://somewhere.com/video.mp4 Samsung TV @ 192.168.1.35
**Show image**
dlnap.py --device tv --play http://somewhere.com/image.jpg Samsung TV @ 192.168.1.35
**Local files**
dlnap.py --device tv --play ~/media/video.mp4 --proxy Samsung TV @ 192.168.1.35 ```

YouTube links ```

dlnap.py --device tv --play https://www.youtube.com/watch?v=q0eWOaLxlso Samsung TV @ 192.168.1.35 ``` Note: requires youtube-dl installed

Proxy

Some devices doesn not able to play

https
links or links pointed outside of the local network.
For such cases
dlnap.py
tool allows to redirect such links to embeded download proxy.

Example:
The following command will set up a local http server at

http://:8000
and tells TV to download file
http://somewhere.com/video.mp4
from this http server:
```

dlnap.py --device tv --play http://somewhere.com/video.mp4 --proxy ```

So behind the scene the command looks like:
```

dlnap.py --device tv --play 'http://:8000/http://somewhere.com/video.mp4'

**Note:** proxy is syncronous which means that
dlnap.py``` will not exit while device downloading file to playback.

We need to go deeper :octocat:

YouTube/Vimeo/etc videos
In general device can playback direct links to a video file or a stream url only.
There are tools to convert (YouTube) url to stream url, e.g youtube-dl tool.
Assuming you have download proxy up and running at

http://:8000
you can now play a video using command:
```

dlnap.py --device tv --play http://:8000/

youtube-dl -g https://www.youtube.com/watch?v=q0eWOaLxlso
Samsung TV @ 192.168.1.35 ```

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.