diff --git a/README.md b/README.md index e3a0ef8..52aff91 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/info.json b/info.json index 245d003..34db97c 100644 --- a/info.json +++ b/info.json @@ -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"} \ No newline at end of file +{"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"} \ No newline at end of file diff --git a/logic.py b/logic.py index 29eaaca..256cb0e 100644 --- a/logic.py +++ b/logic.py @@ -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 diff --git a/plugin.py b/plugin.py index 3f36010..8262ded 100644 --- a/plugin.py +++ b/plugin.py @@ -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) # 리스트 추가