v1.2.2 youtube-dl 패키지 업그레이드도 로그 찍히도록 수정

This commit is contained in:
joyfuI
2020-02-15 16:27:18 +09:00
parent fa9356419c
commit 87d310900b
4 changed files with 13 additions and 7 deletions

View File

@@ -24,7 +24,7 @@ SJVA에서 "시스템 → 플러그인 → 플러그인 수동 설치" 칸에
#### 에러 코드 (errorCode)
* `0` - 성공. 문제없음
* `1` - 필수 요청 변수가 없음
* `2` - 잘못된 주소
* `2` - 잘못된 동영상 주소
* `3` - 인덱스 범위를 벗어남
* `4` - 키가 일치하지 않음
* `10` - 실패. 요청은 성공하였으나 실행 결과가 실패
@@ -124,6 +124,9 @@ SJVA에서 "시스템 → 플러그인 → 플러그인 수동 설치" 칸에
물론 해당 정보가 없으면 null입니다.
## Changelog
v1.2.2
* youtube-dl 패키지 업그레이드도 로그 찍히도록 수정
v1.2.1
v1.2.0

View File

@@ -1 +1 @@
{"more": "", "version": "1.2.1", "name": "youtube-dl", "developer": "joyfuI", "home": "https://github.com/joyfuI/youtube-dl", "description": "\uc720\ud29c\ube0c, \ub124\uc774\ubc84TV \ub4f1 \ub3d9\uc601\uc0c1 \uc0ac\uc774\ud2b8\uc5d0\uc11c \ub3d9\uc601\uc0c1 \ub2e4\uc6b4\ub85c\ub4dc", "icon": "", "category_name": "vod"}
{"more": "", "version": "1.2.2", "name": "youtube-dl", "developer": "joyfuI", "home": "https://github.com/joyfuI/youtube-dl", "description": "\uc720\ud29c\ube0c, \ub124\uc774\ubc84TV \ub4f1 \ub3d9\uc601\uc0c1 \uc0ac\uc774\ud2b8\uc5d0\uc11c \ub3d9\uc601\uc0c1 \ub2e4\uc6b4\ub85c\ub4dc", "icon": "", "category_name": "vod"}

View File

@@ -2,6 +2,7 @@
#########################################################
# python
import os
import subprocess
import traceback
import platform
from datetime import datetime
@@ -44,10 +45,12 @@ class Logic(object):
Logic.db_init() # DB 초기화
# youtube-dl 업데이트
logger.debug('youtube-dl upgrade')
if platform.system() == 'Windows': # 윈도우일 때
os.system('pip.exe install --upgrade youtube-dl')
pip = 'pip.exe'
else:
os.system('pip install --upgrade youtube-dl')
pip = 'pip'
logger.debug(subprocess.check_output([pip, 'install', '--upgrade', 'youtube-dl'], universal_newlines=True))
# 편의를 위해 json 파일 생성
from plugin import plugin_info

View File

@@ -33,7 +33,7 @@ def plugin_unload():
Logic.plugin_unload()
plugin_info = {
'version': '1.2.1',
'version': '1.2.2',
'name': 'youtube-dl',
'category_name': 'vod',
'icon': '',
@@ -149,7 +149,7 @@ def api(sub):
if None == url:
return Logic.abort(ret, 1) # 필수 요청 변수가 없음
if not url.startswith('http'):
return Logic.abort(ret, 2) # 잘못된 주소
return Logic.abort(ret, 2) # 잘못된 동영상 주소
info_dict = Youtube_dl.get_info_dict(url)
if info_dict is None:
return Logic.abort(ret, 10) # 실패
@@ -172,7 +172,7 @@ def api(sub):
if None in (key, url, filename, temp_path, save_path):
return Logic.abort(ret, 1) # 필수 요청 변수가 없음
if not url.startswith('http'):
return Logic.abort(ret, 2) # 잘못된 주소
return Logic.abort(ret, 2) # 잘못된 동영상 주소
youtube_dl = Youtube_dl(plugin, url, filename, temp_path, save_path, format_code)
youtube_dl._key = key
Logic.youtube_dl_list.append(youtube_dl) # 리스트 추가