📅  最后修改于: 2022-03-11 14:47:09.631000             🧑  作者: Mango
import pafy
# callback function, this callback simply prints the bytes received,
# ratio downloaded and eta.
def mycb(total, recvd, ratio, rate, eta):
print(recvd, ratio, eta)
p = pafy.new("cyMHZVT91Dw")
ba = p.getbestaudio()
filename = ba.download(quiet=True, callback=mycb)