feat: dump missing ids to file

This commit is contained in:
2024-08-31 22:18:18 +02:00
parent 7e319f1c46
commit 48aff7d986
2 changed files with 15 additions and 0 deletions
+1
View File
@@ -1 +1,2 @@
yt-db-completer yt-db-completer
missing.txt
+14
View File
@@ -78,6 +78,7 @@ func CategoryFlag(name string, value Category, usage string) *Category {
func main() { func main() {
cat := CategoryFlag("category", All, "Category of videos to check against.\nValid options are all, shorts, video, livestream, membership") 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() flag.Parse()
@@ -205,4 +206,17 @@ func main() {
fmt.Println("Found extra existing videos:") fmt.Println("Found extra existing videos:")
fmt.Println(extraIds) 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")
}
}
} }