v1.6.2
This commit is contained in:
@@ -131,10 +131,12 @@ API에선 직접 비트레이트를 설정할 수 있습니다.
|
|||||||
물론 해당 정보가 없으면 null입니다.
|
물론 해당 정보가 없으면 null입니다.
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
v1.6.2
|
||||||
|
|
||||||
v1.6.1
|
v1.6.1
|
||||||
|
|
||||||
v1.6.0
|
v1.6.0
|
||||||
* API에 format_code를 format로 변경
|
* API에 format_code를 format으로 변경
|
||||||
* API에 temp_path 삭제
|
* API에 temp_path 삭제
|
||||||
|
|
||||||
v1.5.1
|
v1.5.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.1", "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.2", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"}
|
||||||
@@ -43,7 +43,11 @@ class Youtube_dl(object):
|
|||||||
_index = 0
|
_index = 0
|
||||||
_last_msg = ''
|
_last_msg = ''
|
||||||
|
|
||||||
def __init__(self, plugin, url, filename, temp_path, save_path, opts):
|
def __init__(self, plugin, url, filename, temp_path, save_path=None, opts=None):
|
||||||
|
if save_path is None:
|
||||||
|
save_path = temp_path
|
||||||
|
if opts is None:
|
||||||
|
opts = {}
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.url = url
|
self.url = url
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
@@ -108,14 +112,7 @@ class Youtube_dl(object):
|
|||||||
'ignoreerrors': True,
|
'ignoreerrors': True,
|
||||||
'cachedir': False
|
'cachedir': False
|
||||||
}
|
}
|
||||||
if self.opts.get('format'):
|
ydl_opts.update(self.opts)
|
||||||
ydl_opts['format'] = self.opts['format']
|
|
||||||
if self.opts.get('postprocessors'):
|
|
||||||
ydl_opts['postprocessors'] = self.opts['postprocessors']
|
|
||||||
if self.opts.get('proxy'):
|
|
||||||
ydl_opts['proxy'] = self.opts['proxy']
|
|
||||||
if self.opts.get('download_archive'):
|
|
||||||
ydl_opts['download_archive'] = self.opts['download_archive']
|
|
||||||
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
||||||
ydl.download([self.url])
|
ydl.download([self.url])
|
||||||
if self.status == Status.FINISHED: # 다운로드 성공
|
if self.status == Status.FINISHED: # 다운로드 성공
|
||||||
|
|||||||
39
plugin.py
39
plugin.py
@@ -34,7 +34,7 @@ menu = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugin_info = {
|
plugin_info = {
|
||||||
'version': '1.6.1',
|
'version': '1.6.2',
|
||||||
'name': 'youtube-dl',
|
'name': 'youtube-dl',
|
||||||
'category_name': 'vod',
|
'category_name': 'vod',
|
||||||
'developer': 'joyfuI',
|
'developer': 'joyfuI',
|
||||||
@@ -105,25 +105,26 @@ def ajax(sub):
|
|||||||
filename = request.form['filename']
|
filename = request.form['filename']
|
||||||
temp_path = ModelSetting.get('temp_path')
|
temp_path = ModelSetting.get('temp_path')
|
||||||
save_path = ModelSetting.get('save_path')
|
save_path = ModelSetting.get('save_path')
|
||||||
format = request.form['format'] if request.form['format'] else None
|
format_code = request.form['format']
|
||||||
postprocessor = request.form['postprocessor'] if request.form['postprocessor'] else None
|
postprocessor = request.form['postprocessor']
|
||||||
|
proxy = ModelSetting.get('proxy')
|
||||||
|
opts = {}
|
||||||
|
if format_code:
|
||||||
|
opts['format'] = format_code
|
||||||
video_convertor, extract_audio = LogicNormal.get_postprocessor()
|
video_convertor, extract_audio = LogicNormal.get_postprocessor()
|
||||||
if postprocessor in video_convertor:
|
if postprocessor in video_convertor:
|
||||||
postprocessor = [{
|
opts['postprocessors'] = [{
|
||||||
'key': 'FFmpegVideoConvertor',
|
'key': 'FFmpegVideoConvertor',
|
||||||
'preferedformat': postprocessor
|
'preferedformat': postprocessor
|
||||||
}]
|
}]
|
||||||
elif postprocessor in extract_audio:
|
elif postprocessor in extract_audio:
|
||||||
postprocessor = [{
|
opts['postprocessors'] = [{
|
||||||
'key': 'FFmpegExtractAudio',
|
'key': 'FFmpegExtractAudio',
|
||||||
'preferredcodec': postprocessor,
|
'preferredcodec': postprocessor,
|
||||||
'preferredquality': '192'
|
'preferredquality': '192'
|
||||||
}]
|
}]
|
||||||
opts = {
|
if proxy:
|
||||||
'format': format,
|
opts['proxy'] = proxy
|
||||||
'postprocessors': postprocessor,
|
|
||||||
'proxy': ModelSetting.get('proxy')
|
|
||||||
}
|
|
||||||
youtube_dl = Youtube_dl(package_name, url, filename, temp_path, save_path, opts)
|
youtube_dl = Youtube_dl(package_name, url, filename, temp_path, save_path, opts)
|
||||||
LogicNormal.youtube_dl_list.append(youtube_dl) # 리스트 추가
|
LogicNormal.youtube_dl_list.append(youtube_dl) # 리스트 추가
|
||||||
youtube_dl.start()
|
youtube_dl.start()
|
||||||
@@ -181,7 +182,7 @@ def api(sub):
|
|||||||
url = request.form.get('url')
|
url = request.form.get('url')
|
||||||
filename = request.form.get('filename', ModelSetting.get('default_filename'))
|
filename = request.form.get('filename', ModelSetting.get('default_filename'))
|
||||||
save_path = request.form.get('save_path', ModelSetting.get('save_path'))
|
save_path = request.form.get('save_path', ModelSetting.get('save_path'))
|
||||||
format = request.form.get('format', None)
|
format_code = request.form.get('format', None)
|
||||||
preferedformat = request.form.get('preferedformat', None)
|
preferedformat = request.form.get('preferedformat', None)
|
||||||
preferredcodec = request.form.get('preferredcodec', None)
|
preferredcodec = request.form.get('preferredcodec', None)
|
||||||
preferredquality = request.form.get('preferredquality', 192)
|
preferredquality = request.form.get('preferredquality', 192)
|
||||||
@@ -195,6 +196,9 @@ def api(sub):
|
|||||||
return LogicNormal.abort(ret, 1) # 필수 요청 변수가 없음
|
return LogicNormal.abort(ret, 1) # 필수 요청 변수가 없음
|
||||||
if not url.startswith('http'):
|
if not url.startswith('http'):
|
||||||
return LogicNormal.abort(ret, 2) # 잘못된 동영상 주소
|
return LogicNormal.abort(ret, 2) # 잘못된 동영상 주소
|
||||||
|
opts = {}
|
||||||
|
if format_code is not None:
|
||||||
|
opts['format'] = format_code
|
||||||
postprocessor = []
|
postprocessor = []
|
||||||
if preferedformat is not None:
|
if preferedformat is not None:
|
||||||
postprocessor.append({
|
postprocessor.append({
|
||||||
@@ -209,12 +213,13 @@ def api(sub):
|
|||||||
'preferredcodec': preferredcodec,
|
'preferredcodec': preferredcodec,
|
||||||
'preferredquality': str(preferredquality)
|
'preferredquality': str(preferredquality)
|
||||||
})
|
})
|
||||||
opts = {
|
if postprocessor:
|
||||||
'format': format,
|
opts['postprocessors'] = postprocessor
|
||||||
'postprocessors': postprocessor,
|
proxy = ModelSetting.get('proxy')
|
||||||
'proxy': ModelSetting.get('proxy'),
|
if proxy:
|
||||||
'download_archive': archive
|
opts['proxy'] = proxy
|
||||||
}
|
if archive is not None:
|
||||||
|
opts['download_archive'] = archive
|
||||||
youtube_dl = Youtube_dl(plugin, url, filename, ModelSetting.get('temp_path'), save_path, opts)
|
youtube_dl = Youtube_dl(plugin, url, filename, ModelSetting.get('temp_path'), save_path, opts)
|
||||||
youtube_dl.key = key
|
youtube_dl.key = key
|
||||||
LogicNormal.youtube_dl_list.append(youtube_dl) # 리스트 추가
|
LogicNormal.youtube_dl_list.append(youtube_dl) # 리스트 추가
|
||||||
|
|||||||
Reference in New Issue
Block a user