diff --git a/README.md b/README.md index c758cd0..67ffc99 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,9 @@ API에선 직접 비트레이트를 설정할 수 있습니다. 물론 해당 정보가 없으면 null입니다. ## Changelog +v1.6.3 +* 프록시 기능을 사용해도 국가차단 우회가 안 되는 문제 수정 + v1.6.2 v1.6.1 diff --git a/info.json b/info.json index 73632d0..23243fe 100644 --- a/info.json +++ b/info.json @@ -1 +1 @@ -{"description": "\uc720\ud29c\ube0c, \ub124\uc774\ubc84TV \ub4f1 \ub3d9\uc601\uc0c1 \uc0ac\uc774\ud2b8\uc5d0\uc11c \ub3d9\uc601\uc0c1 \ub2e4\uc6b4\ub85c\ub4dc", "name": "youtube-dl", "more": "", "version": "1.6.2", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"} \ No newline at end of file +{"description": "\uc720\ud29c\ube0c, \ub124\uc774\ubc84TV \ub4f1 \ub3d9\uc601\uc0c1 \uc0ac\uc774\ud2b8\uc5d0\uc11c \ub3d9\uc601\uc0c1 \ub2e4\uc6b4\ub85c\ub4dc", "name": "youtube-dl", "more": "", "version": "1.6.3", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"} \ No newline at end of file diff --git a/my_youtube_dl.py b/my_youtube_dl.py index 660d43b..5389754 100644 --- a/my_youtube_dl.py +++ b/my_youtube_dl.py @@ -96,7 +96,7 @@ class Youtube_dl(object): try: self.start_time = datetime.now() self.status = Status.START - info_dict = Youtube_dl.get_info_dict(self.url) # 동영상 정보 가져오기 + info_dict = Youtube_dl.get_info_dict(self.url, self.opts.get('proxy')) # 동영상 정보 가져오기 if info_dict is None: # 가져오기 실패 self.status = Status.ERROR return @@ -146,7 +146,7 @@ class Youtube_dl(object): return youtube_dl.version.__version__ @staticmethod - def get_info_dict(url): + def get_info_dict(url, proxy=None): import youtube_dl try: ydl_opts = { @@ -155,6 +155,8 @@ class Youtube_dl(object): 'extract_flat': 'in_playlist', 'logger': MyLogger() } + if proxy: + ydl_opts['proxy'] = proxy with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([url]) except Exception as e: diff --git a/plugin.py b/plugin.py index 0f4226d..1dcda60 100644 --- a/plugin.py +++ b/plugin.py @@ -34,7 +34,7 @@ menu = { } plugin_info = { - 'version': '1.6.2', + 'version': '1.6.3', 'name': 'youtube-dl', 'category_name': 'vod', 'developer': 'joyfuI', @@ -170,7 +170,7 @@ def api(sub): return LogicNormal.abort(ret, 1) # 필수 요청 변수가 없음 if not url.startswith('http'): return LogicNormal.abort(ret, 2) # 잘못된 동영상 주소 - info_dict = Youtube_dl.get_info_dict(url) + info_dict = Youtube_dl.get_info_dict(url, ModelSetting.get('proxy')) if info_dict is None: return LogicNormal.abort(ret, 10) # 실패 ret['info_dict'] = info_dict