File tree Expand file tree Collapse file tree
extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import java .net .MalformedURLException ;
2222import java .net .URL ;
2323import java .net .URLDecoder ;
24+ import java .time .LocalDate ;
2425import java .time .OffsetDateTime ;
26+ import java .time .ZoneOffset ;
2527import java .time .format .DateTimeParseException ;
2628import java .util .Collections ;
2729import java .util .HashMap ;
@@ -184,7 +186,11 @@ public static OffsetDateTime parseDateFrom(String textualUploadDate) throws Pars
184186 try {
185187 return OffsetDateTime .parse (textualUploadDate );
186188 } catch (DateTimeParseException e ) {
187- throw new ParsingException ("Could not parse date: \" " + textualUploadDate + "\" " , e );
189+ try {
190+ return LocalDate .parse (textualUploadDate ).atStartOfDay ().atOffset (ZoneOffset .UTC );
191+ } catch (DateTimeParseException e1 ) {
192+ throw new ParsingException ("Could not parse date: \" " + textualUploadDate + "\" " , e1 );
193+ }
188194 }
189195 }
190196
You can’t perform that action at this time.
0 commit comments