Comments (6)
I really like the idea.
But getting the local ip address is no simple task if you have multiple interfaces as i do.
What do you think of:
import commands
import re
def default_ipv4():
status_code, result = commands.getstatusoutput('ip route get 255.255.255.255')
if status_code == 0:
match = re.findall(r"(?<=src )(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})", result)
if match:
return match[0]
return None
from pulseaudio-dlna.
yeah ip route get
sure is an alternative to hostname -I
.
However if people had multiple interfaces they may prefer your still working --host option anyway.
Just a note aside: commands
is deprecated in Python3 so I'd recommend subprocess.Popen
instead.
from pulseaudio-dlna.
Sorry for the late reply.
A friend of mine recommended socket.gethostbyname(socket.getfqdn())
, but since this is all about the important default value host i will first test it.
I will implement it this evening (hopefully).
from pulseaudio-dlna.
- 0.2.1 - (2015-01-11)
- TTL changed to 10 and timeout to 5 for UDP broadcasting
- Added the
--renderer-urls
option to manually add UPNP devices via their control url - Added the
--debug
flag - The host ip address is now discovered automatically, no need to specifiy
--host
anymore
from pulseaudio-dlna.
Cool! Works great now. Thank you!
from pulseaudio-dlna.
Your welcome :)
from pulseaudio-dlna.
Related Issues (20)
- Chrome OS Support
- non-critical (?) error during setup of pulseaudio-dlna with Python 3.8
- The device "Living Room speaker (Chromecast)" failed to play! (500) - Unknown exception
- Outdated? 2020... HOT 3
- Any way to make this never the default ?
- ValueError: invalid literal for int() with base 10: '119,192.168.0.9' HOT 4
- Error after Kodi Update: pyupnpv2 - Connection timeout
- Don't work with pipewire-pulseaudio HOT 11
- "An exception happened" HOT 2
- Kubuntu 21.04 w/ backports HOT 1
- Is this project dead? HOT 1
- [not an issue] Addition to the Tested Device List: Allo Boss2 Player ruinning Moode UPNP (DLNA) - tested
- pulseaudio-dlna connects - but no sound! HOT 2
- Request 24 bit 96000 audio ouput
- Another request for FLAC 24/96 streaming
- Add support for OpenHome HOT 1
- Cannot add PPA: ''This PPA does not support focal''. HOT 1
- pulseaudio_dlna.streamserver provides wrong sample specs HOT 2
- Add more maintainers
- Propose another choice to stream audio to DLNA devices
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pulseaudio-dlna.