Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Resolvido bug parse de nexo em videos não embed UNILAB
Browse files Browse the repository at this point in the history
  • Loading branch information
Diassisfilho committed Jan 17, 2024
1 parent c6b7679 commit 11019a1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/courses/sigaa-lesson-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,15 @@ export class SigaaLessonParser implements LessonParser {
title = title.replace(/\(Link Externo\)$/g, '');
src = href;
} else {
const titleElement = page
.$(attachmentElement)
.find('span[id] > span[id]');
let titleElement = page.$(attachmentElement).find('span[id] > span[id]');
if (!titleElement) {
titleElement = page.$(attachmentElement).find('span[id] > span[id] h1');
}
title = this.parser.removeTagsHtml(titleElement.html());
const srcIframe = page.$(attachmentElement).find('iframe').attr('src');
let srcIframe = page.$(attachmentElement).find('iframe').attr('src');
if (!srcIframe) {
srcIframe = page.$(attachmentElement).find('embed').attr('src');
}
if (!srcIframe) throw new Error('SIGAA: Video iframe without url.');
src = srcIframe;
}
Expand Down

0 comments on commit 11019a1

Please sign in to comment.