Update repository URL to Gitea and sync structural changes

This commit is contained in:
2026-01-05 15:57:24 +09:00
parent 51ef1ee459
commit 1167e60c36
12 changed files with 318 additions and 376 deletions

View File

@@ -8,14 +8,16 @@ from datetime import datetime
from threading import Thread
from enum import Enum
import framework.common.celery as celery_shutil
from framework import celery as celery_shutil
from .plugin import Plugin
# from .plugin import Plugin
logger = Plugin.logger
ModelSetting = Plugin.ModelSetting
from .setup import P
youtube_dl_package = Plugin.youtube_dl_packages[
logger = P.logger
ModelSetting = P.ModelSetting
youtube_dl_package = P.youtube_dl_packages[
int(ModelSetting.get("youtube_dl_package"))
if ModelSetting.get("youtube_dl_package")
else 1 # LogicMain.db_default["youtube_dl_package"]
@@ -140,7 +142,9 @@ class MyYoutubeDL:
}
ydl_opts.update(self.opts)
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([self.url])
logger.debug(self.url)
error_code = ydl.download([self.url])
logger.debug(error_code)
if self.status in (Status.START, Status.FINISHED): # 다운로드 성공
for i in glob(self.temp_path + "/**/*", recursive=True):
path = i.replace(self.temp_path, self.save_path, 1)
@@ -190,12 +194,13 @@ class MyYoutubeDL:
if http_headers:
ydl_opts["http_headers"] = http_headers
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
# info = ydl.extract_info(url, download=False)
info = ydl.extract_info(url, download=False)
except Exception as error:
logger.error("Exception:%s", error)
logger.error(traceback.format_exc())
return None
return info
return ydl.sanitize_info(info)
def my_hook(self, data):
if self.status != Status.STOP: