Skip to content

Commit

Permalink
Merge pull request #153 from jaylinski/consent-fix
Browse files Browse the repository at this point in the history
Automatically consent to YouTube cookies
  • Loading branch information
anxdpanic authored Jun 19, 2021
2 parents 7ddd520 + b83c2a1 commit 9864dcb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion resources/lib/youtube_plugin/youtube/helper/video_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,14 @@ def get_watch_page(self, video_id):
'hl': self.language,
'gl': self.region}

cookies = {'CONSENT': 'YES+cb.20210615-14-p0.en+FX+294'}

if self._access_token:
params['access_token'] = self._access_token

url = 'https://www.youtube.com/watch'

result = requests.get(url, params=params, headers=headers, verify=self._verify, allow_redirects=True)
result = requests.get(url, params=params, headers=headers, cookies=cookies, verify=self._verify, allow_redirects=True)
return {'html': result.text, 'cookies': result.cookies}

def get_embed_page(self, video_id):
Expand Down

0 comments on commit 9864dcb

Please sign in to comment.