Python code To download from Youtube ⚙
from pytube import YouTube
# Enter the YouTube video URL
url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# Create a YouTube object with the URL
yt = YouTube(url)
# Select the highest resolution video
video = yt.streams.get_highest_resolution()
# Set the output directory and filename
output_dir = "/storage/emulated/0/Documents/"
filename = yt.title+".mp4"
# Download the video
video.download(output_dir, filename)
print(f"Download complete: {filename}")
👍10
Coffee Break Python .pdf
33.8 MB
Coffee Break - Python ✅
50 Workouts to Kickstart your career
50 Workouts to Kickstart your career
Top 50 Coding Questions.pdf
3.3 MB
Top 50 Coding Questions ✅
👍11
1.1 5.2.Python String Coding Interview Questions.pdf
499 KB
Python String Coding Interview Questions.pdf
How to convert image to pdf in Python
# Python3 program to convert image to pfd
# using img2pdf library
# importing necessary libraries
import img2pdf
from PIL import Image
import os
# storing image path
img_path = "Input.png"
# storing pdf path
pdf_path = "file_pdf.pdf"
# opening image
image = Image.open(img_path)
# converting into chunks using img2pdf
pdf_bytes = img2pdf.convert(image.filename)
# opening or creating pdf file
file = open(pdf_path, "wb")
# writing pdf files with chunks
file.write(pdf_bytes)
# closing image file
image.close()
# closing pdf file
file.close()
# output
print("Successfully made pdf file")
pip3 install pillow && pip3 install img2pdf
👍29👎1
Automate_the_Boring_Stuff_with_Python,_2nd_Edition_Practical_Programming.pdf
13.7 MB
One of the best books to learn python
👍15
Python_Tips_and_Tricks_A_Collection_of_100_Basic_&_Intermediate.pdf
3 MB
Python Tips and Tricks
Benjamin Bennett Alexander, 2022
Benjamin Bennett Alexander, 2022
👍15