Skip to content

Commit

Permalink
fix live / stream / channel_image not working in some regions (#35)
Browse files Browse the repository at this point in the history
send cookie data to curcumvent YouTube's GDPR cookie consent screen.
Note that we are still NOT storing any returned cookie data
  • Loading branch information
pinkywafer committed May 5, 2021
1 parent eb80843 commit a4746a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/youtube/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ async def is_live(url, name, hass, session):
stream = False
try:
async with async_timeout.timeout(10, loop=hass.loop):
response = await session.get(url)
response = await session.get(url, cookies=dict(CONSENT="YES+cb"))
info = await response.text()
if 'isLiveBroadcast' in info:
stream = True
Expand All @@ -153,7 +153,7 @@ async def is_channel_live(url, name, hass, session):
live = False
try:
async with async_timeout.timeout(10, loop=hass.loop):
response = await session.get(url)
response = await session.get(url, cookies=dict(CONSENT="YES+cb"))
info = await response.text()
if '{"iconType":"LIVE"}' in info:
live = True
Expand Down

0 comments on commit a4746a8

Please sign in to comment.