Skip to content

Commit afbadf2

Browse files
committed
[youtube] update self.ua (fix extraction)
1 parent 4cec20a commit afbadf2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/you_get/extractors/youtube.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def check_playability_response(self, ytInitialPlayerResponse):
186186
)
187187

188188
def prepare(self, **kwargs):
189-
self.ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.2651.86'
189+
self.ua = 'Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.103 Mobile Safari/537.36'
190190

191191
assert self.url or self.vid
192192

@@ -202,7 +202,7 @@ def prepare(self, **kwargs):
202202

203203
# Extract from video page
204204
logging.debug('Extracting from the video page...')
205-
video_page = get_content('https://www.youtube.com/watch?v=%s' % self.vid)
205+
video_page = get_content('https://www.youtube.com/watch?v=%s' % self.vid, headers={'User-Agent': self.ua})
206206

207207
try:
208208
jsUrl = re.search('([^"]*/base\.js)"', video_page).group(1)

0 commit comments

Comments
 (0)