[ie/createacademy] regex fixes

This commit is contained in:
Greg Rotter 2024-12-18 16:19:19 -08:00
parent a8ab7708ef
commit 7362372a41
2 changed files with 6 additions and 6 deletions

View file

@ -435,8 +435,8 @@ from .cracked import CrackedIE
from .crackle import CrackleIE from .crackle import CrackleIE
from .craftsy import CraftsyIE from .craftsy import CraftsyIE
from .createacademy import ( from .createacademy import (
CreateAcademyBaseIE,
CreateAcademyCourseIE, CreateAcademyCourseIE,
CreateAcademyIE,
) )
from .crooksandliars import CrooksAndLiarsIE from .crooksandliars import CrooksAndLiarsIE
from .crowdbunker import ( from .crowdbunker import (

View file

@ -9,7 +9,7 @@ from ..utils import (
) )
class CreateAcademyBaseIE(InfoExtractor): class CreateAcademyIE(InfoExtractor):
_VALID_URL = r'https://www.createacademy.com/(?:[^/]+/)*lessons/(?P<id>[^/?#]+)' _VALID_URL = r'https://www.createacademy.com/(?:[^/]+/)*lessons/(?P<id>[^/?#]+)'
_TESTS = [ _TESTS = [
@ -83,7 +83,7 @@ class CreateAcademyBaseIE(InfoExtractor):
return json.loads(attributes.get('data-page')) return json.loads(attributes.get('data-page'))
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = url.split('/')[-1]
data = self._get_page_data(url, video_id) data = self._get_page_data(url, video_id)
lesson = traverse_obj(data, ('props', 'lesson')) lesson = traverse_obj(data, ('props', 'lesson'))
@ -115,8 +115,8 @@ class CreateAcademyBaseIE(InfoExtractor):
} }
class CreateAcademyCourseIE(CreateAcademyBaseIE): class CreateAcademyCourseIE(CreateAcademyIE):
_VALID_URL = r'https://www.createacademy.com/courses/(?P<id>[^/?#]+)' _VALID_URL = r'https://www.createacademy.com/courses/(?!.*\/lessons\/)(?P<id>[^/?#]+)'
_TESTS = [ _TESTS = [
{ {
@ -129,7 +129,7 @@ class CreateAcademyCourseIE(CreateAcademyBaseIE):
'chapter_number': 1, 'chapter_number': 1,
'thumbnail': 'https://cf-images.eu-west-1.prod.boltdns.net/v1/static/6222962662001/22f75006-c49f-4d95-8673-1b60df4223d2/45d953e0-fa58-4cb6-9217-1c7b3c80c932/1280x720/match/image.jpg', 'thumbnail': 'https://cf-images.eu-west-1.prod.boltdns.net/v1/static/6222962662001/22f75006-c49f-4d95-8673-1b60df4223d2/45d953e0-fa58-4cb6-9217-1c7b3c80c932/1280x720/match/image.jpg',
'title': 'Create Academy - s10e01 - Meet Dan', 'title': 'Create Academy - s10e01 - Meet Dan',
'display_id': 'dan-pearson', 'display_id': 'meet-dan',
'chapter': 'Introduction', 'chapter': 'Introduction',
}, },
}, },