Improve redirection

This commit is contained in:
KnugiHK
2024-02-13 15:03:51 +08:00
parent d5ea843286
commit 54e0b43888
3 changed files with 22 additions and 15 deletions

View File

@@ -288,17 +288,17 @@ def main():
elif args.iphone: elif args.iphone:
args.filter_date = f"<= {_timestamp - APPLE_TIME}" args.filter_date = f"<= {_timestamp - APPLE_TIME}"
else: else:
print("Unsupported date format. See https://wts.knugi.dev/filter.html") print("Unsupported date format. See https://wts.knugi.dev/docs?dest=date")
exit(1) exit(1)
if args.filter_chat_include is not None: if args.filter_chat_include is not None:
for chat in args.filter_chat_include: for chat in args.filter_chat_include:
if not chat.isnumeric(): if not chat.isnumeric():
print("Enter a phone number in the chat filter. See https://wts.knugi.dev/filter.html") print("Enter a phone number in the chat filter. See https://wts.knugi.dev/docs?dest=chat")
exit(1) exit(1)
if args.filter_chat_exclude is not None: if args.filter_chat_exclude is not None:
for chat in args.filter_chat_exclude: for chat in args.filter_chat_exclude:
if not chat.isnumeric(): if not chat.isnumeric():
print("Enter a phone number in the chat filter. See https://wts.knugi.dev/filter.html") print("Enter a phone number in the chat filter. See https://wts.knugi.dev/docs?dest=chat")
exit(1) exit(1)
filter_chat = (args.filter_chat_include, args.filter_chat_exclude) filter_chat = (args.filter_chat_include, args.filter_chat_exclude)

19
docs.html Normal file
View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url='https://github.com/KnugiHK/WhatsApp-Chat-Exporter/wiki'" />
<script type="text/javascript">
destination = {
"filter": "Filter",
"date": "Filters#date-filters",
"chat": "Filters#chat-filter",
null: ""
};
const dest = new URLSearchParams(window.location.search).get('dest');
window.location.href = `https://github.com/KnugiHK/WhatsApp-Chat-Exporter/wiki/${destination[dest]}`;
</script>
</head>
<body>
<p>If the redirection doesn't work, you can find the documentation at <a href="https://github.com/KnugiHK/WhatsApp-Chat-Exporter/wiki">https://github.com/KnugiHK/WhatsApp-Chat-Exporter/wiki</a>.</p>
</body>
</html>

View File

@@ -1,12 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url='https://github.com/KnugiHK/WhatsApp-Chat-Exporter/wiki/Filters'" />
<script type="text/javascript">
window.location.href = "https://github.com/KnugiHK/WhatsApp-Chat-Exporter/wiki/Filters"
</script>
</head>
<body>
<p>If the redirection doesn't work, you can find the documentation on filters at <a href="https://github.com/KnugiHK/WhatsApp-Chat-Exporter/wiki/Filters">https://github.com/KnugiHK/WhatsApp-Chat-Exporter/wiki/Filters</a>.</p>
</body>
</html>