ytcollector 1.0.4__tar.gz → 1.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ytcollector-1.0.4 → ytcollector-1.0.5}/PKG-INFO +1 -1
- {ytcollector-1.0.4 → ytcollector-1.0.5}/pyproject.toml +1 -1
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector/__init__.py +1 -1
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector/cli.py +33 -19
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector.egg-info/PKG-INFO +1 -1
- {ytcollector-1.0.4 → ytcollector-1.0.5}/README.md +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/config/settings.py +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/setup.cfg +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector/config.py +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector/downloader.py +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector/utils.py +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector/verifier.py +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector.egg-info/SOURCES.txt +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector.egg-info/dependency_links.txt +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector.egg-info/entry_points.txt +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector.egg-info/requires.txt +0 -0
- {ytcollector-1.0.4 → ytcollector-1.0.5}/ytcollector.egg-info/top_level.txt +0 -0
|
@@ -48,24 +48,38 @@ def run_download(args):
|
|
|
48
48
|
|
|
49
49
|
base_dir = Path(args.dir) if args.dir else Path.cwd()
|
|
50
50
|
|
|
51
|
-
#
|
|
52
|
-
|
|
51
|
+
# argparse에서 nargs='+'로 받아오면 args.task는 항상 리스트
|
|
52
|
+
tasks = args.task if isinstance(args.task, list) else [args.task]
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
logger.info("Run 'downloader init' first to create project structure")
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
logger.info(f"Starting{' fast' if args.fast else ''} download for task: {args.task}")
|
|
60
|
-
|
|
61
|
-
if args.fast:
|
|
62
|
-
from .downloader import download_from_txt_parallel
|
|
63
|
-
results = download_from_txt_parallel(txt_file, args.task, base_dir, max_count=args.count)
|
|
64
|
-
else:
|
|
65
|
-
results = download_from_txt(txt_file, args.task, base_dir, max_count=args.count)
|
|
54
|
+
total_success = 0
|
|
55
|
+
total_processed = 0
|
|
66
56
|
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
for task in tasks:
|
|
58
|
+
logger.info(f"=== Processing Task: {task} ===")
|
|
59
|
+
|
|
60
|
+
# 파일 경로: video/{task}/youtube_url.txt
|
|
61
|
+
txt_file = get_url_file_path(base_dir, task)
|
|
62
|
+
|
|
63
|
+
if not txt_file.exists():
|
|
64
|
+
logger.error(f"URL file not found: {txt_file}")
|
|
65
|
+
logger.info(f"Skipping {task}. Run 'ytcollector init' first.")
|
|
66
|
+
continue
|
|
67
|
+
|
|
68
|
+
logger.info(f"Starting{' fast' if args.fast else ''} download for task: {task}")
|
|
69
|
+
|
|
70
|
+
if args.fast:
|
|
71
|
+
from .downloader import download_from_txt_parallel
|
|
72
|
+
results = download_from_txt_parallel(txt_file, task, base_dir, max_count=args.count)
|
|
73
|
+
else:
|
|
74
|
+
results = download_from_txt(txt_file, task, base_dir, max_count=args.count)
|
|
75
|
+
|
|
76
|
+
success_count = sum(1 for r in results if r.get('success'))
|
|
77
|
+
total_success += success_count
|
|
78
|
+
total_processed += len(results)
|
|
79
|
+
|
|
80
|
+
print(f"✓ Task '{task}' complete: {success_count}/{len(results)} successful")
|
|
81
|
+
|
|
82
|
+
print(f"\n✓ All tasks complete: {total_success}/{total_processed} successful total")
|
|
69
83
|
|
|
70
84
|
|
|
71
85
|
def run_download_single(args):
|
|
@@ -172,7 +186,7 @@ Examples:
|
|
|
172
186
|
|
|
173
187
|
# Download
|
|
174
188
|
download_parser = subparsers.add_parser('download', help='Download from youtube_url.txt')
|
|
175
|
-
download_parser.add_argument('--task', '-t', required=True, choices=VALID_TASKS)
|
|
189
|
+
download_parser.add_argument('--task', '-t', required=True, nargs='+', choices=VALID_TASKS, help='One or more tasks (e.g. face tattoo)')
|
|
176
190
|
download_parser.add_argument('--count', '-n', type=int, help='Max videos to collect (default: 1000)')
|
|
177
191
|
download_parser.add_argument('--fast', action='store_true', help='Enable fast parallel downloading')
|
|
178
192
|
|
|
@@ -185,12 +199,12 @@ Examples:
|
|
|
185
199
|
|
|
186
200
|
# Verify
|
|
187
201
|
verify_parser = subparsers.add_parser('verify', help='Verify with YOLO-World')
|
|
188
|
-
verify_parser.add_argument('--task', '-t', required=True, choices=VALID_TASKS)
|
|
202
|
+
verify_parser.add_argument('--task', '-t', required=True, nargs='+', choices=VALID_TASKS)
|
|
189
203
|
verify_parser.add_argument('--video', '-v', help='Specific video file')
|
|
190
204
|
|
|
191
205
|
# Pipeline
|
|
192
206
|
pipeline_parser = subparsers.add_parser('pipeline', help='Full pipeline')
|
|
193
|
-
pipeline_parser.add_argument('--task', '-t', required=True, choices=VALID_TASKS)
|
|
207
|
+
pipeline_parser.add_argument('--task', '-t', required=True, nargs='+', choices=VALID_TASKS)
|
|
194
208
|
pipeline_parser.add_argument('--verify', action='store_true')
|
|
195
209
|
|
|
196
210
|
# List tasks
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|