Fix parsing upload date in YoutubeStreamExtractor

This commit is contained in:
wb9688 2020-02-25 19:47:26 +01:00 committed by TobiGr
parent bbe1a3cd62
commit 5d08c34322
1 changed files with 2 additions and 2 deletions

View File

@ -127,8 +127,8 @@ public class YoutubeStreamExtractor extends StreamExtractor {
try {
// TODO this parses English formatted dates only, we need a better approach to parse the textual date
Date d = new SimpleDateFormat("dd MMM yyy").parse(getVideoPrimaryInfoRenderer()
.getObject("dateText").getString("simpleText"));
Date d = new SimpleDateFormat("dd MMM yyyy", Locale.ENGLISH).parse(
getVideoPrimaryInfoRenderer().getObject("dateText").getString("simpleText"));
return new SimpleDateFormat("yyyy-MM-dd").format(d);
} catch (Exception ignored) {}
throw new ParsingException("Could not get upload date");