-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #978 from yashksaini-coder/yash/fix-946
✅ [Code Addition Request]: Playlist downloader
- Loading branch information
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
Automation_Tools/Playlist-downloader/Playlist_downloader/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters