瀏覽代碼

Restore count estimates for debug use

Zachary Kotlarek 11 年之前
父節點
當前提交
1e039861ad
共有 1 個文件被更改,包括 4 次插入 和 0 次删除
  1. 4 0
      yt/subscribe.pl

+ 4 - 0
yt/subscribe.pl

@@ -990,6 +990,9 @@ sub findVideos($) {
 	my $totalCount = 0;
 	my $totalCount = 0;
 	LOOP:
 	LOOP:
 	{
 	{
+		if ($DEBUG && $totalCount) {
+			print STDERR 'Fetching ' . $count . ' of ' . $totalCount . ' (' . int(100 * $count / $totalCount) . "%)\n";
+		}
 
 
 		# Build, fetch, parse, check
 		# Build, fetch, parse, check
 		my $data = fetchParse('search', { 'channelId' => $id, 'pageToken' => $pageToken });
 		my $data = fetchParse('search', { 'channelId' => $id, 'pageToken' => $pageToken });
@@ -1024,6 +1027,7 @@ sub findVideos($) {
 				next;
 				next;
 			}
 			}
 			push(@ids, $item->{'id'}->{'videoId'});
 			push(@ids, $item->{'id'}->{'videoId'});
+			$count++;
 		}
 		}
 
 
 		# Do a batch request for the entire batch of video data
 		# Do a batch request for the entire batch of video data