Skip to content

Commit

Permalink
extract author util upd
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Dec 25, 2021
1 parent 2758c33 commit 447784d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ public static String extractAuthor(Video video) {
if (split.length <= 1) {
result = video.description;
} else {
// First part usually is quality a label (4K etc)
result = split[0].length() > 4 ? split[0] : split[1];
// First part may be a special label (4K, Stream, New etc)
// Two cases to detect label: 1) Description is long (4 items); 2) First item of description is too short (2 letters)
result = split.length < 4 && split[0].length() > 2 ? split[0] : split[1];
}
}

Expand Down

0 comments on commit 447784d

Please sign in to comment.