Download our e-book of Introduction To Python
Nishant Rathi
3 years ago
import urllib3 import os url =
"https://authoraditiagarwal.com/wpcontent/uploads/2018/05/MetaSlider_ThinkBig-1080x180.jpg"
a = urlparse(url)
a.path
Date Server
Upgrade Connection
Last-Modified
Accept-Ranges
Content-Length
Keep-Alive
Content-Type
for infile in
glob.glob("ThinkBig.png"):
img =
Image.open(infile)
img.thumbnail((128,
128), Image.ANTIALIAS)
if
infile[0:2] != "Th_":
img.save("Th_"
+ infile, "png")
From selenium import webdriver
path = r'C:\\Users\\neha\\Desktop\\Chromedriver'
browser =
webdriver.Chrome(executable_path = path) browser.get('https://tutorialspoint.com/')
screenshot =
browser.save_screenshot('screenshot.png')
browser.quit
DevTools listening on ws://127.0.0.1:1456/devtools/browser/488ed704-9f1b-44f0- a571-892dc4c90eb7 >
import subprocess
video_MP4_file = “C:\Users\neha\desktop\solar.mp4”
thumbnail_image_file =
'thumbnail_solar_video.jpg'
subprocess.call(['ffmpeg', '-i',
video_MP4_file, '-ss', '00:00:20.000', '- vframes', '1', thumbnail_image_file,
"-y"])
import moviepy.editor as mp
clip =
mp.VideoFileClip(r"C:\Users\gaurav\Desktop\1234.mp4")
clip.audio.write_audiofile("movie_audio.mp3")
[MoviePy] Writing audio in movie_audio.mp3 100%|¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 674/674 [00:01<00:00, 476.30it/s] [MoviePy] Done.