- 修复大量bug
This commit is contained in:
EstrellaXD
2022-07-19 20:53:00 +08:00
parent 01a84310b9
commit 3e223bf812
7 changed files with 21 additions and 27 deletions

View File

@@ -1,9 +1,9 @@
name: Build(Docker)
on:
push:
tags:
- '*'
release:
types:
- released
jobs:
docker:
@@ -12,6 +12,9 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
- name: Create Version info
run: |
echo "version = '$GITHUB_REF_NAME'" > src/conf/__version__.py
- name: Docker meta
id: meta
uses: docker/metadata-action@v4

View File

@@ -1,8 +0,0 @@
name: publish-release
on:
push:
tags:
- '*'
jobs:

1
.gitignore vendored
View File

@@ -170,3 +170,4 @@ cython_debug/
/src/run_debug.sh
/src/debug_run.sh
/src/conf/__version__.py

View File

@@ -2,7 +2,7 @@ import os
import time
import logging
from conf import settings, parse
from conf import settings, parse, version
from conf.log import setup_logger
from utils import json_config
@@ -55,7 +55,7 @@ def show_info():
logger.info(" /_/ \_\__,_|\__\___/|____/ \__,_|_| |_|\__, |\__,_|_| |_| |_|_|")
logger.info(" __/ | ")
logger.info(" |___/ ")
logger.info(f"Version {settings.version} Author: EstrellaXD Twitter: https://twitter.com/Estrella_Pan")
logger.info(f"Version {version} Author: EstrellaXD Twitter: https://twitter.com/Estrella_Pan")
logger.info("GitHub: https://github.com/EstrellaXD/Auto_Bangumi/")
logger.info("Starting AutoBangumi...")

View File

@@ -3,6 +3,7 @@ from .const import BCOLORS
# from .const_dev import DEV_SETTINGS
from .parse import parse
from .log import setup_logger
from .__version__ import version

View File

@@ -58,7 +58,6 @@ class Renamer:
name = info.name
torrent_hash = info.hash
path_name, season, folder_name, suffix, _ = self.split_path(info.content_path)
try:
new_name = self._renamer.download_parser(name, folder_name, season, suffix, settings.method)
if path_name != new_name:
@@ -66,8 +65,9 @@ class Renamer:
rename_count += 1
else:
continue
except:
except Exception as e:
logger.warning(f"{path_name} rename failed")
logger.debug(e)
if settings.remove_bad_torrent:
self.client.delete_torrent(torrent_hash)
self.print_result(torrent_count, rename_count)
@@ -85,7 +85,4 @@ class Renamer:
if __name__ == "__main__":
from conf.const_dev import DEV_SETTINGS
settings.init(DEV_SETTINGS)
client = DownloadClient()
rename = Renamer(client)
rename.run()
# rename.set_folder()
rename = Renamer(DownloadClient())

View File

@@ -34,20 +34,20 @@ class TitleParser:
official_title = official_title if official_title else title
return official_title, tmdb_season
def return_dict(self, raw: str):
def return_dict(self, _raw: str):
try:
episode = self.raw_parser(raw)
episode = self.raw_parser(_raw)
title_search = episode.title_zh if episode.title_zh else episode.title_en
title_raw = episode.title_en if episode.title_en else episode.title_zh
if settings.enable_tmdb:
official_title, season = self.tmdb_parser(title_search, episode.season)
official_title, _season = self.tmdb_parser(title_search, episode.season)
else:
official_title = title_search
season = episode.season
official_title = title_search if settings.language == "zh" else title_raw
_season = episode.season
data = {
"official_title": official_title,
"title_raw": title_raw,
"season": season,
"season": _season,
"season_raw": episode.season_raw,
"group": episode.group,
"dpi": episode.resolution,
@@ -69,5 +69,5 @@ if __name__ == '__main__':
T = TitleParser()
raw = "[Lilith-Raws] 在地下城寻求邂逅是否搞错了什么/Danmachi S4[01][Baha][WEB-DL][1080p][AVC AAC][CHT][MP4]"
season = int(re.search(r"\d{1,2}", "S02").group())
dict = T.return_dict(raw)
print(dict)
_dict = T.return_dict(raw)
print(_dict)