mirror of
https://github.com/IllusionMan1212/yt-db-completer.git
synced 2026-10-24 10:12:27 +00:00
feat: dump missing ids to file
This commit is contained in:
@@ -78,6 +78,7 @@ func CategoryFlag(name string, value Category, usage string) *Category {
|
||||
|
||||
func main() {
|
||||
cat := CategoryFlag("category", All, "Category of videos to check against.\nValid options are all, shorts, video, livestream, membership")
|
||||
dumpToFile := flag.Bool("dump-to-file", false, "The program will dump the missing IDs to a file that can be used with yt-dlp")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
@@ -205,4 +206,17 @@ func main() {
|
||||
fmt.Println("Found extra existing videos:")
|
||||
fmt.Println(extraIds)
|
||||
}
|
||||
|
||||
if *dumpToFile {
|
||||
file, fileErr := os.Create("./missing.txt")
|
||||
defer file.Close()
|
||||
if fileErr != nil {
|
||||
fmt.Printf("Error while opening dump file: %v\n", fileErr)
|
||||
return
|
||||
}
|
||||
|
||||
for _, meta := range missingMetadata {
|
||||
file.WriteString(meta.Id + "\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user