check for auth cookie

Authored by: bashonly
This commit is contained in:
bashonly 2025-04-28 15:40:23 -05:00
parent 5333967dd9
commit a795c9eb4a
No known key found for this signature in database
GPG Key ID: 783F096F253D15B0

View File

@ -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<id>[\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)