From ecb4ed12b1f220a616272052ba3bc6734b4f764a Mon Sep 17 00:00:00 2001 From: joyfuI Date: Thu, 9 Jul 2020 23:59:38 +0900 Subject: [PATCH] =?UTF-8?q?v1.6.3=20=ED=94=84=EB=A1=9D=EC=8B=9C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=EC=9D=84=20=EC=82=AC=EC=9A=A9=ED=95=B4?= =?UTF-8?q?=EB=8F=84=20=EA=B5=AD=EA=B0=80=EC=B0=A8=EB=8B=A8=20=EC=9A=B0?= =?UTF-8?q?=ED=9A=8C=EA=B0=80=20=EC=95=88=20=EB=90=98=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ info.json | 2 +- my_youtube_dl.py | 6 ++++-- plugin.py | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) 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