Skip to content

Commit

Permalink
Add upgrade option to yt-dlp installation in ytclip
Browse files Browse the repository at this point in the history
  • Loading branch information
zackees committed Jul 25, 2024
1 parent 3f0fb90 commit 2c812e3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .aiderignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Add files or directories to ignore here

run
lint
test
install
clean
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,7 @@ dmypy.json

# Pyre type checker
.pyre/

.aider*
!.aider.conf.yml
!.aiderignore
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# content of: tox.ini , put in same dir as setup.py
[tox]
envlist = py36,py38
envlist = py310

[flake8]
per-file-ignores = __init__.py:F401
Expand Down
8 changes: 8 additions & 0 deletions ytclip/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,18 @@ def run() -> int: # pylint: disable=too-many-branches,too-many-statements
)
parser.add_argument("--outname", help="output name of the file (auto saved as mp4)")
parser.add_argument("--keep", action="store_true", help="keeps intermediate files")
parser.add_argument("--upgrade", action="store_true", help="Upgrades yt-dlp")
args = parser.parse_args()
if args.version:
print(f"{VERSION}")
return 0

if args.upgrade:
# get pip from the current python environment
python_exe = sys.executable
cmd = f'"{python_exe}" -m pip install --upgrade yt-dlp'
print(f"Running: {cmd}")
os.system(cmd)

if args.concurrent:
run_concurrent()
Expand Down

0 comments on commit 2c812e3

Please sign in to comment.