Hello community,
here is the log from the commit of package python-PyChromecast for
openSUSE:Factory checked in at 2020-05-28 09:14:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-PyChromecast (Old)
and /work/SRC/openSUSE:Factory/.python-PyChromecast.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-PyChromecast"
Thu May 28 09:14:17 2020 rev:11 rq:809126 version:5.2.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-PyChromecast/python-PyChromecast.changes
2020-05-05 18:56:21.209537138 +0200
+++
/work/SRC/openSUSE:Factory/.python-PyChromecast.new.3606/python-PyChromecast.changes
2020-05-28 09:14:47.628692005 +0200
@@ -1,0 +2,10 @@
+Wed May 27 05:35:16 UTC 2020 - Steve Kowalik <[email protected]>
+
+- Update to 5.3.0:
+ * Handle zeroconf update_service (#364)
+ * Add ability to pass in a zeroconf instance to discovery (#362)
+ * Add discovery example (#361)
+ * Quick play & Support for Yle Areena, Supla (#359)
+ * Log as info, not warning if connection re-established. (#358)
+
+-------------------------------------------------------------------
Old:
----
PyChromecast-5.0.0.tar.gz
New:
----
PyChromecast-5.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-PyChromecast.spec ++++++
--- /var/tmp/diff_new_pack.G2KSb1/_old 2020-05-28 09:14:50.256692720 +0200
+++ /var/tmp/diff_new_pack.G2KSb1/_new 2020-05-28 09:14:50.260692721 +0200
@@ -19,11 +19,10 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-PyChromecast
-Version: 5.0.0
+Version: 5.2.0
Release: 0
Summary: Python module to talk to Google Chromecast
License: MIT
-Group: Development/Languages/Python
URL: https://github.com/balloob/pychromecast
Source:
https://files.pythonhosted.org/packages/source/P/PyChromecast/PyChromecast-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
++++++ PyChromecast-5.0.0.tar.gz -> PyChromecast-5.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyChromecast-5.0.0/PKG-INFO
new/PyChromecast-5.2.0/PKG-INFO
--- old/PyChromecast-5.0.0/PKG-INFO 2020-04-20 17:28:40.250786500 +0200
+++ new/PyChromecast-5.2.0/PKG-INFO 2020-05-13 17:29:31.962354000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: PyChromecast
-Version: 5.0.0
+Version: 5.2.0
Summary: Python module to talk to Google Chromecast.
Home-page: https://github.com/balloob/pychromecast
Author: Paulus Schoutsen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyChromecast-5.0.0/PyChromecast.egg-info/PKG-INFO
new/PyChromecast-5.2.0/PyChromecast.egg-info/PKG-INFO
--- old/PyChromecast-5.0.0/PyChromecast.egg-info/PKG-INFO 2020-04-20
17:28:40.000000000 +0200
+++ new/PyChromecast-5.2.0/PyChromecast.egg-info/PKG-INFO 2020-05-13
17:29:31.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: PyChromecast
-Version: 5.0.0
+Version: 5.2.0
Summary: Python module to talk to Google Chromecast.
Home-page: https://github.com/balloob/pychromecast
Author: Paulus Schoutsen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyChromecast-5.0.0/PyChromecast.egg-info/SOURCES.txt
new/PyChromecast-5.2.0/PyChromecast.egg-info/SOURCES.txt
--- old/PyChromecast-5.0.0/PyChromecast.egg-info/SOURCES.txt 2020-04-20
17:28:40.000000000 +0200
+++ new/PyChromecast-5.2.0/PyChromecast.egg-info/SOURCES.txt 2020-05-13
17:29:31.000000000 +0200
@@ -19,6 +19,7 @@
pychromecast/discovery.py
pychromecast/error.py
pychromecast/logging_pb2.py
+pychromecast/quick_play.py
pychromecast/socket_client.py
pychromecast/controllers/__init__.py
pychromecast/controllers/dashcast.py
@@ -27,4 +28,6 @@
pychromecast/controllers/multizone.py
pychromecast/controllers/plex.py
pychromecast/controllers/spotify.py
+pychromecast/controllers/supla.py
+pychromecast/controllers/yleareena.py
pychromecast/controllers/youtube.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyChromecast-5.0.0/pychromecast/config.py
new/PyChromecast-5.2.0/pychromecast/config.py
--- old/PyChromecast-5.0.0/pychromecast/config.py 2020-04-20
17:28:34.000000000 +0200
+++ new/PyChromecast-5.2.0/pychromecast/config.py 2020-05-13
17:29:15.000000000 +0200
@@ -12,6 +12,8 @@
APP_DASHCAST = "84912283"
APP_SPOTIFY = "CC32E753"
APP_HOME_ASSISTANT = "B12CE3CA"
+APP_SUPLA = "A41B766D"
+APP_YLEAREENA = "A9BCCB7C"
def get_possible_app_ids():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyChromecast-5.0.0/pychromecast/controllers/supla.py
new/PyChromecast-5.2.0/pychromecast/controllers/supla.py
--- old/PyChromecast-5.0.0/pychromecast/controllers/supla.py 1970-01-01
01:00:00.000000000 +0100
+++ new/PyChromecast-5.2.0/pychromecast/controllers/supla.py 2020-05-13
17:29:15.000000000 +0200
@@ -0,0 +1,50 @@
+"""
+Controller to interface with Supla.
+"""
+import logging
+
+from . import BaseController
+from ..config import APP_SUPLA
+
+APP_NAMESPACE = "urn:x-cast:fi.ruutu.chromecast"
+
+
+# pylint: disable=too-many-instance-attributes
+class SuplaController(BaseController):
+ """ Controller to interact with Supla namespace. """
+
+ # pylint: disable=useless-super-delegation
+ # The pylint rule useless-super-delegation doesn't realize
+ # we are setting default values here.
+ def __init__(self):
+ super(SuplaController, self).__init__(APP_NAMESPACE, APP_SUPLA)
+
+ self.logger = logging.getLogger(__name__)
+
+ # pylint: enable=useless-super-delegation
+
+ def play_media(self, media_id, is_live=False):
+ """
+ Play Supla media
+ """
+ msg = {
+ "type": "load",
+ "mediaId": media_id,
+ "currentTime": 0,
+ "isLive": is_live,
+ "isAtLiveMoment": False,
+ "bookToken": "",
+ "sample": True,
+ "fw_site": "Supla",
+ "Sanoma_adkv": "",
+ "prerollAdsPlayed": True,
+ "supla": True,
+ "nextInSequenceList": 0,
+ "playbackRate": 1,
+ "env": "prod",
+ }
+ self.send_message(msg, inc_session_id=True)
+
+ def quick_play(self, media_id=None, is_live=False, **kwargs):
+ """ Quick Play """
+ self.play_media(media_id, is_live=is_live, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/PyChromecast-5.0.0/pychromecast/controllers/yleareena.py
new/PyChromecast-5.2.0/pychromecast/controllers/yleareena.py
--- old/PyChromecast-5.0.0/pychromecast/controllers/yleareena.py
1970-01-01 01:00:00.000000000 +0100
+++ new/PyChromecast-5.2.0/pychromecast/controllers/yleareena.py
2020-05-13 17:29:15.000000000 +0200
@@ -0,0 +1,61 @@
+"""
+Controller to interface with the Yle Areena app namespace.
+"""
+
+from ..config import APP_YLEAREENA
+from .media import MediaController, STREAM_TYPE_BUFFERED, TYPE_LOAD,
MESSAGE_TYPE
+
+
+class YleAreenaController(MediaController):
+ """ Controller to interact with Yle Areena app namespace. """
+
+ # pylint: disable=useless-super-delegation
+ def __init__(self):
+ super(YleAreenaController, self).__init__()
+ self.app_id = APP_YLEAREENA
+ self.supporting_app_id = APP_YLEAREENA
+
+ def play_areena_media(
+ self,
+ kaltura_id,
+ audio_language="",
+ text_language="off",
+ current_time=0,
+ autoplay=True,
+ stream_type=STREAM_TYPE_BUFFERED,
+ ):
+ """
+ Play media with the entry id "kaltura_id".
+ This value can be found by loading a page on Areena, e.g.
https://areena.yle.fi/1-50097921
+ And finding the kaltura player which has an id of
yle-kaltura-player3430579305188-29-0_whwjqpry
+ In this case the kaltura id is 0_whwjqpry
+ """
+ # pylint: disable=too-many-locals
+ msg = {
+ "media": {
+ "streamType": stream_type,
+ "customData": {
+ "mediaInfo": {"entryId": kaltura_id},
+ "audioLanguage": audio_language,
+ "textLanguage": text_language,
+ },
+ },
+ MESSAGE_TYPE: TYPE_LOAD,
+ "currentTime": current_time,
+ "autoplay": autoplay,
+ "customData": {},
+ "textTrackStyle": {
+ "foregroundColor": "#FFFFFFFF",
+ "backgroundColor": "#000000FF",
+ "fontScale": 1,
+ "fontFamily": "sans-serif",
+ },
+ }
+
+ self.send_message(msg, inc_session_id=True)
+
+ def quick_play(self, media_id=None, audio_lang="", text_lang="off",
**kwargs):
+ """ Quick Play """
+ self.play_areena_media(
+ media_id, audio_language=audio_lang, text_language=text_lang,
**kwargs
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/PyChromecast-5.0.0/pychromecast/controllers/youtube.py
new/PyChromecast-5.2.0/pychromecast/controllers/youtube.py
--- old/PyChromecast-5.0.0/pychromecast/controllers/youtube.py 2020-04-20
17:28:34.000000000 +0200
+++ new/PyChromecast-5.2.0/pychromecast/controllers/youtube.py 2020-05-13
17:29:15.000000000 +0200
@@ -101,3 +101,10 @@
""" Process latest status update. """
self._screen_id = status.get(ATTR_SCREEN_ID)
self.status_update_event.set()
+
+ def quick_play(self, media_id=None, playlist_id=None, enqueue=False,
**kwargs):
+ """ Quick Play """
+ if enqueue:
+ self.add_to_queue(media_id, **kwargs)
+ else:
+ self.play_video(media_id, playlist_id=playlist_id, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyChromecast-5.0.0/pychromecast/discovery.py
new/PyChromecast-5.2.0/pychromecast/discovery.py
--- old/PyChromecast-5.0.0/pychromecast/discovery.py 2020-04-20
17:28:34.000000000 +0200
+++ new/PyChromecast-5.2.0/pychromecast/discovery.py 2020-05-13
17:29:15.000000000 +0200
@@ -84,7 +84,7 @@
self.add_callback(name)
-def start_discovery(add_callback=None, remove_callback=None):
+def start_discovery(add_callback=None, remove_callback=None,
zeroconf_instance=None):
"""
Start discovering chromecasts on the network.
@@ -97,12 +97,17 @@
object. The CastListener object will contain information for the discovered
chromecasts. To stop discovery, call the stop_discovery method with the
ServiceBrowser object.
+
+ A shared zeroconf instance can be passed as zeroconf_instance. If no
+ instance is passed, a new instance will be created.
"""
listener = CastListener(add_callback, remove_callback)
service_browser = False
try:
service_browser = zeroconf.ServiceBrowser(
- zeroconf.Zeroconf(), "_googlecast._tcp.local.", listener
+ zeroconf_instance or zeroconf.Zeroconf(),
+ "_googlecast._tcp.local.",
+ listener,
)
except (
zeroconf.BadTypeInNameException,
@@ -118,6 +123,7 @@
def stop_discovery(browser):
"""Stop the chromecast discovery thread."""
+ browser.cancel()
browser.zc.close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyChromecast-5.0.0/pychromecast/quick_play.py
new/PyChromecast-5.2.0/pychromecast/quick_play.py
--- old/PyChromecast-5.0.0/pychromecast/quick_play.py 1970-01-01
01:00:00.000000000 +0100
+++ new/PyChromecast-5.2.0/pychromecast/quick_play.py 2020-05-13
17:29:15.000000000 +0200
@@ -0,0 +1,55 @@
+""" Choose a controller and quick play """
+
+from .controllers.youtube import YouTubeController
+from .controllers.supla import SuplaController
+from .controllers.yleareena import YleAreenaController
+
+
+def quick_play(cast, app_name, data):
+ """
+ Given a Chromecast connection, launch the app `app_name` and start
playing media
+ based on parameters defined in `data`.
+
+ :param cast: Chromecast connection to cast to
+ :param app_name: App name "slug" to cast
+ :param data: Data to send to the app controller. Must contain
"media_id", and other
+ values can be passed depending on the controller.
+ :type cast: Chromecast
+ :type app_name: string
+ :type data: dict
+
+ `data` can contain the following keys:
+ media_id: string (Required)
+ Primary identifier of the media
+ media_type: string
+ Type of the media identified by `media_id`. e.g. "program" if
the media is a
+ program name instead of a direct item id.
+ enqueue: boolean
+ Enqueue the media to the current playlist, if possible.
+ index: string
+ Play index x of matching media. "random" should also be
allowed.
+ audio_lang: string
+ Audio language (3 characters for YleAreena)
+ text_lang: string
+ Subtitle language (3 characters for YleAreena)
+
+ Youtube-specific:
+ playlist_id: string
+ Youtube playlist id
+
+ Supla-specific:
+ is_live: boolean
+ Whether the media is a livestream
+ """
+
+ if app_name == "youtube":
+ controller = YouTubeController()
+ elif app_name == "supla":
+ controller = SuplaController()
+ elif app_name == "yleareena":
+ controller = YleAreenaController()
+ else:
+ raise NotImplementedError()
+
+ cast.register_handler(controller)
+ controller.quick_play(**data)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyChromecast-5.0.0/pychromecast/socket_client.py
new/PyChromecast-5.2.0/pychromecast/socket_client.py
--- old/PyChromecast-5.0.0/pychromecast/socket_client.py 2020-04-20
17:28:34.000000000 +0200
+++ new/PyChromecast-5.2.0/pychromecast/socket_client.py 2020-05-13
17:29:15.000000000 +0200
@@ -370,7 +370,7 @@
self.port,
)
else:
- self.logger.warning(
+ self.logger.info(
"[%s(%s):%s] Connection reestablished!",
self.fn or "",
self.host,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyChromecast-5.0.0/setup.py
new/PyChromecast-5.2.0/setup.py
--- old/PyChromecast-5.0.0/setup.py 2020-04-20 17:28:34.000000000 +0200
+++ new/PyChromecast-5.2.0/setup.py 2020-05-13 17:29:15.000000000 +0200
@@ -5,7 +5,7 @@
setup(
name="PyChromecast",
- version="5.0.0",
+ version="5.2.0",
license="MIT",
url="https://github.com/balloob/pychromecast",
author="Paulus Schoutsen",