mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-23 18:11:37 +08:00
fix bug
This commit is contained in:
8
.env
Normal file
8
.env
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
HOST=192.168.31.10:8181
|
||||
TIME=1800
|
||||
USER=admin
|
||||
PASSWORD=adminadmin
|
||||
RSS=https://mikanani.me/RSS/Classic
|
||||
DOWNLOAD_PATH=/downloads/Bangumi
|
||||
METHOD=pn
|
||||
@@ -13,5 +13,6 @@ ENV PASSWORD=adminadmin
|
||||
ENV METHOD=pn
|
||||
|
||||
COPY ./app /app
|
||||
COPY ./config /config
|
||||
|
||||
CMD [ "python3", "/app/docker_main.py"]
|
||||
@@ -8,7 +8,7 @@ import os
|
||||
class SetRule:
|
||||
def __init__(self):
|
||||
with open(EnvInfo.info_path) as f:
|
||||
self.bangumi_info = json.load(f)
|
||||
self.bangumi_info = json.load(f)["bangumi_info"]
|
||||
self.rss_link = EnvInfo.rss_link
|
||||
self.host_ip = EnvInfo.host_ip
|
||||
self.user_name = EnvInfo.user_name
|
||||
@@ -38,12 +38,14 @@ class SetRule:
|
||||
}
|
||||
self.qb.rss_set_rule(rule_name=bangumi_name, rule_def=rule)
|
||||
|
||||
def add_rss_feed(self):
|
||||
def rss_feed(self):
|
||||
try:
|
||||
self.qb.rss_add_feed(self.rss_link)
|
||||
self.qb.rss_add_feed(url=self.rss_link, item_path="Mikan_RSS")
|
||||
sys.stdout.write(f"[{EnvInfo.time_show_obj}] Successes adding RSS Feed." + "\n")
|
||||
except ConnectionError:
|
||||
sys.stdout.write(f"[{EnvInfo.time_show_obj}] Error with adding RSS Feed." + "\n")
|
||||
except qbittorrentapi.exceptions.Conflict409Error:
|
||||
sys.stdout.write(f"[{EnvInfo.time_show_obj}] RSS Already exists." + "\n")
|
||||
|
||||
def run(self):
|
||||
sys.stdout.write(f"[{EnvInfo.time_show_obj}] Start adding rules." + "\n")
|
||||
|
||||
@@ -76,8 +76,14 @@ class CollectRSS:
|
||||
|
||||
def put_info_json(self):
|
||||
had_data = []
|
||||
for data in self.info:
|
||||
had_data.append(data["title"])
|
||||
if self.info["rss_link"] == EnvInfo.rss_link:
|
||||
for data in self.info["bangumi_info"]:
|
||||
had_data.append(data["title"])
|
||||
else:
|
||||
self.info = {
|
||||
"rss_link": EnvInfo.rss_link,
|
||||
"bangumi_info": []
|
||||
}
|
||||
for title in self.bangumi_list:
|
||||
match_title_season = re.match(MatchRule.season_match, title, re.I)
|
||||
if match_title_season is not None:
|
||||
@@ -87,7 +93,7 @@ class CollectRSS:
|
||||
json_season = ''
|
||||
json_title = title
|
||||
if json_title not in had_data:
|
||||
self.info.append({
|
||||
self.info["bangumi_info"].append({
|
||||
"title": json_title,
|
||||
"season": json_season
|
||||
})
|
||||
|
||||
@@ -9,13 +9,16 @@ from env import EnvInfo
|
||||
|
||||
def create_data_file():
|
||||
if not os.path.exists(EnvInfo.info_path):
|
||||
bangumi_info = []
|
||||
bangumi_info = {"rss_link": EnvInfo.rss_link,
|
||||
"bangumi_info": []
|
||||
}
|
||||
with open(EnvInfo.info_path, "w") as i:
|
||||
json.dump(bangumi_info, i, indent=4, separators=(',', ': '), ensure_ascii=False)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
create_data_file()
|
||||
SetRule().rss_feed()
|
||||
while True:
|
||||
CollectRSS().run()
|
||||
SetRule().run()
|
||||
|
||||
@@ -13,5 +13,5 @@ class EnvInfo:
|
||||
method = os.environ["METHOD"]
|
||||
# rss_link = "https://mikanani.me/RSS/Classic"
|
||||
rule_url = "https://raw.githubusercontent.com/EstrellaXD/Bangumi_Auto_Collector/main/AutoBangumi/app/rule.json"
|
||||
rule_path = "/app/rule.json"
|
||||
rule_path = "/config/rule.json"
|
||||
time_show_obj = time.strftime('%Y-%m-%d %X')
|
||||
@@ -1,58 +0,0 @@
|
||||
[
|
||||
{
|
||||
"title": "simple",
|
||||
"season": ""
|
||||
},
|
||||
{
|
||||
"title": "Kawaii dake ja Nai Shikimori-san",
|
||||
"season": ""
|
||||
},
|
||||
{
|
||||
"title": "Kakkou no Iinazuke",
|
||||
"season": ""
|
||||
},
|
||||
{
|
||||
"title": "SPYxFAMILY",
|
||||
"season": ""
|
||||
},
|
||||
{
|
||||
"title": "Love Live!虹咲学园 学园偶像同好会",
|
||||
"season": "S02"
|
||||
},
|
||||
{
|
||||
"title": "CUE!",
|
||||
"season": ""
|
||||
},
|
||||
{
|
||||
"title": "Kaguya-sama wa Kokurasetai",
|
||||
"season": "S03"
|
||||
},
|
||||
{
|
||||
"title": "Shokei Shoujo no Virgin Road",
|
||||
"season": ""
|
||||
},
|
||||
{
|
||||
"title": "Kakkou no Iikagen",
|
||||
"season": ""
|
||||
},
|
||||
{
|
||||
"title": "Summer Time Rendering",
|
||||
"season": ""
|
||||
},
|
||||
{
|
||||
"title": "Paripi Koumei",
|
||||
"season": ""
|
||||
},
|
||||
{
|
||||
"title": "Tate no Yuusha no Nariagari",
|
||||
"season": "S02"
|
||||
},
|
||||
{
|
||||
"title": "Shijou Saikyou no Daimaou",
|
||||
"season": ""
|
||||
},
|
||||
{
|
||||
"title": "Yuusha, Yamemasu",
|
||||
"season": ""
|
||||
}
|
||||
]
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"host_ip": "192.168.31.10:8181",
|
||||
"user_name": "admin",
|
||||
"password": "adminadmin",
|
||||
"method": "pn",
|
||||
"rss_link": "https://mikanani.me/RSS/MyBangumi?token=qTxKo48gH1SrFNy8X%2fCfQUoeElNsgKNWFNzNieKwBH8%3d",
|
||||
"download_path": "/downloads/Bangumi"
|
||||
}
|
||||
@@ -44,7 +44,8 @@
|
||||
"动漫国字幕组",
|
||||
"SweetSub&圆环记录攻略组",
|
||||
"动漫萌",
|
||||
"极影字幕社"
|
||||
"极影字幕社",
|
||||
"喵萌Production"
|
||||
],
|
||||
"name_position": 2
|
||||
},
|
||||
@@ -1,3 +1,6 @@
|
||||
import qbittorrentapi
|
||||
|
||||
str = "ab"
|
||||
print(len(str.encode()))
|
||||
qb = qbittorrentapi.Client(host="localhost:8080",username="admin",password="adminadmin")
|
||||
|
||||
qb.auth_log_in()
|
||||
qb.rss_add_feed(url="https://mikanani.me",item_path="自动下载")
|
||||
Reference in New Issue
Block a user