썸네일 다운로드 기능(+API) 추가

This commit is contained in:
joyfuI
2021-04-25 17:27:27 +09:00
parent e6a7b86670
commit 0cf53d3093
7 changed files with 180 additions and 12 deletions

View File

@@ -43,7 +43,8 @@ class MyYoutubeDL(object):
__index = 0
_last_msg = ''
def __init__(self, plugin, url, filename, temp_path, save_path=None, opts=None, dateafter=None, datebefore=None):
def __init__(self, plugin, type_name, url, filename, temp_path, save_path=None, opts=None, dateafter=None,
datebefore=None):
# from youtube_dl.utils import DateRange
from .plugin import YOUTUBE_DL_PACKAGE
DateRange = __import__('%s.utils' % YOUTUBE_DL_PACKAGE, fromlist=['DateRange']).DateRange
@@ -53,6 +54,7 @@ class MyYoutubeDL(object):
if opts is None:
opts = {}
self.plugin = plugin
self.type = type_name
self.url = url
self.filename = filename
if not os.path.isdir(temp_path):
@@ -166,6 +168,7 @@ class MyYoutubeDL(object):
# import youtube_dl
from .plugin import YOUTUBE_DL_PACKAGE
youtube_dl = __import__('%s' % YOUTUBE_DL_PACKAGE)
try:
ydl_opts = {
'simulate': True,