前情提要:最近两个月腾讯云的消费突然激增了300倍的消费(0.01→3.21¥)
预告:最近再整篇大的,关于qt面试总结,看我找工作情况择日发布吧
- 首先在网站上登陆你的账号,然后进入费用界面
- 选择费用账单→账单查看→选择按产品汇总的"查看更多",从中找到最高消费的服务
- 选择对应的存储桶id,最后就能找到高消费的来源
- 本文是由于开启了盲水印服务,导致消费激增。(笑死,都没人看,还防盗)


- 询问GPT
- 获得Python代码
- 修改后上传至服务器,就不会使用该服务了(标题党嫌疑,哈哈哈)
- 注意,数据万象这个服务一旦开启就无法关闭,只能通过修改路径接口,停止使用对应服务即可
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| import os
import re
def modify_md_files(folder_path):
# 遍历文件夹及其子文件夹
for root, dirs, files in os.walk(folder_path):
for file_name in files:
if file_name.endswith('.md'):
file_path = os.path.join(root, file_name)
# 读取文件内容
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
# 使用正则表达式匹配图片路径并替换
modified_content = re.sub(r'!\[.*?\]\((.*?)\?watermark.*?\)', r'', content)
if modified_content != content:
print("Modified:", file_path)
# 写入修改后的内容
with open(file_path, 'w', encoding='utf-8') as file:
file.write(modified_content)
folder_path = r'content'
modify_md_files(folder_path)
|