mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-11-26 22:01:58 +08:00
@@ -23,7 +23,6 @@ RUN set -ex && \
|
||||
shadow \
|
||||
tini \
|
||||
openssl \
|
||||
busybox-suid \
|
||||
tzdata && \
|
||||
python3 -m pip install --no-cache-dir --upgrade pip && \
|
||||
sed -i '/bcrypt/d' requirements.txt && \
|
||||
|
||||
@@ -144,7 +144,9 @@ class BangumiDatabase:
|
||||
# Find eps_complete = False
|
||||
# use `false()` to avoid E712 checking
|
||||
# see: https://docs.astral.sh/ruff/rules/true-false-comparison/
|
||||
condition = select(Bangumi).where(Bangumi.eps_collect == false())
|
||||
condition = select(Bangumi).where(
|
||||
and_(Bangumi.eps_collect == false(), Bangumi.deleted == false())
|
||||
)
|
||||
datas = self.session.exec(condition).all()
|
||||
return datas
|
||||
|
||||
|
||||
@@ -20,10 +20,11 @@ class RequestURL:
|
||||
while True:
|
||||
try:
|
||||
req = self.session.get(url=url, headers=self.header, timeout=5)
|
||||
logger.debug(f"[Network] Successfully connected to {url}. Status: {req.status_code}")
|
||||
req.raise_for_status()
|
||||
return req
|
||||
except requests.RequestException:
|
||||
logger.warning(
|
||||
logger.debug(
|
||||
f"[Network] Cannot connect to {url}. Wait for 5 seconds."
|
||||
)
|
||||
try_time += 1
|
||||
@@ -33,8 +34,7 @@ class RequestURL:
|
||||
except Exception as e:
|
||||
logger.debug(e)
|
||||
break
|
||||
logger.error(f"[Network] Failed connecting to {url}")
|
||||
logger.warning("[Network] Please check DNS/Connection settings")
|
||||
logger.error(f"[Network] Unable to connect to {url}, Please check your network settings")
|
||||
return None
|
||||
|
||||
def post_url(self, url: str, data: dict, retry=3):
|
||||
|
||||
@@ -82,14 +82,21 @@ class RSSAnalyser(TitleParser):
|
||||
|
||||
def link_to_data(self, rss: RSSItem) -> Bangumi | ResponseModel:
|
||||
torrents = self.get_rss_torrents(rss.url, False)
|
||||
if not torrents:
|
||||
return ResponseModel(
|
||||
status=False,
|
||||
status_code=406,
|
||||
msg_en="Cannot find any torrent.",
|
||||
msg_zh="无法找到种子。",
|
||||
)
|
||||
for torrent in torrents:
|
||||
data = self.torrent_to_data(torrent, rss)
|
||||
if data:
|
||||
return data
|
||||
else:
|
||||
return ResponseModel(
|
||||
status=False,
|
||||
status_code=406,
|
||||
msg_en="Cannot parse this link.",
|
||||
msg_zh="无法解析此链接。",
|
||||
)
|
||||
return ResponseModel(
|
||||
status=False,
|
||||
status_code=406,
|
||||
msg_en="Cannot parse this link.",
|
||||
msg_zh="无法解析此链接。",
|
||||
)
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@ const items = [
|
||||
icon: Download,
|
||||
label: () => t('sidebar.downloader'),
|
||||
path: '/downloader',
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
|
||||
@@ -7,8 +7,13 @@ const messages = {
|
||||
'zh-CN': zhCN,
|
||||
};
|
||||
|
||||
type Languages = keyof typeof messages;
|
||||
|
||||
export const useMyI18n = createSharedComposable(() => {
|
||||
const lang = useLocalStorage('lang', navigator.language);
|
||||
const lang = useLocalStorage<Languages>(
|
||||
'lang',
|
||||
navigator.language as Languages
|
||||
);
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
@@ -17,21 +22,31 @@ export const useMyI18n = createSharedComposable(() => {
|
||||
messages,
|
||||
});
|
||||
|
||||
watch(lang, (val) => {
|
||||
i18n.global.locale.value = val;
|
||||
});
|
||||
|
||||
function changeLocale() {
|
||||
if (lang.value === 'zh-CN') {
|
||||
i18n.global.locale.value = 'en';
|
||||
lang.value = 'en';
|
||||
} else {
|
||||
i18n.global.locale.value = 'zh-CN';
|
||||
lang.value = 'zh-CN';
|
||||
}
|
||||
}
|
||||
|
||||
function returnUserLangText(texts: {
|
||||
[k in Languages]: string;
|
||||
}) {
|
||||
return computed(() => texts[lang.value]);
|
||||
}
|
||||
|
||||
return {
|
||||
lang,
|
||||
i18n,
|
||||
t: i18n.global.t,
|
||||
locale: i18n.global.locale,
|
||||
changeLocale,
|
||||
getText: returnUserLangText,
|
||||
returnUserLangText,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -77,6 +77,9 @@
|
||||
"player": {
|
||||
"hit": "Please set up the media player"
|
||||
},
|
||||
"downloader": {
|
||||
"hit": "Please set up the downloader"
|
||||
},
|
||||
"log": {
|
||||
"title": "Log",
|
||||
"reset": "Reset",
|
||||
|
||||
@@ -77,6 +77,9 @@
|
||||
"player": {
|
||||
"hit": "请设置媒体播放器地址"
|
||||
},
|
||||
"downloader": {
|
||||
"hit": "请设置下载器"
|
||||
},
|
||||
"log": {
|
||||
"title": "日志",
|
||||
"reset": "重置",
|
||||
|
||||
@@ -2,8 +2,42 @@
|
||||
definePage({
|
||||
name: 'Downloader',
|
||||
});
|
||||
|
||||
const { config } = storeToRefs(useConfigStore());
|
||||
const { getConfig } = useConfigStore();
|
||||
|
||||
getConfig();
|
||||
|
||||
const isNull = computed(() => {
|
||||
return config.value.downloader.host === '';
|
||||
});
|
||||
|
||||
const url = computed(() => {
|
||||
const downloader = config.value.downloader;
|
||||
const protocol = downloader.ssl ? 'https' : 'http';
|
||||
|
||||
return `${protocol}://${downloader.host}`;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>null</div>
|
||||
<div overflow-auto mt-12px flex-grow>
|
||||
<template v-if="isNull">
|
||||
<div wh-full f-cer text-h1 text-primary>
|
||||
<RouterLink to="/config" hover:underline>{{
|
||||
$t('downloader.hit')
|
||||
}}</RouterLink>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<iframe
|
||||
:src="url"
|
||||
frameborder="0"
|
||||
allowfullscreen="true"
|
||||
w-full
|
||||
h-full
|
||||
flex-1
|
||||
rounded-12px
|
||||
></iframe>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
1
webui/types/dts/components.d.ts
vendored
1
webui/types/dts/components.d.ts
vendored
@@ -35,7 +35,6 @@ declare module '@vue/runtime-core' {
|
||||
AbTag: typeof import('./../../src/components/basic/ab-tag.vue')['default']
|
||||
AbTopbar: typeof import('./../../src/components/layout/ab-topbar.vue')['default']
|
||||
ConfigDownload: typeof import('./../../src/components/setting/config-download.vue')['default']
|
||||
ConfigExperimental: typeof import('./../../src/components/setting/config-experimental.vue')['default']
|
||||
ConfigManage: typeof import('./../../src/components/setting/config-manage.vue')['default']
|
||||
ConfigNormal: typeof import('./../../src/components/setting/config-normal.vue')['default']
|
||||
ConfigNotification: typeof import('./../../src/components/setting/config-notification.vue')['default']
|
||||
|
||||
Reference in New Issue
Block a user