openload upload api(python 版)
import os import requests import urllib.request import re import hashlib def upto_openload(files): dir0 = str(os.getcwd()).replace(‘\\’, ‘/’) os.chdir(dir0) sha1 = hashlib.sha1() BLOCKSIZE = 65536 with open(files, ‘rb’) as afile: buf = afile.read(BLOCKSIZE) while len(buf) > 0: sha1.update(buf) buf = afile.read(BLOCKSIZE) sha1_hash = sha1.hexdigest() url = “https://api.openload.co/1/file/ul?login={login}&key={key}&sha1={sha1}”.format( login=’xxxxxxx’, key=’xxxxxx’, sha1=sha1_hash, ) p = { ‘url’: url, ‘headers’: […]
. Read more
