ytcollector 1.0.4__py3-none-any.whl → 1.0.5__py3-none-any.whl

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/__init__.py CHANGED
@@ -3,7 +3,7 @@ SBS Dataset Collector - YouTube 영상 수집 및 YOLO-World 검증 파이프라
3
3
  """
4
4
  from pathlib import Path
5
5
 
6
- __version__ = "1.0.4"
6
+ __version__ = "1.0.5"
7
7
  __author__ = "SBS Dataset Team"
8
8
 
9
9
  # Package root directory
ytcollector/cli.py CHANGED
@@ -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
- # 파일 경로: video/{task}/youtube_url.txt
52
- txt_file = get_url_file_path(base_dir, args.task)
51
+ # argparse에서 nargs='+'로 받아오면 args.task는 항상 리스트
52
+ tasks = args.task if isinstance(args.task, list) else [args.task]
53
53
 
54
- if not txt_file.exists():
55
- logger.error(f"URL file not found: {txt_file}")
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
- success_count = sum(1 for r in results if r.get('success'))
68
- print(f" Download complete: {success_count}/{len(results)} successful")
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ytcollector
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: SBS 데이터셋 수집기
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -1,12 +1,12 @@
1
1
  config/settings.py,sha256=RcK41kaUC0zam5SsdXfb7u_qjM_TlJDa0a8hC_MGacQ,1197
2
- ytcollector/__init__.py,sha256=6gfthb-C32RDhgM7eJeMql7HSQjxcgRFQesqoRjV6gg,365
3
- ytcollector/cli.py,sha256=bp9DnVD0bgSHD2sf8no_6s9uZHA7SjYQWdPA-3HaRBY,7720
2
+ ytcollector/__init__.py,sha256=JRX6gn5SOiHpAiuuD7x8Ist8ZWI8zNujw78pNwGsmK8,365
3
+ ytcollector/cli.py,sha256=meCnT3cMBF15AkHpPeUdCFjL6WHZI-UB_F1echeU6is,8328
4
4
  ytcollector/config.py,sha256=SPhdw78A9v6ZEI7ykMi_37--BGdWg5hmgZkawFxfxjg,2436
5
5
  ytcollector/downloader.py,sha256=3Y54mudqQ1LqfFtKrU3uloNp2Oz-hcf28GwEI6eDUa0,14944
6
6
  ytcollector/utils.py,sha256=gInDx6adV-SfQ2SH5_i8w1gvYL-Nsmz1e1W__gCdVH8,4654
7
7
  ytcollector/verifier.py,sha256=8Nn3b6fTQYxCGPt01kJMDSZ2hy8gk54deSayOpBuY48,6286
8
- ytcollector-1.0.4.dist-info/METADATA,sha256=s-AAzo8l9x0baBMRcHQnIryHFmyjw3RbFqPn6EiZo6Y,3543
9
- ytcollector-1.0.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
10
- ytcollector-1.0.4.dist-info/entry_points.txt,sha256=PoanZbxogGnV4tLcZZkla0Yh7OvPtqcukDYr563w5RA,53
11
- ytcollector-1.0.4.dist-info/top_level.txt,sha256=TVfBZHJgYRfSSTgLJELvOoMA55qR8kWuxtiIaItwzIQ,19
12
- ytcollector-1.0.4.dist-info/RECORD,,
8
+ ytcollector-1.0.5.dist-info/METADATA,sha256=VRpphUKlM4HelokurDjF6w3cSzYKfIzBVC7JwLO3rLY,3543
9
+ ytcollector-1.0.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
10
+ ytcollector-1.0.5.dist-info/entry_points.txt,sha256=PoanZbxogGnV4tLcZZkla0Yh7OvPtqcukDYr563w5RA,53
11
+ ytcollector-1.0.5.dist-info/top_level.txt,sha256=TVfBZHJgYRfSSTgLJELvOoMA55qR8kWuxtiIaItwzIQ,19
12
+ ytcollector-1.0.5.dist-info/RECORD,,