ignore timestamp extraction for instagram videos
This commit is contained in:
parent
c35a4acb7d
commit
e8b18b6a74
1 changed files with 11 additions and 9 deletions
|
@ -180,17 +180,19 @@ def _try_photo(photo: str, mtype: str, dgeo: Optional[LatLon]) -> Optional[Photo
|
||||||
lon = convert(meta[LON], meta[LON_REF])
|
lon = convert(meta[LON], meta[LON_REF])
|
||||||
geo = (lat, lon)
|
geo = (lat, lon)
|
||||||
if dt is None:
|
if dt is None:
|
||||||
# TODO eh. perhaps ignore all of instagram videos? they are also too behind in past...
|
if 'Instagram/VID_' in photo:
|
||||||
try:
|
logger.warning('ignoring timestamp extraction for %s, they are stupid for Instagram videos', photo)
|
||||||
edt = dt_from_path(photo) # ok, last try..
|
|
||||||
except Exception as e:
|
|
||||||
logger.error(f"Error while trying to extract date from name {photo}")
|
|
||||||
logger.exception(e)
|
|
||||||
else:
|
else:
|
||||||
if edt is not None and edt > datetime.now():
|
try:
|
||||||
logger.error('datetime for %s is too far in future: %s', photo, edt)
|
edt = dt_from_path(photo) # ok, last try..
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Error while trying to extract date from name {photo}")
|
||||||
|
logger.exception(e)
|
||||||
else:
|
else:
|
||||||
dt = edt
|
if edt is not None and edt > datetime.now():
|
||||||
|
logger.error('datetime for %s is too far in future: %s', photo, edt)
|
||||||
|
else:
|
||||||
|
dt = edt
|
||||||
|
|
||||||
|
|
||||||
return Photo(photo, dt, geo)
|
return Photo(photo, dt, geo)
|
||||||
|
|
Loading…
Add table
Reference in a new issue