Ethscriptions commited on
Commit
c850b5a
·
1 Parent(s): 38d56f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -13
app.py CHANGED
@@ -10,7 +10,7 @@ import os
10
  current_dir = os.path.dirname(os.path.abspath(__file__))
11
 
12
  # 构造数据库文件路径
13
- rarbg_db_file = os.path.join(current_dir, 'rarbg_db.db')
14
  rarbg_config_file = os.path.join(current_dir, 'rarbg_config.ini')
15
 
16
  my_style = '''
@@ -47,7 +47,7 @@ def image_to_base64(img_path):
47
 
48
  # 连接数据库
49
  def get_connection():
50
- conn = sqlite3.connect("rarbg_db.sqlite")
51
  return conn
52
 
53
 
@@ -96,17 +96,11 @@ st.set_page_config(page_title="RARBG Database Search", page_icon="🌞", layout=
96
  # 首页
97
  st.markdown(f'# <a href="https://www.rarbg.quest/" target="_self"><img src="data:image/jpeg;base64,{image_to_base64(os.path.join("rarbg.png"))}" alt="Image" width="48px" height="48px" style="border-radius: 8px; box-shadow: 3px 3px 10px rgba(0,0,0,0.1);"/></a> :rainbow[RARBG 数据库搜索]', unsafe_allow_html=True)
98
 
99
- # 广告位图片
100
- st.success(f'''#### 广告位
101
- 😭 接不到广告,我太穷了。请联系我 Telegram: @NervosCKB
102
-
103
- 用户搜索次数:{searches_value}''')
104
-
105
  # 搜索框
106
- keyword = st.text_input("输入搜索的关键词:")
107
 
108
  # 搜索按钮
109
- if st.button("Search"):
110
  if keyword:
111
  # 搜索数据库
112
  df = search_db(keyword)
@@ -139,7 +133,9 @@ if st.button("Search"):
139
  else:
140
  st.error("请输入一些关键词。")
141
 
142
- st.error('''#### 温馨提示
 
 
143
  本站不提供任何包含反动、淫秽、色情、暴力、侮辱、诽谤等不良信息。当你浏览本网站时,请自觉遵守法律法规,对自己的行为承担全部责任。''')
144
- st.info('''#### 使用说明
145
- 请在文本框内输入关键词,仅限英文,并点击搜索按钮进行查询。若需输入多个关键词,可用空格进行分隔;若希望某个关键词不在搜索结果中出现,可在关键词前加上 "-" 符号。''')
 
10
  current_dir = os.path.dirname(os.path.abspath(__file__))
11
 
12
  # 构造数据库文件路径
13
+ rarbg_db_file = os.path.join(current_dir, 'rarbg_db.sqlite')
14
  rarbg_config_file = os.path.join(current_dir, 'rarbg_config.ini')
15
 
16
  my_style = '''
 
47
 
48
  # 连接数据库
49
  def get_connection():
50
+ conn = sqlite3.connect(rarbg_db_file)
51
  return conn
52
 
53
 
 
96
  # 首页
97
  st.markdown(f'# <a href="https://www.rarbg.quest/" target="_self"><img src="data:image/jpeg;base64,{image_to_base64(os.path.join("rarbg.png"))}" alt="Image" width="48px" height="48px" style="border-radius: 8px; box-shadow: 3px 3px 10px rgba(0,0,0,0.1);"/></a> :rainbow[RARBG 数据库搜索]', unsafe_allow_html=True)
98
 
 
 
 
 
 
 
99
  # 搜索框
100
+ keyword = st.text_input("输入你想搜索的关键词:")
101
 
102
  # 搜索按钮
103
+ if st.button("搜索"):
104
  if keyword:
105
  # 搜索数据库
106
  df = search_db(keyword)
 
133
  else:
134
  st.error("请输入一些关键词。")
135
 
136
+ st.success(f'''##### 广告位
137
+ 😭 接不到广告,我太穷了。请联系我 Telegram: @NervosCKB,用户搜索总次数:{searches_value}''')
138
+ st.error('''##### 温馨提示
139
  本站不提供任何包含反动、淫秽、色情、暴力、侮辱、诽谤等不良信息。当你浏览本网站时,请自觉遵守法律法规,对自己的行为承担全部责任。''')
140
+ st.info('''##### 使用说明
141
+ 请在文本框内输入关键词,仅限英文,并点击搜索按钮进行查询。若需输入多个关键词,可用空格进行分隔;若希望某个关键词不在搜索结果中出现,可在关键词前加上 "-" 符号。''')