minor cleanup and updates
This commit is contained in:
parent
538b91acec
commit
429511f96e
2
app.py
2
app.py
@ -4,9 +4,9 @@ REST API for YouTube CLI application
|
||||
"""
|
||||
|
||||
import logging
|
||||
import subprocess
|
||||
from logging.handlers import RotatingFileHandler
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
|
||||
from flask import Flask, jsonify, request
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ name = "youtube-cli"
|
||||
version = "0.1.0"
|
||||
description = "A command-line interface for browsing and downloading YouTube videos"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.7"
|
||||
requires-python = ">=3.10"
|
||||
authors = [
|
||||
{name = "Your Name", email = "your.email@example.com"},
|
||||
]
|
||||
@ -24,9 +24,7 @@ classifiers = [
|
||||
"Operating System :: MacOS",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
"Programming Language :: Python :: 3 :: Only",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
@ -34,7 +32,7 @@ classifiers = [
|
||||
"Topic :: Utilities",
|
||||
]
|
||||
dependencies = [
|
||||
"yt-dlp>=2023.12.0",
|
||||
"yt-dlp==2026.3.3",
|
||||
"rich>=13.0.0",
|
||||
"requests>=2.28.0",
|
||||
]
|
||||
@ -80,14 +78,14 @@ python_functions = ["test_*"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 80
|
||||
target-version = "py37"
|
||||
target-version = "py310"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "W", "I"]
|
||||
ignore = ["E501"]
|
||||
|
||||
[tool.mypy]
|
||||
python_version = "3.10"
|
||||
python_version = "3.11"
|
||||
warn_return_any = true
|
||||
warn_unused_configs = true
|
||||
disallow_untyped_defs = false
|
||||
@ -121,4 +119,4 @@ ignore_missing_imports = true
|
||||
[[tool.mypy.overrides]]
|
||||
module = "youtube_tui.*"
|
||||
check_untyped_defs = true
|
||||
disallow_untyped_defs = true
|
||||
disallow_untyped_defs = true
|
||||
|
||||
@ -598,12 +598,8 @@ class YouTubeCLI:
|
||||
start, end = map(int, user_input.split("-"))
|
||||
video_indices = list(range(start, end + 1))
|
||||
except ValueError:
|
||||
logger.info(
|
||||
f"Invalid range format: {user_input}"
|
||||
)
|
||||
logger.info(
|
||||
"Please use format like '1-7' or '1,2,3'"
|
||||
)
|
||||
logger.info(f"Invalid range format: {user_input}")
|
||||
logger.info("Please use format like '1-7' or '1,2,3'")
|
||||
return
|
||||
else:
|
||||
# Handle comma-separated numbers
|
||||
@ -1031,9 +1027,7 @@ class YouTubeCLI:
|
||||
|
||||
# Show what format will be used for download (if available)
|
||||
if "format" in ytdlp_args:
|
||||
logger.info(
|
||||
f"Using custom format: {ytdlp_args['format']}"
|
||||
)
|
||||
logger.info(f"Using custom format: {ytdlp_args['format']}")
|
||||
else:
|
||||
logger.info("Using 1080p quality by default")
|
||||
|
||||
@ -1061,9 +1055,7 @@ class YouTubeCLI:
|
||||
return False
|
||||
|
||||
if result.returncode == 0:
|
||||
logger.info(
|
||||
"Playlist download completed successfully!"
|
||||
)
|
||||
logger.info("Playlist download completed successfully!")
|
||||
|
||||
# Copy to network share if specified
|
||||
if network_folder:
|
||||
@ -1095,9 +1087,7 @@ class YouTubeCLI:
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
logger.info(
|
||||
f"Could not track playlist in archive: {e}"
|
||||
)
|
||||
logger.info(f"Could not track playlist in archive: {e}")
|
||||
else:
|
||||
logger.info(
|
||||
f"Playlist download failed with return code {result.returncode}"
|
||||
@ -1107,9 +1097,7 @@ class YouTubeCLI:
|
||||
logger.info(result.stdout)
|
||||
|
||||
except Exception as e:
|
||||
logger.info(
|
||||
f"[red]Error during playlist download: {str(e)}[/red]"
|
||||
)
|
||||
logger.info(f"[red]Error during playlist download: {str(e)}[/red]")
|
||||
|
||||
|
||||
def signal_handler(sig, frame):
|
||||
@ -1170,9 +1158,7 @@ def main():
|
||||
if args.download:
|
||||
# Handle download functionality
|
||||
if not args.query:
|
||||
logger.info(
|
||||
"Error: You must provide a video URL for downloading"
|
||||
)
|
||||
logger.info("Error: You must provide a video URL for downloading")
|
||||
return
|
||||
# For direct download, we'll ask for category selection
|
||||
cli.download_video(args.query, cli.config, category=None)
|
||||
|
||||
@ -6,7 +6,6 @@ Enhanced with command palette, help screen, status bar, and theme support
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
from datetime import datetime
|
||||
from logging.handlers import RotatingFileHandler
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user