This commit is contained in:
AI Assistant
2026-03-12 13:46:10 +09:00
parent a31a538cd8
commit c4f495b566
10 changed files with 0 additions and 580 deletions

View File

@@ -1,40 +0,0 @@
import os
import sys
import argparse
import yt_dlp
def progress_hook(d):
if d['status'] == 'downloading':
percent = d.get('_percent_str', 'N/A')
print(f"PROGRESS: {percent}", flush=True)
def main():
parser = argparse.ArgumentParser(description="Media Downloader via yt-dlp")
parser.add_argument("url", help="URL of the media to download")
parser.add_argument("--start", help="Start time for crop (e.g. 00:01:00)", default=None)
parser.add_argument("--end", help="End time for crop (e.g. 00:02:30)", default=None)
args = parser.parse_args()
ydl_opts = {
'outtmpl': '/downloads/%(title)s.%(ext)s',
'progress_hooks': [progress_hook],
'quiet': True,
'no_warnings': True,
}
if args.start and args.end:
print(f"Applying crop from {args.start} to {args.end}")
# Note: In a real environment, you might use format sorting and postprocessors like FFmpeg directly.
# This is a sample placeholder for the structure.
# Try downloading
try:
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
print("Download started...")
ydl.download([args.url])
print("Download finished.")
except Exception as e:
print(f"Error starting download: {e}", file=sys.stderr)
if __name__ == "__main__":
main()

View File

@@ -1 +0,0 @@
yt-dlp>=2023.10.13