Skip to content

Commit

Permalink
add num process as args
Browse files Browse the repository at this point in the history
  • Loading branch information
Jourdelune committed Sep 28, 2024
1 parent 4ddf197 commit b70dc90
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@
help="Use Tor proxy to make requests on youtube",
default=False,
)

argparser.add_argument(
"--num_processes",
type=int,
help="Number of processes to use for crawling",
default=10,
required=False,
)
args = argparser.parse_args()

if args.csv and args.file_name is None:
Expand All @@ -57,7 +63,9 @@

if line.startswith("youtube:"):
crawlers = YoutubeCrawler(
line.split(" ", 1)[1], callback=exporter, num_processes=10
line.split(" ", 1)[1],
callback=exporter,
num_processes=args.num_processes,
)
else:
crawlers = ArchiveCrawler(line.split(" ", 1)[1], callback=exporter)
Expand Down

0 comments on commit b70dc90

Please sign in to comment.