Attempt to make data_limit configurable

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
このコミットが含まれているのは:
Izuru Yakumo 2023-05-11 22:17:25 -03:00
コミット ea2e11894b
4個のファイルの変更11行の追加23行の削除

18
COPYING
ファイルの表示

@ -1,16 +1,4 @@
Discordian Public License (DPL)
Freedom License v1 (2023年05月11日)
All Rites Reversed Ⓚ (3188) (czar) <czar at kalli dot st>
All Rites Reversed (ĸ) 3189 Aoi K. <koizumi dot aoi at chaotic dot ninja>
Permission is hereby granted, to any person obtaining a copy of this
material without restriction, including but not limited the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the material, subject to the following conditions:
YOU AGREE THAT THERE IS NO GODDESS BUT GODDESS AND SHE IS YOUR GODDESS &
THAT THERE IS NO ERISIAN MOVEMENT BUT THE ERISIAN MOVEMENT AND IT IS THE
ERISIAN MOVEMENT.
HAIL ERIS!
FIVE TONS OF FLAX
全く無限的自由です。
It's infinite freedom.

ファイルの表示

@ -1,8 +1,7 @@
#+TITLE: Chen XMPP bot
#+AUTHOR: Aoi K.
#+AUTHOR: Izuru Yakumo
XMPP bot to preview links and file contents. This may be identified as [[https://gt.kalli.st/czar/angel][angel]]'s
younger sibling.
XMPP bot to preview links and file contents. Shikigami of the Shikigami of the Gap Youkai
* Configuration
copy the =config.ini.default= to =.config.ini= and set your variables accordly

ファイルの表示

@ -3,3 +3,4 @@ jid = chen@example.com
password = b0TPA55W0rD
nick = Chen
autojoin = room1@muc.example.com room2@muc.example.com room3@muc.example.com
upload_data_size = 100000000

10
main.py
ファイルの表示

@ -17,7 +17,7 @@ parser = "html.parser"
user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:10.0)"
" Gecko/20100101 Firefox/10.0"
accept_lang = "en-US"
data_limit = 100000000 # 100MB
data_limit = upload_data_size # 100MB
headers = {
"user-agent": user_agent,
@ -31,6 +31,7 @@ block_list = (
"0.0.0.0",
"youtu.be",
"www.youtube.com",
"youtube.com",
)
req_list = ("http://", "https://")
html_files = ("text/html", "application/xhtml+xml")
@ -174,10 +175,8 @@ class ChenBot(ClientXMPP):
async def update_info(self):
vcard = self.plugin["xep_0054"].make_vcard()
vcard["URL"] = "https://gt.kalli.st/novaburst/chen"
vcard[
"DESC"
] = "Chen is a self-proclaimed little sister of Angel. Her master is Ran Yakumo whose master is Yukari Yakumo"
vcard["URL"] = "https://git.chaotic.ninja/yakumo.izuru/chen"
vcard["DESC"] = "Shikigami of the Shikigami of the Gap Youkai"
vcard["NICKNAME"] = "Chen"
vcard["FN"] = "Chen"
asyncio.gather(self.plugin["xep_0054"].publish_vcard(vcard))
@ -224,6 +223,7 @@ if __name__ == "__main__":
password = config["chen"]["password"]
nick = config["chen"]["nick"]
autojoin = config["chen"]["autojoin"].split()
upload_data_size = config["chen"]["upload_data_size"]
bot = ChenBot(jid, password, nick, autojoin=autojoin)
bot.connect()