diff --git a/catt/cli.py b/catt/cli.py index f234b52..143d2a8 100644 --- a/catt/cli.py +++ b/catt/cli.py @@ -139,7 +139,7 @@ def cast(settings, video_url): @click.pass_obj def add(settings, video_url): cst, stream = setup_cast(settings["device"], video_url=video_url, prep="control") - if cst.name != "default" and cst.name != stream.extractor: + if (cst.name != "default" and cst.name != stream.extractor) or not stream.is_video: raise CattCliError("This url cannot be added to the queue.") cst.add(stream.video_id) diff --git a/catt/controllers.py b/catt/controllers.py index c8ede9a..6573aeb 100644 --- a/catt/controllers.py +++ b/catt/controllers.py @@ -109,7 +109,7 @@ def setup_cast(device_name, video_url=None, prep=None): def catch_namespace_error(func): """ Use this decorator for methods in CastController subclasses where the intended - action is dependant on the chromecast being in a particular state (such as not + action is dependent on the chromecast being in a particular state (such as not buffering). If the cc app is then interrupted while catt is waiting for this state, we fail in a nice way. """ @@ -217,7 +217,7 @@ def new_media_status(self, status): self.not_buffering.clear() -class CastController: +class CastController(object): def __init__(self, cast, name, app_id, prep=None): self._cast = cast self.name = name @@ -318,7 +318,7 @@ def status(self): echo("Remaining time: %s" % remaining) echo("State: %s" % status.player_state) - echo("Volume: %s" % round(self._cast.status.volume_level * 100)) + echo("Volume: %s" % int(round(self._cast.status.volume_level, 2) * 100)) def info(self): # Values in media_controller.status for the keys "volume_level" and "volume_muted" diff --git a/catt/stream_info.py b/catt/stream_info.py index f3aa5b9..bed8346 100644 --- a/catt/stream_info.py +++ b/catt/stream_info.py @@ -35,6 +35,9 @@ def __init__(self, video_url, model=None, host=None): else: self._ydl = youtube_dl.YoutubeDL({"quiet": True, "no_warnings": True}) self._preinfo = self._get_stream_preinfo(video_url) + # Some playlist urls needs to be re-processed (such as youtube channel urls). + if self._preinfo.get("ie_key"): + self._preinfo = self._get_stream_preinfo(self._preinfo["url"]) self.local_ip = None self.port = None self.is_local_file = False