diff --git a/README.md b/README.md index e4617c6..8d62545 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ v1.0.0 * 목록에서 진행률 표시 추가 v0.1.1 -* ~~윈도우 환경 지원 추가~~ * 다운로드 실패 시 임시파일 삭제가 안 되는 문제 수정 v0.1.0 diff --git a/info.json b/info.json index 13cf548..d139226 100644 --- a/info.json +++ b/info.json @@ -1 +1 @@ -{"more": "", "version": "1.0.0", "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.0.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 diff --git a/my_youtube_dl.py b/my_youtube_dl.py index 57283fb..32ee2b2 100644 --- a/my_youtube_dl.py +++ b/my_youtube_dl.py @@ -78,28 +78,32 @@ class Youtube_dl(object): self.status = Status.START def run(self): - info_dict = Youtube_dl.get_info_dict(self.url) # 동영상 정보 가져오기 - if info_dict is None: # 가져오기 실패 - self.status = Status.ERROR - return - self.extractor = info_dict['extractor'] - self.title = info_dict['title'] - self.uploader = info_dict['uploader'] - self.uploader_url = info_dict['uploader_url'] - ydl_opts = { - 'logger': MyLogger(), - 'progress_hooks': [self.my_hook], - # 'match_filter': self.match_filter_func, - 'outtmpl': os.path.join(self.temp_path, self.filename) - } - with youtube_dl.YoutubeDL(ydl_opts) as ydl: - ydl.download([self.url]) - if self.status == Status.FINISHED: # 다운로드 성공 - for i in glob.glob(self.temp_path + '/*'): - shutil.move(i, self.save_path) # 파일 이동 - self.status = Status.COMPLETED - shutil.rmtree(self.temp_path) # 임시폴더 삭제 - self.end_time = datetime.now() + try: + info_dict = Youtube_dl.get_info_dict(self.url) # 동영상 정보 가져오기 + if info_dict is None: # 가져오기 실패 + self.status = Status.ERROR + return + self.extractor = info_dict['extractor'] + self.title = info_dict['title'] + self.uploader = info_dict['uploader'] + self.uploader_url = info_dict['uploader_url'] + ydl_opts = { + 'logger': MyLogger(), + 'progress_hooks': [self.my_hook], + # 'match_filter': self.match_filter_func, + 'outtmpl': os.path.join(self.temp_path, self.filename) + } + with youtube_dl.YoutubeDL(ydl_opts) as ydl: + ydl.download([self.url]) + if self.status == Status.FINISHED: # 다운로드 성공 + for i in glob.glob(self.temp_path + '/*'): + shutil.move(i, self.save_path) # 파일 이동 + self.status = Status.COMPLETED + shutil.rmtree(self.temp_path) # 임시폴더 삭제 + self.end_time = datetime.now() + except Exception as e: + logger.error('Exception:%s', e) + logger.error(traceback.format_exc()) def stop(self): self.status = Status.STOP @@ -120,6 +124,8 @@ class Youtube_dl(object): with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([url]) except Exception as e: + logger.error('Exception:%s', e) + logger.error(traceback.format_exc()) return None return json.loads(Youtube_dl._last_msg) diff --git a/plugin.py b/plugin.py index ef61def..45605b1 100644 --- a/plugin.py +++ b/plugin.py @@ -33,7 +33,7 @@ def plugin_unload(): Logic.plugin_unload() plugin_info = { - 'version': '1.0.0', + 'version': '1.0.1', 'name': 'youtube-dl', 'category_name': 'vod', 'icon': '',