nomomo / Naver-Cafe-Twitch-Clip-Loader

This user script allows you to view videos from external sites more conveniently in Naver Cafe / 네이버 카페에서 외부 비디오를 더 편하게 볼 수 있도록 해주는 UserScript
MIT License
13 stars 3 forks source link

[기능 요청] 아프리카TV VOD (다시보기, 클립) #3

Closed jebibot closed 1 year ago

jebibot commented 1 year ago

안녕하세요. 먼저 좋은 유저스크립트 개발해주셔서 감사드립니다. 굉장히 유용하게 쓰고 있습니다. 다름이 아니라, 아프리카TV VOD 기능 추가를 요청드립니다.

링크 형식은

/^https?:\/\/vod\.afreecatv.com\/player\/(\d+)\?(change_second=\d+)?/

이고, 다음과 같이 Open API를 통해 embed 주소를 가져올 수 있습니다.

curl -X POST \
    "https://openapi.afreecatv.com/vod/embedinfo" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Accept: */*" \
    -d 'vod_url=https://vod.afreecatv.com/player/71021072'

Embed 주소 형식은 //vod.afreecatv.com/player/71021072/embed?type=station&isAfreeca=false&autoPlay=false&showChat=true&mutePlay=false&szBjId=aflol&nStationNo=9691678&nBbsNo=18532080&nTitleNo=71021072&szCategory=00010000&szVodCategory=00040019&szPart=REVIEW&szVodType=STATION&nPlaylistIdx=0&isEmbedautoPlay=false&szSysType=html5으로 autoPlay, showChat, mutePlay 조절이 가능한 것으로 보입니다. 볼륨은 트위치 플레이어와 마찬가지로 localStorage.volume에서 가져오는 것으로 보입니다.

참고로 아프리카 로고 SVG는 https://github.com/jebibot/crsd/blob/main/src/logo/afreeca.svg 에서 확인하실 수 있습니다.

감사합니다.

nomomo commented 1 year ago

안녕하세요. 좋은 제안과 밥상 감사합니다. 떠먹기만 하면 될 정도로 잘 정리해주셨네요. 제안주신 의견을 반영한 개발 버전은 다음과 같습니다. 혹시 필요하시면 아래 링크의 것을 설치 후 테스트 해보시기 바랍니다. https://github.com/nomomo/Naver-Cafe-Twitch-Clip-Loader/raw/develop/Naver-Cafe-VOD-Loader.user.js

참고로 몇 가지 기능의 경우 스크립트가 https://vod.afreecatv.com/player/ 도메인에서도 동작할 수 있도록 스크립트의 meta tag 에 해당 도메인이 추가 되어야하는데, 이 경우 기존 사용자들은 보안상의 이유로 자동 업데이트 시 업데이트 할지를 묻는 확인 창이 나타납니다. 대부분의 사용자는 이러한 확인에 거부감이 있습니다.

이것을 감수하고 기존 스크립트에도 해당 도메인을 추가할지, 아니면 스크립트를 분리하여 신규 사용자에 대해서만 적용하도록 할지를 고민해봐야겠네요.

nomomo commented 1 year ago

기존 사용자에게도 meta tag 에 도메인을 추가하는 형태로 릴리즈에 병합되었습니다.