Comments (11)
That's interesting, that means that zeroconf returned a tuple instead of a string.
Locally on your machine, could you change /home/dobrien/pychromecast-master/pychromecast/init.py
and add a new line before line 151 that says print(host)
and tell me the output ?
from pychromecast.
I have the same issue.
So I added the print(host) you asked for.
root@htpc:/tmp/pychromecast-master# python ./example.py
(u'Wohnzimmer.local.', 8009)
Traceback (most recent call last):
File "./example.py", line 16, in
cast = pychromecast.get_chromecast()
File "/tmp/pychromecast-master/pychromecast/init.py", line 121, in get_chromecast
for ip in discover_chromecasts(1)]
File "/tmp/pychromecast-master/pychromecast/init.py", line 152, in init
self.host = socket.gethostbyname(host)
TypeError: must be string, not tuple
Exception AttributeError: "'Chromecast' object has no attribute 'socket_client'" in ignored
"Wohnzimmer" means "living room" in german and is the name of my chromecast.
from pychromecast.
For now, if you want to play with it, add a line before line 151 that says host = host[0]
. I'll push a proper fix when I get back home tonight.
from pychromecast.
Thanks.
Now I get this:
root@htpc:/tmp/pychromecast-master# python ./example.py
DeviceStatus(friendly_name='Wohnzimmer', model_name='Eureka Dongle', manufacturer='Google Inc.', api_version=(1, 0))
CastStatus(is_active_input=False, is_stand_by=True, volume_level=1.0, volume_muted=False, app_id=u'E8C28D3C', display_name=u'Backdrop', namespaces=[u'urn:x-cast:com.google.cast.sse'], session_id=u'ED627B11-7A05-4A6E-0B1D-BE6DBEAC297C', transport_id=u'web-0', status_text='')
None
Playing media
No handlers could be found for logger "pychromecast.socket_client"
Traceback (most recent call last):
File "./example.py", line 40, in
"sample/BigBuckBunny.mp4"), "video/mp4")
File "/tmp/pychromecast-master/pychromecast/controllers/media.py", line 185, in play_media
self.send_message(msg, inc_session_id=True)
File "/tmp/pychromecast-master/pychromecast/controllers/init.py", line 77, in send_message
"application.").format(self.namespace))
pychromecast.error.UnsupportedNamespace: Namespace urn:x-cast:com.google.cast.media is not supported by runningapplication.
Do you want me to create a separate issue for this?
You may want to add some checks to prevent this error messages. :)
But no hurry.
I am not at home either. ;)
from pychromecast.
Here's what I've added to the init.py
# Resolve host to IP address (line 150)
print(host)
host = host[0]
print(host)
self.host = socket.gethostbyname(host)
And here's the output:
~/pychromecast-master$ python example.py
(u'Living room.local.', 8009)
Living room.local.
Traceback (most recent call last):
File "example.py", line 16, in
cast = pychromecast.get_chromecast()
File "/home/dobrien/pychromecast-master/pychromecast/init.py", line 121, in get_chromecast
for ip in discover_chromecasts(1)]
File "/home/dobrien/pychromecast-master/pychromecast/init.py", line 154, in init
self.host = socket.gethostbyname(host)
socket.gaierror: [Errno -2] Name or service not known
Exception AttributeError: "'Chromecast' object has no attribute 'socket_client'" in ignored
from pychromecast.
Which platform are you running this on?
from pychromecast.
I'm on Ubuntu 12.04.5 LTS (GNU/Linux 3.2.0-74-generic i686)
from pychromecast.
Me too.
Ubuntu 12.04.5 LTS
3.2.0-74-generic
Python 2.7.3
btw: This time the example.py (with your modification) worked without errors.
from pychromecast.
It seems that zeroconf is enabled by default since Ubuntu version 9.04 but just as a sanity check, do you guys have zeroconf disabled maybe?
from pychromecast.
I am not sure how to check this.
But I am using an htpc (yaVDR with XBMC) and my nfs-shares are mounted via avahi.
I think it is like zeroconfig or uses it.
from pychromecast.
Avahi is the same, so that shouldn't be an issue then.
I have just pushed 2bee546 that should fix the discovery and make the example script work again, sorry about that.
I'll open a different issue for being unable to resolve the Chromecast hostname
from pychromecast.
Related Issues (20)
- ValueError: too many values to unpack (expected 5)
- Discovery doesn't work in an async context HOT 5
- Data difference when using GoogleTV Youtube vs Casting
- Custom http headers
- Idle chromecast custom screen example
- Command feedback
- Detect tv is on or off
- SiriusXM/Chromecast Casting Issue HOT 9
- Cannot initialize 'Chromecast' class HOT 2
- Not working with updated modules ('str' object has no attribute 'cast_type') HOT 1
- How to know if a specific connected TV is compatible ? HOT 1
- BBC Sounds conroller stopped working HOT 3
- Python 3.10 Depreciation Warning ssl.SSLContext()
- How to work with spotify HOT 5
- BBC iPlayer Live Stream - unable to get working
- Join existing chromecast session without interrupting it?
- pychromecast entering spin loop when a cast device reboots [if browser.stop_discovery() was called] HOT 2
- Mocking Chromecast?
- How to handle AssertionError for assert self.socket is not None?
- WARNING:pychromecast.controllers:SEEK command requested but no session is active HOT 8
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 pychromecast.