다운로드 후 파일 이동이 안되던 문제 수정

This commit is contained in:
joyfuI
2021-05-04 00:37:42 +09:00
parent 446d39eb31
commit 4db7ce9913
4 changed files with 7 additions and 4 deletions

View File

@@ -1,10 +1,10 @@
from __future__ import unicode_literals
import os
import glob
import traceback
import tempfile
import json
from glob import glob
from datetime import datetime
from threading import Thread
from enum import Enum
@@ -130,7 +130,7 @@ class MyYoutubeDL(object):
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([self.url])
if self.status in (Status.START, Status.FINISHED): # 다운로드 성공
for i in glob.glob(self.temp_path + '/**/*'):
for i in glob(self.temp_path + '/**/*', recursive=True):
path = i.replace(self.temp_path, self.save_path, 1)
if os.path.isdir(i):
if not os.path.isdir(path):