社招新人培训考试答案+图床批量上传脚本

社招新人培训考试答案+图床批量上传脚本

考试答案









































图床批量上传脚本

proxychains4 python3 upload_image.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pyimgur
import os

picture_path=os.system("ls /home/kali/Pictures/123/> /tmp/picture.txt")
path='/home/kali/Pictures/123/'
CLIENT_ID = "xxxxxxxxxxxxx"
#PATH = "/home/kali/Pictures/Screenshot_2021-05-14_22_09_47.png"
im = pyimgur.Imgur(CLIENT_ID)

markdown_image = open('/tmp/markdown_image.txt','w')
with open('/tmp/picture.txt','r') as f:
for i in f.readlines():
PATH = path+i
print(PATH)
uploaded_image = im.upload_image(PATH.strip('\n'), title="Uploaded with PyImgur")
print(uploaded_image.title)
markdown_image.write("![]("+uploaded_image.link+")")
print(uploaded_image.link)
print(uploaded_image.size)
print(uploaded_image.type)
markdown_image.close()
print("please use 'cat /tmp/markdown_image.txt' to view the markdown image path")

参考资料