kopia lustrzana https://github.com/bellingcat/auto-archiver
ydl timestamp bug fix
rodzic
c6bcb59005
commit
2ac08a34f6
|
@ -106,11 +106,11 @@ class YoutubeDLArchiver(Archiver):
|
||||||
|
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
|
|
||||||
timestamp = datetime.datetime.utcfromtimestamp(info['timestamp']).replace(tzinfo=datetime.timezone.utc).isoformat() \
|
timestamp = None
|
||||||
if 'timestamp' in info else \
|
if 'timestamp' in info and info['timestamp'] is not None:
|
||||||
datetime.datetime.strptime(info['upload_date'], '%Y%m%d').replace(tzinfo=datetime.timezone.utc) \
|
timestamp = datetime.datetime.utcfromtimestamp(info['timestamp']).replace(tzinfo=datetime.timezone.utc).isoformat()
|
||||||
if 'upload_date' in info and info['upload_date'] is not None else \
|
elif 'upload_date' in info and info['upload_date'] is not None:
|
||||||
None
|
timestamp = datetime.datetime.strptime(info['upload_date'], '%Y%m%d').replace(tzinfo=datetime.timezone.utc)
|
||||||
|
|
||||||
return ArchiveResult(status=status, cdn_url=cdn_url, thumbnail=key_thumb, thumbnail_index=thumb_index, duration=duration,
|
return ArchiveResult(status=status, cdn_url=cdn_url, thumbnail=key_thumb, thumbnail_index=thumb_index, duration=duration,
|
||||||
title=info['title'] if 'title' in info else None, timestamp=timestamp, hash=hash, screenshot=screenshot)
|
title=info['title'] if 'title' in info else None, timestamp=timestamp, hash=hash, screenshot=screenshot)
|
||||||
|
|
Ładowanie…
Reference in New Issue