Update YoutubeStreamInfoItemLockupExtractor

pull/1372/head
Isira Seneviratne 2025-10-10 05:31:30 +05:30
rodzic 2d794e7a6d
commit fa4b717556
1 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -18,7 +18,6 @@ import org.schabi.newpipe.extractor.utils.JsonUtils;
import org.schabi.newpipe.extractor.utils.Utils; import org.schabi.newpipe.extractor.utils.Utils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.ZoneOffset; import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException; import java.time.format.DateTimeParseException;
@ -292,8 +291,8 @@ public class YoutubeStreamInfoItemLockupExtractor implements StreamInfoItemExtra
try { try {
// As we request a UTC offset of 0 minutes, we get the UTC date // As we request a UTC offset of 0 minutes, we get the UTC date
return new DateWrapper(OffsetDateTime.of(LocalDateTime.parse( final var dateTime = LocalDateTime.parse(premiereDate, PREMIERES_DATE_FORMATTER);
premiereDate, PREMIERES_DATE_FORMATTER), ZoneOffset.UTC)); return new DateWrapper(dateTime.atZone(ZoneOffset.UTC).toInstant(), false);
} catch (final DateTimeParseException e) { } catch (final DateTimeParseException e) {
throw new ParsingException("Could not parse premiere upload date", e); throw new ParsingException("Could not parse premiere upload date", e);
} }