1
1
mirror of https://github.com/neosubhamoy/pytubepp.git synced 2026-02-04 18:22:23 +05:30

4 Commits

3 changed files with 19 additions and 5 deletions

View File

@@ -1,13 +1,14 @@
# pytubePP - (Pytube Post Processor) # PytubePP - (Pytube Post Processor)
### A Simple CLI Tool to Download Your Favourite YouTube Videos Effortlessly! ### A Simple CLI Tool to Download Your Favourite YouTube Videos Effortlessly!
[![status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat)](https://github.com/neosubhamoy/pytubepp/) [![status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat)](https://github.com/neosubhamoy/pytubepp/)
[![verion](https://img.shields.io/badge/version-v1.0.4_stable-yellow.svg?style=flat)](https://github.com/neosubhamoy/pytubepp/) [![verion](https://img.shields.io/badge/version-v1.0.5_stable-yellow.svg?style=flat)](https://github.com/neosubhamoy/pytubepp/)
[![python](https://img.shields.io/badge/python-v3.12.x-blue?logo=python&style=flat)](https://www.python.org/downloads/) [![python](https://img.shields.io/badge/python-v3.12.x-blue?logo=python&style=flat)](https://www.python.org/downloads/)
[![builds](https://img.shields.io/badge/builds-passing-brightgreen.svg?style=flat)](https://github.com/neosubhamoy/pytubepp/) [![builds](https://img.shields.io/badge/builds-passing-brightgreen.svg?style=flat)](https://github.com/neosubhamoy/pytubepp/)
[![PRs](https://img.shields.io/badge/PRs-welcome-blue.svg?style=flat)](https://github.com/neosubhamoy/pytubepp/) [![PRs](https://img.shields.io/badge/PRs-welcome-blue.svg?style=flat)](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 Computer and add [PytubePP Extension](https://github.com/neosubhamoy/pytubepp-extension) in your Browser to get started.
### **🏷️ Features** ### **🏷️ Features**
* Auto Post-Process & Merge YouTube DASH Streams * Auto Post-Process & Merge YouTube DASH Streams

View File

@@ -3,7 +3,16 @@ from mutagen.id3 import ID3, APIC, TIT2, TPE1, TALB
from tabulate import tabulate from tabulate import tabulate
from tqdm import tqdm from tqdm import tqdm
from importlib.metadata import version 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(): def get_version():
try: try:
@@ -232,6 +241,10 @@ def is_valid_url(url):
return match return match
def set_global_video_info(link): 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): if is_valid_url(link):
global video, author, title, thumbnail, views, stream, stream_resolutions, maxres global video, author, title, thumbnail, views, stream, stream_resolutions, maxres
link = is_valid_url(link).group(1) link = is_valid_url(link).group(1)
@@ -621,7 +634,7 @@ def main():
print(f'\ndownloadDIR: {downloadDIR}\ntempDIR: {tempDIR}\nconfigDIR: {configDIR}\ndefaultStream: {defaultStream}\n') print(f'\ndownloadDIR: {downloadDIR}\ntempDIR: {tempDIR}\nconfigDIR: {configDIR}\ndefaultStream: {defaultStream}\n')
if args.version: if args.version:
print(f'\npytubePP (Pytube Post Processor) - version: {version}\n') print(f'pytubepp {version}')
if args.show_info: if args.show_info:
print('\nNo video url supplied! exiting...!!') print('\nNo video url supplied! exiting...!!')

View File

@@ -6,7 +6,7 @@ with open('README.md', 'r', encoding='utf8') as file:
setup( setup(
name='pytubepp', name='pytubepp',
version='1.0.4', version='1.0.5',
description='A Simple CLI Tool to Download Your Favorite YouTube Videos Effortlessly!', description='A Simple CLI Tool to Download Your Favorite YouTube Videos Effortlessly!',
long_description=readme, long_description=readme,
long_description_content_type='text/markdown', long_description_content_type='text/markdown',