}
if(pj.getTime() == 0) {
throw new ContentParseException("Could not parse post (post timestamp missing and could not be zero)");
}
Post p = new Post();
if(pj.getFilename() != null) {
p.setMediaFilename(pj.getFilename() + pj.getExt());
p.setMediaOrig(pj.getTim() + pj.getExt());
p.setPreviewOrig(pj.getTim() + "s.jpg");
}
String capcode = pj.getCapcode();
if(capcode != null) capcode = capcode.substring(0, 1).toUpperCase();
String posterHash = pj.getId();
if(posterHash != null && posterHash.equals("Developer")) posterHash = "Dev";
String posterCountry = pj.getCountry();
if(posterCountry != null && (posterCountry.equals("XX") || posterCountry.equals("A1"))) posterCountry = null;
p.setType(pj.getExt());
p.setMediaHash(pj.getMd5());
p.setMediaSize(pj.getFsize());
p.setMediaW(pj.getW());
p.setMediaH(pj.getH());
p.setPreviewW(pj.getTnW());
p.setPreviewH(pj.getTnH());
p.setNum(pj.getNo());
p.setThreadNum(pj.getResto() == 0 ? pj.getNo() : pj.getResto());
p.setOp(pj.getResto() == 0);
p.setTitle(this.cleanSimple(pj.getSub()));
p.setEmail(pj.getEmail());
p.setName(this.cleanSimple(pj.getName()));
p.setTrip(pj.getTrip());
p.setDate(DateUtils.adjustTimestampEpoch(pj.getTime(), DateUtils.NYC_TIMEZONE));
p.setComment(this.doClean(pj.getCom()));
p.setSpoiler(pj.isSpoiler());
p.setDeleted(false);
p.setSticky(pj.isSticky());
p.setClosed(pj.isClosed() && !pj.isArchived());
p.setArchived(pj.isArchived());
p.setCapcode(capcode);
p.setPosterHash(posterHash);
p.setPosterCountry(posterCountry);
p.setExif(this.cleanSimple(this.parseMeta(pj.getCom())));
return p;
}