# Youtube-dl, 870라인 파이썬으로 만든 JS 인터프리터 코드 내장

> Clean Markdown view of GeekNews topic #7383. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=7383](https://news.hada.io/topic?id=7383)
- GeekNews Markdown: [https://news.hada.io/topic/7383.md](https://news.hada.io/topic/7383.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2022-09-13T09:21:59+09:00
- Updated: 2022-09-13T09:21:59+09:00
- Original source: [twitter.com/zhuowei](https://twitter.com/zhuowei/status/1568659229887664129)
- Points: 11
- Comments: 2

## Topic Body

- JS의 아주 작은 일부지만 효율적으로 파싱해서 실행하고 결과를 얻도록 지원   
- 유튜브 사이트에서 특정 JS틀 실행해야만 수행가능한 기능을, youtube-dl이 파이썬에서 빠르고 실행하고 결과를 얻기 위해 만든 코드

## Comments



### Comment 12262

- Author: joyfui
- Created: 2022-09-13T11:35:23+09:00
- Points: 1

하지만 마지막 릴리즈가 작년...

### Comment 12245

- Author: xguru
- Created: 2022-09-13T09:22:02+09:00
- Points: 2

실제 코드 링크 : https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/jsinterp.py  
  
어떤 표현들을 지원하는지는 테스트 코드를 보면 됩니다.  
https://github.com/ytdl-org/youtube-dl/blob/master/test/test_jsinterp.py  
  
파싱해야할 JS 코드들이 늘어난다면 아마도 코드가 더 늘어나겠지만 , 현재 수준에서는 아주 적절한 구현이라고 생각이 되네요.
