Home > other >  Python tkinter
Python tkinter

Time:02-22

This is the source code, is there any python senior bosses to help write a tkinter window


The import requests
The import re
The from bs4 import BeautifulSoup
The from tkinter import *
The from tkinter import messagebox
Print (" this program for b standing video covers a Python program to use Pyinstaller encapsulation ')
While True:
Try:
While True:
Ua={
'the user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64. X64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 '} # Ua disguise
Content=input (' the av input or BV number (please be sure to at the beginning and av or BV) : ')
Reset_content=f 'https://www.bilibili.com/video/{content}
Request=requests. Get (Reset_content, Ua) # access video page
Soup=BeautifulSoup (request. Text, 'LXML') # soup
Title=soup. Find find the title (' title ') #
X=STR (title)
RSTR=r "[\ \/\ \ \ \ *? " \ & lt; \ & gt; \ |] "# '\/: *? "& lt;> | '
New_title=re. Sub (RSTR, "", x) # replaced with underlined
New_new_title=new_title [28:] # remove useless characters
New_new_new_title=new_new_title # 34] [0: - get rid of useless characters
Image_json=soup. The find (' meta 'itemprop="image") # URL access to video cover
Image=image_json. Get (' content ') # find specific URL
Download=requests. Get images (image, Ua) # url
With the open (f '{new_new_new_title}. JPG', 'wb) as f: # download images
F.w rite (download. The content)
Print (f 'video entitled: {new_new_new_title} address is: the cover image, attach file is automatically saved to the application working directory')
Except:
Print (' mistakes, please check whether the AV or BV number is wrong ')
The continue

CodePudding user response:

Tkinter is don't understand
  • Related