ur1katz / casttube

YouTube Chromecast API
MIT License
53 stars 10 forks source link

Support for authenticated sessions #6

Open rbclark opened 5 years ago

rbclark commented 5 years ago

First up, thank you for implementing this, it was immensely helpful for the problem I was trying to solve, which was to get Youtube TV working with chromecast. It turns out Youtube and Youtube TV use the exact same casting API. I only had to make 4 extremely minor changes and I was able to support casting to Youtube TV:

  1. Add a dict of cookies consisting of my youtube APISID, HSID, SAPISID, SID, SSID cookies. Very similar to https://github.com/yakyak/hangupsjs#cookies who are trying to do a similar thing (auth to a google service)
  2. Change the YOUTUBE_BASE_URL = "https://tv.youtube.com/".
  3. Add "theme": "up" to my BIND_DATA since the bind will fail with a theme error without it.
  4. Pass CURRENT_TIME=-1 to cause the video to always start at LIVE.

Is there any chance you would consider any of these changes as a PR? If so I'll need to most likely figure out a cleaner way to support grabbing the cookies for a better user experience.

ur1katz commented 5 years ago

Thanks for the PR! It looks simple enough, I left you some comments. When you find a clean way of grabbing cookies i think the best place for it is https://github.com/ur1katz/CastTube-Scripts