mirror of
https://github.com/neosubhamoy/pytubepp.git
synced 2026-02-04 10:22:21 +05:30
Compare commits
7 Commits
v1.0.4-sta
...
v1.0.6-sta
23
README.md
23
README.md
@@ -1,13 +1,14 @@
|
||||
# pytubePP - (Pytube Post Processor)
|
||||
# PytubePP - (Pytube Post Processor)
|
||||
|
||||
### A Simple CLI Tool to Download Your Favourite YouTube Videos Effortlessly!
|
||||
|
||||
[](https://github.com/neosubhamoy/pytubepp/)
|
||||
[](https://github.com/neosubhamoy/pytubepp/)
|
||||
[](https://github.com/neosubhamoy/pytubepp/)
|
||||
[](https://www.python.org/downloads/)
|
||||
[](https://github.com/neosubhamoy/pytubepp/)
|
||||
[](https://github.com/neosubhamoy/pytubepp/)
|
||||
|
||||
😀 GOOD NEWS: If you are Windows(10/11) user and don't want to bother remembering PytubePP Commands! (You are not familier with Command Line Tools). We recently released a Browser Extension that can auto detect YouTube Videos and You can download the Video in one click directly from the browser using PytubePP CLI. Install [PytubePP Helper](https://github.com/neosubhamoy/pytubepp-helper) app in your System and add [PytubePP Extension](https://github.com/neosubhamoy/pytubepp-extension) in your Browser to get started.
|
||||
|
||||
### **🏷️ Features**
|
||||
* Auto Post-Process & Merge YouTube DASH Streams
|
||||
@@ -28,23 +29,29 @@
|
||||
* [setuptools](https://pypi.org/project/setuptools/)
|
||||
|
||||
### **🛠️ Installation**
|
||||
You can install pytubePP in your system via PIP by simply running the below command
|
||||
You can install PytubePP in your system via PIP by simply running the below command
|
||||
|
||||
```terminal
|
||||
pip install pytubepp
|
||||
```
|
||||
**IMPORTANT: Before installing pytubePP make sure FFmpeg is installed in your system and accesable via your cli interface (FFmpeg is Must Required as some of the core features of pytubePP relies on FFmpeg, but due to security reasons we can not ship it with the module)**
|
||||
**IMPORTANT: Before installing PytubePP make sure FFmpeg is installed in your system and accesable via your cli interface (FFmpeg is Must Required as some of the core features of pytubePP relies on FFmpeg, but due to security reasons we can not ship it with the module)**
|
||||
|
||||
**>> Install FFmpeg (If you haven't already!)**
|
||||
|
||||
Linux (Ubuntu): `apt install ffmpeg`<br>
|
||||
Linux (Ubuntu): `sudo apt install ffmpeg`<br>
|
||||
Linux (Fedora): `sudo dnf install ffmpeg-free`<br>
|
||||
Windows (10/11): `winget install ffmpeg`<br>
|
||||
MacOS (using Homebrew): `brew install ffmpeg`<br>
|
||||
Android (using Termux): `pkg install ffmpeg`
|
||||
|
||||
**NOTE: Always make sure 'PytubePP' and 'Pytubefix' is on the latest version to avoid issues (update them at least once a week) (Use the command below to update)**
|
||||
```
|
||||
pip install pytubefix pytubepp --upgrade
|
||||
```
|
||||
|
||||
### **📌 Commands and Flags**
|
||||
Using pytubePP is as simple as just supplying it only the YouTube video url as argument!
|
||||
** Before Starting Please NOTE: pytubePP follows a simple rule - "Use the Default Download Configuration if No Flags are Passed"
|
||||
Using PytubePP is as simple as just supplying it only the YouTube video url as argument!
|
||||
** Before Starting Please NOTE: PytubePP follows a simple rule - "Use the Default Download Configuration if No Flags are Passed"
|
||||
* To download a video in maximum available resolution the command will look like:
|
||||
```terminal
|
||||
pytubepp "https://youtube.com/watch?v=2lAe1cqCOXo"
|
||||
@@ -79,7 +86,7 @@ pytubepp "https://youtube.com/watch?v=2lAe1cqCOXo" -i
|
||||
|
||||
### 📝 License & Usage
|
||||
|
||||
pytubePP - (Pytube Post Processor) is a Fully Open Sourced Project licensed under MIT License. Anyone can view, modify, use (personal and commercial) or distribute it's sources without any attribution and extra permissions.
|
||||
PytubePP - (Pytube Post Processor) is a Fully Open Sourced Project licensed under MIT License. Anyone can view, modify, use (personal and commercial) or distribute it's sources without any attribution and extra permissions.
|
||||
|
||||
**🌟 Liked this project? Please consider giving it a star to show me your appreciation**
|
||||
<br></br>
|
||||
|
||||
@@ -3,7 +3,16 @@ from mutagen.id3 import ID3, APIC, TIT2, TPE1, TALB
|
||||
from tabulate import tabulate
|
||||
from tqdm import tqdm
|
||||
from importlib.metadata import version
|
||||
import appdirs, ffmpy, requests, re, os, sys, random, shutil, platform, json, argparse, tempfile
|
||||
import appdirs, ffmpy, requests, re, os, sys, random, shutil, platform, json, argparse, tempfile, subprocess
|
||||
|
||||
def network_available():
|
||||
try:
|
||||
param = '-n' if platform.system().lower() == 'windows' else '-c'
|
||||
command = ['ping', param, '1', 'youtube.com']
|
||||
subprocess.run(command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True)
|
||||
return True
|
||||
except subprocess.CalledProcessError:
|
||||
return False
|
||||
|
||||
def get_version():
|
||||
try:
|
||||
@@ -85,7 +94,7 @@ def merge_audio_video(title, resolution, file_extention, random_filename, tempDI
|
||||
ff.run(stdout=devnull, stderr=devnull)
|
||||
devnull.close()
|
||||
|
||||
os.rename(output_temp_file, output_file)
|
||||
shutil.move(output_temp_file, output_file)
|
||||
postprocess_cleanup(tempDIR, ['_vdo.' + file_extention, '_ado.' + file_extention, '_merged.' + file_extention], random_filename)
|
||||
print('Done! 🎉')
|
||||
|
||||
@@ -133,7 +142,7 @@ def convert_to_mp3(title, thumbnail_url, random_filename, mp3_artist='Unknown',
|
||||
))
|
||||
audio.save()
|
||||
|
||||
os.rename(output_temp_file, output_file)
|
||||
shutil.move(output_temp_file, output_file)
|
||||
postprocess_cleanup(tempDIR, ['_thumbnail.jpg', '_thumbnail.mp4', '_ado.mp4', '_merged.mp4'], random_filename)
|
||||
print('Done! 🎉')
|
||||
|
||||
@@ -148,7 +157,7 @@ def download_progressive(stream, itag, title, resolution, file_extention, tempDI
|
||||
output_file = os.path.join(downloadDIR, get_unique_filename(title + '_' + resolution + '.' + file_extention))
|
||||
selected_vdo.download(output_path=tempDIR, filename=filename)
|
||||
print('Processing...')
|
||||
os.rename(output_temp_file, output_file)
|
||||
shutil.move(output_temp_file, output_file)
|
||||
print('Done! 🎉')
|
||||
|
||||
def download_nonprogressive(stream, itag_vdo, itag_ado, file_extention, output_path):
|
||||
@@ -232,6 +241,10 @@ def is_valid_url(url):
|
||||
return match
|
||||
|
||||
def set_global_video_info(link):
|
||||
if not network_available():
|
||||
print('\nRequest timeout! Please check your network and try again...!!')
|
||||
sys.exit()
|
||||
|
||||
if is_valid_url(link):
|
||||
global video, author, title, thumbnail, views, stream, stream_resolutions, maxres
|
||||
link = is_valid_url(link).group(1)
|
||||
@@ -621,7 +634,7 @@ def main():
|
||||
print(f'\ndownloadDIR: {downloadDIR}\ntempDIR: {tempDIR}\nconfigDIR: {configDIR}\ndefaultStream: {defaultStream}\n')
|
||||
|
||||
if args.version:
|
||||
print(f'\npytubePP (Pytube Post Processor) - version: {version}\n')
|
||||
print(f'pytubepp {version}')
|
||||
|
||||
if args.show_info:
|
||||
print('\nNo video url supplied! exiting...!!')
|
||||
|
||||
2
setup.py
2
setup.py
@@ -6,7 +6,7 @@ with open('README.md', 'r', encoding='utf8') as file:
|
||||
|
||||
setup(
|
||||
name='pytubepp',
|
||||
version='1.0.4',
|
||||
version='1.0.6',
|
||||
description='A Simple CLI Tool to Download Your Favorite YouTube Videos Effortlessly!',
|
||||
long_description=readme,
|
||||
long_description_content_type='text/markdown',
|
||||
|
||||
Reference in New Issue
Block a user