https://github.com/vgvr0/download-youtube-shorts
Python Script to Download YouTube Shorts
https://github.com/vgvr0/download-youtube-shorts
python python-youtube-telegram telegram-downloader youtube-shorts-bot youtube-shorts-download
Last synced: 4 months ago
JSON representation
Python Script to Download YouTube Shorts
- Host: GitHub
- URL: https://github.com/vgvr0/download-youtube-shorts
- Owner: vgvr0
- Created: 2023-06-10T08:16:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T20:34:35.000Z (8 months ago)
- Last Synced: 2024-11-26T08:08:30.626Z (6 months ago)
- Topics: python, python-youtube-telegram, telegram-downloader, youtube-shorts-bot, youtube-shorts-download
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YouTube Shorts Downloader
This Python script allows you to download YouTube Shorts videos using the pytube library.
## Installation
Make sure you have Python installed on your machine. You can install the required library using pip:
```
pip install pytube
```## Usage
1. Import the `YouTube` class from the `pytube` library and define the `download_shorts` function in your Python script.
```python
from pytube import YouTubedef download_shorts(url):
try:
video = YouTube(url)
stream = video.streams.filter(file_extension='mp4', only_video=True).first()
if stream is not None:
stream.download()
print("Download complete.")
else:
print("No compatible video found.")
except Exception as e:
print("An error occurred during download:", str(e))# URL of the YouTube Shorts you want to download
shorts_url = "https://www.youtube.com/shorts/XXXXXXXXXXX"# Call the download function
download_shorts(shorts_url)
```2. Replace `'https://www.youtube.com/shorts/XXXXXXXXXXX'` with the URL of the YouTube Shorts you want to download.
3. Run the script and the Shorts video will be downloaded to your current directory.
## Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request to suggest improvements or report bugs.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.