mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-13 05:38:29 +03:00
Use batch updates
This commit is contained in:
@@ -27,6 +27,8 @@ for i in range(2, len(values)+1):
|
|||||||
v = values[i-1]
|
v = values[i-1]
|
||||||
|
|
||||||
if v[2] == "":
|
if v[2] == "":
|
||||||
|
print(v[0])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
info = ydl.extract_info(v[0], download=True)
|
info = ydl.extract_info(v[0], download=True)
|
||||||
filename = ydl.prepare_filename(info)
|
filename = ydl.prepare_filename(info)
|
||||||
@@ -50,13 +52,9 @@ for i in range(2, len(values)+1):
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
wks.batch_update(update)
|
wks.batch_update(update)
|
||||||
except youtube_dl.utils.DownloadError:
|
except:
|
||||||
t, value, traceback = sys.exc_info()
|
t, value, traceback = sys.exc_info()
|
||||||
|
|
||||||
# value is the error that we can update in the sheet
|
|
||||||
wks.update('C' + str(i), str(value))
|
|
||||||
wks.update('B' + str(i), datetime.datetime.now().isoformat())
|
|
||||||
|
|
||||||
update = [{
|
update = [{
|
||||||
'range': 'C' + str(i),
|
'range': 'C' + str(i),
|
||||||
'values': [[str(value)]]
|
'values': [[str(value)]]
|
||||||
@@ -66,4 +64,3 @@ for i in range(2, len(values)+1):
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
wks.batch_update(update)
|
wks.batch_update(update)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user