Skip to content

Commit f504e7c

Browse files
committedDec 16, 2021
Fix playability status handling
1 parent a271cf1 commit f504e7c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎video.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"regexp"
88
"sort"
99
"strconv"
10+
"strings"
1011
"time"
1112
)
1213

@@ -74,7 +75,7 @@ func (v *Video) isVideoDownloadable(prData playerResponseData, isVideoPage bool)
7475

7576
if prData.PlayabilityStatus.Status == "LOGIN_REQUIRED" {
7677
// for some reason they use same status message for age-restricted and private videos
77-
if prData.PlayabilityStatus.Reason == "This video is private." {
78+
if strings.HasPrefix(prData.PlayabilityStatus.Reason, "This video is private") {
7879
return ErrVideoPrivate
7980
}
8081
return ErrLoginRequired

0 commit comments

Comments
 (0)
Please sign in to comment.