Skip to content

Commit

Permalink
Merge pull request #978 from yashksaini-coder/yash/fix-946
Browse files Browse the repository at this point in the history
✅ [Code Addition Request]: Playlist downloader
  • Loading branch information
UTSAVS26 authored Oct 31, 2024
2 parents 1b77c60 + 28fe492 commit da886e8
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from pytube import Playlist
def download(playlist_id,download_path):
try:
playlist_url = 'https://www.youtube.com/playlist?list=' +playlist_id
# Create a Playlist object
playlist = Playlist(playlist_url)
# download_path=r'{}'.format(download_path)
# Specify the directory where you want to save the downloaded videos
# Iterate through each video in the playlist and download it to the specified directory
for video in playlist.videos:
try:
print(f'Downloading: {video.title}')
video.streams.get_highest_resolution().download(output_path=download_path)
print(f'{video.title} downloaded successfully!')
except Exception as e:
print(e)
except Exception as e:
print(e)
4 changes: 4 additions & 0 deletions Automation_Tools/Playlist-downloader/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pytube == 15.0.0
setuptools==69.0.3
wheel==0.40.0
twine==5.1.1
11 changes: 11 additions & 0 deletions Automation_Tools/Playlist-downloader/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from setuptools import setup
setup(name="Playlist_downloader",
version="1.0",
description="Playlist Downloader simplifies the process of downloading YouTube playlists by providing a straightforward API to fetch and save videos from a given playlist URL.",
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
author="Yash Kumar Saini",
packages=['Playlist_downloader'],
license="MIT",
install_requires=['pytube']
)
2 changes: 2 additions & 0 deletions Project-Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@
* [Extract Aadhar Details](Automation_Tools/Autofill%20personal%20info%20using%20Aadhar%20Card%20Image/extract_aadhar_details.ipynb)
* Image-Tool
* [Image Tool](Automation_Tools/Image-Tool/Image_Tool.py)
* Playlist-Downloader
* [Setup](Automation_Tools/Playlist-downloader/setup.py)
* Web Scrapping
* [Webscrapping](Automation_Tools/Web%20Scrapping/WebScrapping.ipynb)
* Linkedin Scraper
Expand Down

0 comments on commit da886e8

Please sign in to comment.