From a795c9eb4a80cf1f84b5916454e99c17fea4b0fd Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 28 Apr 2025 15:40:23 -0500 Subject: [PATCH] check for auth cookie Authored by: bashonly --- yt_dlp/extractor/linkedin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/linkedin.py b/yt_dlp/extractor/linkedin.py index 66e679762e..606d0b761b 100644 --- a/yt_dlp/extractor/linkedin.py +++ b/yt_dlp/extractor/linkedin.py @@ -274,7 +274,7 @@ class LinkedInLearningCourseIE(LinkedInLearningBaseIE): course_data.get('description')) -class LinkedInEventsIE(InfoExtractor): +class LinkedInEventsIE(LinkedInBaseIE): IE_NAME = 'linkedin:events' _VALID_URL = r'https?://(?:www\.)?linkedin\.com/events/(?P[\w-]+)' _TESTS = [{ @@ -307,6 +307,10 @@ class LinkedInEventsIE(InfoExtractor): }, }] + def _real_initialize(self): + if not self._get_cookies('https://www.linkedin.com/').get('li_at'): + self.raise_login_required() + def _real_extract(self, url): event_id = self._match_id(url) webpage = self._download_webpage(url, event_id)