Skip to content

Commit

Permalink
程序优化
Browse files Browse the repository at this point in the history
  • Loading branch information
danzhewuju committed Dec 7, 2018
1 parent 612c767 commit 98e5cfd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion UnitMysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def create_structured(cls):
"link char(200) DEFAULT NULL COMMENT '直播间链接'," \
"timestamp timestamp NULL DEFAULT NULL COMMENT '爬取时间', " \
"followers int(11) DEFAULT NULL COMMENT '关注人数', PRIMARY KEY (`id`))" \
"ENGINE=InnoDB AUTO_INCREMENT=511 DEFAULT CHARSET=utf8"
"ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8"

cur.execute(sql_str)
con.commit()
Expand Down
Binary file modified building/DouyuSpiderV2.exe
Binary file not shown.
32 changes: 32 additions & 0 deletions building/Unit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import hashlib
import os, sys


def CalcSha1(filepath):
with open(filepath, 'rb') as f:
sha1obj = hashlib.sha1()
sha1obj.update(f.read())
hash = sha1obj.hexdigest()
print(hash)
return hash


def CalcMD5(filepath):
f = open(filepath, 'rb')
md5obj = hashlib.md5()
md5obj.update(f.read())
hash = md5obj.hexdigest()
f.close()
print(hash)
name ="md5.txt"
f = open(name, 'a', encoding="UTF-8")
f.write(hash+"\n")
f.close()
return hash


if __name__ == "__main__":
hashfile = "./DouyuSpiderV2.exe"
CalcMD5(hashfile)


4 changes: 3 additions & 1 deletion building/md5.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
md5:87ccb8ffcfce03e7dc729bcf72dde75c
5f9d4b66aff48aa489c3d21292014251
5f9d4b66aff48aa489c3d21292014251
2438e7d718828c1fe1bbee53165d216d

0 comments on commit 98e5cfd

Please sign in to comment.