mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-23 18:11:37 +08:00
2.5.13
- 修复可能会导致打开 eps_complete 导致无法添加规则的问题
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
DEFAULT_SETTINGS = {
|
||||
"version": "2.5.11",
|
||||
"version": "2.5.13",
|
||||
"data_version": 4.0,
|
||||
"host_ip": "localhost:8080",
|
||||
"sleep_time": 7200,
|
||||
|
||||
@@ -2,7 +2,7 @@ import re
|
||||
from dataclasses import dataclass
|
||||
|
||||
from network.request import RequestURL
|
||||
from .notification import PostNotification
|
||||
from network.notification import PostNotification
|
||||
from conf import settings
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@ class RequestContent:
|
||||
def get_torrents(self, url: str) -> [TorrentInfo]:
|
||||
soup = self._req.get_content(url)
|
||||
torrent_titles = [item.title.string for item in soup.find_all("item")]
|
||||
keep_index = []
|
||||
for idx, title in enumerate(torrent_titles):
|
||||
if re.search(settings.not_contain, title) is None:
|
||||
keep_index.append(idx)
|
||||
torrent_urls = [item.get("url") for item in soup.find_all("enclosure")]
|
||||
return [TorrentInfo(torrent_titles[i], torrent_urls[i]) for i in keep_index]
|
||||
torrents = []
|
||||
for title, torrent_url in zip(torrent_titles, torrent_urls):
|
||||
if re.search(settings.not_contain, title) is None:
|
||||
torrents.append(TorrentInfo(title, torrent_url))
|
||||
return torrents
|
||||
|
||||
def get_torrent(self, url) -> TorrentInfo:
|
||||
soup = self._req.get_content(url)
|
||||
|
||||
@@ -52,7 +52,7 @@ class TitleParser:
|
||||
"source": episode.source,
|
||||
"subtitle": episode.sub,
|
||||
"added": False,
|
||||
"eps_collect": True if settings.eps_complete and episode.ep_info.number > 1 else False,
|
||||
"eps_collect": True if settings.eps_complete and episode.episode > 1 else False,
|
||||
}
|
||||
logger.debug(f"RAW:{raw} >> {episode.title_en}")
|
||||
return data
|
||||
@@ -65,7 +65,7 @@ if __name__ == '__main__':
|
||||
from conf.const_dev import DEV_SETTINGS
|
||||
settings.init(DEV_SETTINGS)
|
||||
T = TitleParser()
|
||||
raw = "[Lilith-Raws] 在地下城寻求邂逅是否搞错了什么 - 00 [Baha][WEB-DL][1080p][AVC AAC][CHT][MP4]"
|
||||
raw = "[Lilith-Raws] 在地下城寻求邂逅是否搞错了什么/Danmachi [无修正][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)
|
||||
|
||||
Reference in New Issue
Block a user