当前位置:网站首页>There is a fee for the picture bed software. Forget it, I wrote an open source free one.
There is a fee for the picture bed software. Forget it, I wrote an open source free one.
2022-07-29 20:54:00 【Tao Yuanming of Western Wei Dynasty】

作者: 西魏陶渊明
博客: https://blog.springlearn.cn/
天下代码一大抄, 抄来抄去有提高, 看你会抄不会抄!

前言
今天下班前,The editor saw Lao Li next door,I bought a bed tool.I was big on the spot!
Li,Why don't you find me.I have a variety of free map bed tools, 全部不要钱.
Xiao Li vomited blood and died on the spot!

都2222年了,There will be no one who does not know what a picture bed is..
什么是图床?
The picture bed is actually a space for pictures,A picture of our browse on the Internet,are actually stored on a network server.,比如qq空间,csdn等等网站.
So since the above websites have already provided us with picture beds,Why we've built figure bed? 不知道大家有没有发现,我们在qqspace orcsdn上传的图片.If you want to refer to other websites.These platforms will automatically add a watermark to you.

And more annoying,it goes straight to you403,Then showed a other picture for you.

So for those personal blogging sites,Don't use outside the chain of images,Otherwise may not during a visit to the day.前车之鉴,Please leave the pit automatically.
Apply for free space + 自定义水印
Earlier we said what a map bed is,In fact, it is to find a network space where you can put pictures..So is there any free space?? 当然有了.某 Cloud provides individual users10g的免费空间.You can't use blogging10g吧.另外还支持cdn加速,Customizable watermark.
So as not to be thought that the editor is talking about advertising,I won't say which factory it is..如果有人知道的,可以留下评论.If you don't know, click follow,Let's talk in detail.
The following teaches you how to use the map bed correctly,then be lazy.
懒人1.0版本
基于python写的一个脚本.先演示.The benefit of this script is that,Any file can be uploaded.Whether it's a picture or a file,personal space that can be uploaded.The disadvantage is that every time you want to upload a file, you have to go to the command console.

Send the following script,拿走不谢.I used this script1年.Then I got lazy again.so lazy2.0version coming out.
from prettytable import PrettyTable
import argparse
import hashlib
import time
import uuid
from colorama import init, Fore, Back
class Color:
@staticmethod
def red(s, isLight=False):
if not isLight:
return Fore.RED + s + Fore.RESET
return Fore.LIGHTRED_EX + s + Fore.RESET
@staticmethod
def green(s, isLight=False):
if not isLight:
return Fore.GREEN + s + Fore.RESET
return Fore.LIGHTGREEN_EX + s + Fore.RESET
@staticmethod
def yellow(s, isLight=False):
if not isLight:
return Fore.YELLOW + s + Fore.RESET
return Fore.LIGHTYELLOW_EX + s + Fore.RESET
@staticmethod
def white(s, isLight=False):
if not isLight:
return Fore.WHITE + s + Fore.RESET
return Fore.LIGHTWHITE_EX + s + Fore.RESET
@staticmethod
def blue(s, isLight=False):
if not isLight:
return Fore.BLUE + s + Fore.RESET
return Fore.LIGHTBLUE_EX + s + Fore.RESET
@staticmethod
def black(s, isLight=False):
if not isLight:
return Fore.BLACK + s + Fore.RESET
return Fore.LIGHTBLACK_EX + s + Fore.RESET
def fileByLocation(fileLocation):
'''Calculate filename from full pathname'''
if fileLocation.count('/') > 0:
return fileLocation.split('/')[-1]
else:
return fileLocation
def fileNameEncode(fileName, prefix):
'''文件名加密,使用md算法'''
index = fileName.index('.')
random_str = str(uuid.uuid1())
preFileName = fileName[0:index] + random_str;
fileEncode = hashlib.md5(preFileName.encode(encoding='UTF-8')).hexdigest()
suffix = fileName[index:]
return prefix + '_' + fileEncode + suffix
def checkBucketName(bucket_name):
if not bucket_name:
return "springlearn"
return bucket_name
parser = argparse.ArgumentParser(description="图床工具")
parser.add_argument('-i', '--imgLocation', type=str, help='文件地址')
parser.add_argument('-b', '--bucket_name', type=str, help='bucket_name')
parser.add_argument('-p', '--prefix', type=str, help='bucket_name')
args = parser.parse_args()
bucket_name = checkBucketName(args.bucket_name)
# 文件的完整路径
fileLocation = args.imgLocation
# 命名前缀
prefix = args.prefix
# Get filename based on file path
fileName = fileByLocation(fileLocation)
# Encrypt the filename
if (prefix == None):
key = fileNameEncode(fileName, "learn")
else:
key = fileNameEncode(fileName, prefix)
access_key = 'Replace with your own key'
secret_key = 'Replace with your own key'
q = Auth(access_key, secret_key)
token = q.upload_token(bucket_name, key, 3600)
ret, info = put_file(token, key, fileLocation)
base_table_head = ["文件名", "加密文件名", "上传路径", "外链", "时间", "成功"]
table = PrettyTable(base_table_head)
raw = list()
raw.append(fileName)
raw.append(key)
raw.append(fileLocation)
raw.append("https://img.springlearn.cn/{0}".format(key))
raw.append(time.strftime('%Y-%m-%d %H:%M:%S'))
raw.append(info.ok())
table.add_row(raw)
print(Color.green(str(table)))
懒人2.0版本
懒人2.0就是解决,懒人1.0的问题,No longer needed each time you upload into the console,Just take a screenshot.然后输入快捷键,It will automatically read the pasteboard image and upload it,Send notification after upload,并且自动转换成markdown语法,Back on the clipboard,然后只用ctrl+v黏贴就可以了.So I went and took a year.

The above is how the software opens,什么都没有,Only one shortcut key is bound.
如此简单.When the shortcut key is executed, it will automatically upload,then send a notification.如下.Click on the notification, the automatic open the pictures,ctrl+vAfter the output directly to the document.

So I spent another year.Then I got lazy again.so lazy3.0诞生了.
懒人3.0版本

懒人3.0版本,I don't even want to press shortcut keys anymore.I've become greedy,I should not only have shortcut I also visualization,所见即所得,Any picture you can see can be directly dragged and uploaded,And to have me lazy2.0所有的功能.I even
solve the time problem,I also added a clock function,to remind me: 打工人,六点了,该下班了.stop rolling.

even to protect my glasses,Also added a theme function,One-click to open dark mode.

分享给大家
I finally open sourced him,支持window和mac系统.I think I should also can use a year again.I haven't thought about it after all,There is a lazy way.

友情提醒: 如果要使用,In the end, it is necessary to configure personal space.If not configured,点击关注,We communicate in detail.每人10个g免费个人空间.不用白不用.当然如果需要的话,也可以学习一下.If you don't want to learn, don't bother,After all, it takes some brains.

边栏推荐
- C语言学习书籍(提高篇)
- Data visualization ---- web page displays temperature and humidity
- ESP8266-Arduino programming example-I2C device address scan
- Monitoring basic resources through observation cloud monitor, automatic alarm
- Safe Browser will have these hidden features that will let you play around with your browser
- m10
- 【体系结构 三 流水线技术】
- [数学基础]线性代数相关概念学习
- ESP8266-Arduino programming example-EEPROM read and write
- HbuilderX打包app,Hbuilder怎么打包app,H5打包成app,H5怎么打包成app「建议收藏」
猜你喜欢
随机推荐
2022中国物流产业大会暨企业家高峰论坛在杭州举办!
GNOME将在Secure Boot被禁用时向用户发出警告 并准备提供安全帮助
简单说说K均值聚类
笛卡尔树(暑假每日一题 9)
internship:利用easypoi将excel表数据导入导出
【Autosar vLinkGen 链接器脚本生成器】
sad rock
HbuilderX打包app,Hbuilder怎么打包app,H5打包成app,H5怎么打包成app「建议收藏」
Expert advice | How to formulate a growth strategy for survival in an economic downturn
软件开发模式有哪些(软件工程开发模式)
ESP8266-Arduino programming example-LittleFS and data upload
leetcode:952. 按公因数计算最大组件大小【并查集】
【AutoSAR 七 工具链简介】
OAuth2认证
安全浏览器将拥有这些隐藏功能,让你玩转浏览器
敏捷组织 | 企业克服数字化浪潮冲击的路径
Monitoring basic resources through observation cloud monitor, automatic alarm
LeetCode 1047 Remove all adjacent duplicates in a string
正则表达式
【体系结构 三 流水线技术】

![[GXYCTF2019]禁止套娃](/img/91/3f64bebd13a8b13fbb387c2acf8618.png)


![[数学基础]线性代数相关概念学习](/img/4c/d43fb47ff5b99998660a679b20699c.png)

![[数学基础]概率论与数理统计相关概念学习](/img/bc/d3a246240ff7aca2b84c3766383758.png)


