福利 下载小视频


#coding = utf-8

'''
desc:
function:
author : 'ww' 
qq:903787614
微信:w903787614
欢迎交流
date : "2019/1/12 11:29 "
'''

from tkinter import *
import tkinter
import requests
import time
n = int(input('号码'))
root = Tk()
headers = {'content-type': 'application/json',
           'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0'}
def begin():

    for m in range(10):
        p = str(m + n)
        file_url = "http://192.240.120.34//mp43/" + p + ".mp4"
        print(file_url)
        r = requests.get(file_url, stream=True,headers=headers)
        
        print(r)
        with open('f:/' +p + ".mp4", "wb") as pdf:
            i = 0
            for chunk in r.iter_content(chunk_size=1024*1024):
                if chunk:
                    print(i)
                    pdf.write(chunk)
                    i += 1
root.bind()
button = tkinter.Button(root,text='开始',command=begin)
button1 = Button(root,text='停止',command=root.quit)
button.pack()
button1.pack()
root.mainloop()

网址:http://192.240.120.34//mp43/300000.mp4

更换300000可更换视频,目前更新到305000吧

你可能感兴趣的:(技术交流)