CastTube

raw JSON →
0.2.1 verified Fri May 01 auth: no python

A Python library for interacting with the YouTube Chromecast API, providing methods to send videos to Chromecast devices. Currently at version 0.2.1, with sporadic maintenance.

pip install casttube
error ImportError: cannot import name 'YouTubeChromecast' from 'casttube'
cause Incorrect import statement or missing installation.
fix
Run pip install casttube and use from casttube import YouTubeChromecast.
error requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.youtube.com', port=443): Max retries exceeded
cause Network connectivity issues or YouTube blocking requests.
fix
Check internet connection, ensure YouTube is accessible, and consider rotating user-agent or IP if blocked.
gotcha The library requires a network connection to Google's YouTube APIs and may break if YouTube changes their internal endpoints.
fix Handle exceptions such as requests.exceptions.ConnectionError or ValueError in production code.
deprecated The project has not seen updates since 2020; consider alternatives like pytube or yt-dlp for more reliable YouTube interaction.
fix Evaluate if this library meets your needs or switch to actively maintained alternatives.

Initialize a YouTubeChromecast instance and obtain a watch key for a given video ID.

from casttube import YouTubeChromecast

ytc = YouTubeChromecast()
ytc.get_watch_key('dQw4w9WgXcQ')