v1.6.3 프록시 기능을 사용해도 국가차단 우회가 안 되는 문제 수정
This commit is contained in:
@@ -131,6 +131,9 @@ API에선 직접 비트레이트를 설정할 수 있습니다.
|
||||
물론 해당 정보가 없으면 null입니다.
|
||||
|
||||
## Changelog
|
||||
v1.6.3
|
||||
* 프록시 기능을 사용해도 국가차단 우회가 안 되는 문제 수정
|
||||
|
||||
v1.6.2
|
||||
|
||||
v1.6.1
|
||||
|
||||
@@ -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"}
|
||||
{"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"}
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user