diff --git a/youtube_dl/extractor/udemy.py b/youtube_dl/extractor/udemy.py index f2b2956da..dc572ac16 100644 --- a/youtube_dl/extractor/udemy.py +++ b/youtube_dl/extractor/udemy.py @@ -142,12 +142,10 @@ class UdemyIE(InfoExtractor): lecture_id = self._match_id(url) webpage = self._download_webpage(url, lecture_id) - try: - course_id = self._search_regex( - r'data-course-id=["\'](\d+)', webpage, 'course id') - except ExtractorError as e: - course_id = self._search_regex( - r'"id": (\d+)', webpage, 'course id') + + course_id = self._search_regex( + (r'data-course-id=["\'](\d+)', r'"id": (\d+)'), + webpage, 'course id') try: lecture = self._download_lecture(course_id, lecture_id)