feat: 영상 다운로드 플로우 개편#1
Merged
Merged
Conversation
cometj03
requested changes
May 21, 2026
Owner
cometj03
left a comment
There was a problem hiding this comment.
기여 감사합니다 🙌👍
정규식 부분만 고친다면 정상적으로 동작하는 것도 확인했습니다!
Owner
이 경우는 제가 아직 확인을 못했는데 따로 이슈로 올려주실 수 있을까요? |
cometj03
reviewed
May 21, 2026
| await chrome.tabs.sendMessage(tab.id, { target: 'video-iframe', type: 'trigger-autoplay' }); | ||
| } catch (e) { /* iframe missing — handled below */ } | ||
| const start = Date.now(); | ||
| while (Date.now() - start < 8000) { |
Contributor
Author
There was a problem hiding this comment.
첫 로딩 시 videoPlayer 초기화 + 첫 mp4 요청 발생까지의 시간과 네트워크 지연을 여유롭게 고려해서 8초로 잡았습니다.
Owner
There was a problem hiding this comment.
아하 알겠습니다.
그런데 해당 while 문이 끝날 때까지 아래 코드가 블록되어 있어서 그동안(약 8초 동안) 학습 진도 상황이 확인중...으로 뜨는 사소한 문제가 있네요.
병렬적으로 처리하는 등의 방법으로 해결할 수 있을 것 같은데, 이 PR에서는 넘어가고 다음에 고쳐도 될 것 같습니다.
Co-authored-by: Jung Haesung <harryjung1001@gmail.com>
Contributor
Author
이슈 올려서 해결할 수 있는 부분은 아니라고 판단됩니다. |
cometj03
approved these changes
May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
배경 / 문제
기존 다운로드 흐름은 다음 한계를 가지고 있었음.
영상 URL을 video element
src에서 읽음screen.mp4로 가정 → 실제로는main_(uuid).mp4등 다양ssuin-object.commonscdn.com만 가정 → 실제로는ssu-toast.commonscdn.com등 다양chrome.downloads.download사용commons CDN이 Referer 검증 → extension에서 직접 fetch 시 403
변경
1. 영상 URL 캡처: video element src → background
chrome.webRequestbackground.js가*://*.commonscdn.com/*mp4 요청을 가로채tabId → URL로 캐싱/uniplayer/intro.mp4)와 본 컨텐츠(/media_files/*.mp4) URL 패턴으로 필터링get-captured-mp4메시지로 조회trigger-autoplay보내고 8초간 폴링파일명/호스트/플레이어 마크업에 무관하게 동작.
2. 다운로드:
chrome.downloads→showSaveFilePicker+ fetch 스트리밍showSaveFilePicker호출 (Chrome 다운로드 매니저 + SafeBrowsing 우회)fetch응답을FileSystemWritableFileStream으로 스트리밍하여 디스크에 직접 기록 (메모리 효율 + 정확한 파일명)3. Referer 우회
declarativeNetRequest로 commonscdn.com 요청에Referer: https://commons.ssu.ac.kr/강제 set4. 기타
autoPlayAttempted가드host_permissions의*://canvas.ssu.ac.kr/→*://canvas.ssu.ac.kr/*보정 (webRequest 매칭용)알려진 한계
Test plan