Skip to content

Commit c51c491

Browse files
committed
skip videos that failed processing
1 parent ac0d6c2 commit c51c491

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

api.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,13 @@ func (w *Worker) saveVideo(image albumImage, folder string) error {
136136
}
137137
dest := fmt.Sprintf("%s/%s", folder, image.Name())
138138

139-
if image.Processing && !w.cfg.ForceVideoDownload { // Skip videos if under processing
140-
return fmt.Errorf("skipping video %s because under processing, %#v", image.Name(), image)
139+
if image.Processing {
140+
if image.Status == "Preprocess" && image.SubStatus == "CanNotProcess" {
141+
return fmt.Errorf("skipping video %s because cannot be processed, %#v", image.Name(), image)
142+
}
143+
if !w.cfg.ForceVideoDownload { // Skip videos if under processing
144+
return fmt.Errorf("skipping video %s because under processing, %#v", image.Name(), image)
145+
}
141146
}
142147

143148
var v albumVideo

json_structs.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ type albumImage struct {
7979
Keywords string `json:"Keywords"`
8080
Latitude string `json:"Latitude"`
8181
Longitude string `json:"Longitude"`
82+
Status string `json:"Status"`
83+
SubStatus string `json:"SubStatus"`
8284
Uris struct {
8385
ImageMetadata struct {
8486
Uri string `json:"Uri"`

0 commit comments

Comments
 (0)