1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-22 15:57:23 +00:00

- formatting

This commit is contained in:
Hugo Alves De Azevedo 2020-08-28 14:25:37 -03:00
parent 2adf91f94f
commit 39672cdc79

View file

@ -30,17 +30,14 @@ class AluraIE(InfoExtractor):
'ext': 'mp4', 'ext': 'mp4',
'title': 'Referências, ref-set e alter' 'title': 'Referências, ref-set e alter'
}, },
'skip': 'Requires alura account credentials', 'skip': 'Requires alura account credentials'},
},
{ {
# URL without video # URL without video
'url': 'https://cursos.alura.com.br/course/clojure-mutabilidade-com-atoms-e-refs/task/60098', 'url': 'https://cursos.alura.com.br/course/clojure-mutabilidade-com-atoms-e-refs/task/60098',
'only_matching': True, 'only_matching': True},
},
{ {
'url': 'https://cursos.alura.com.br/course/fundamentos-market-digital/task/55219', 'url': 'https://cursos.alura.com.br/course/fundamentos-market-digital/task/55219',
'only_matching': True, 'only_matching': True}
}
] ]
def _real_extract(self, url): def _real_extract(self, url):
@ -152,9 +149,21 @@ class AluraCourseIE(AluraIE):
page_url = urljoin(url, path) page_url = urljoin(url, path)
section_path = self._download_webpage(page_url, course_path) section_path = self._download_webpage(page_url, course_path)
for path_video in re.findall(r'<a\b(?=[^>]* class="[^"]*(?<=[" ])task-menu-nav-item-link-VIDEO[" ])(?=[^>]* href="([^"]*))', section_path): for path_video in re.findall(r'<a\b(?=[^>]* class="[^"]*(?<=[" ])task-menu-nav-item-link-VIDEO[" ])(?=[^>]* href="([^"]*))', section_path):
chapter = clean_html(self._search_regex(r'<h3[^>]+class=(["\'])task-menu-section-title-text\1[^>]*>(?P<chapter>[^<]+)',section_path, 'chapter', group='chapter')) chapter = clean_html(
chapter_number = int_or_none(self._search_regex(r'<span[^>]+class=(["\'])task-menu-section-title-number[^>]*>(.*?)<strong>(?P<chapter_number>[^<]+)</strong>',section_path, 'chapter number', group='chapter_number')) self._search_regex(
r'<h3[^>]+class=(["\'])task-menu-section-title-text\1[^>]*>(?P<chapter>[^<]+)',
section_path,
'chapter',
group='chapter'))
chapter_number = int_or_none(
self._search_regex(
r'<span[^>]+class=(["\'])task-menu-section-title-number[^>]*>(.*?)<strong>(?P<chapter_number>[^<]+)</strong>',
section_path,
'chapter number',
group='chapter_number'))
video_url = urljoin(url, path_video) video_url = urljoin(url, path_video)
entry = { entry = {
'_type': 'url_transparent', '_type': 'url_transparent',
'id': self._match_id(video_url), 'id': self._match_id(video_url),