Compare commits

...
2 Commits
Author SHA1 Message Date
Illusion cbf185e111 fix: proper membership playlist title. tested 2024-09-02 04:20:09 +02:00
Illusion 48aff7d986 feat: dump missing ids to file 2024-08-31 22:18:18 +02:00
2 changed files with 16 additions and 2 deletions
+1
View File
@@ -1 +1,2 @@
yt-db-completer
missing.txt
+15 -2
View File
@@ -15,7 +15,6 @@ const (
Shorts = "shorts"
Video = "video"
Livestream = "livestream"
// TODO: Can't test this until I get my hands on a membership.
Membership = "membership"
)
@@ -78,6 +77,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()
@@ -148,7 +148,7 @@ func main() {
continue
}
case Membership:
if !strings.HasSuffix(metadata.PlaylistTitle, "Membership") {
if !strings.HasSuffix(metadata.PlaylistTitle, "Members-only videos") {
continue
}
}
@@ -205,4 +205,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")
}
}
}