kopia lustrzana https://github.com/bellingcat/auto-archiver
Use batch updates
rodzic
f6cfcfc194
commit
8fd8da05df
|
@ -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)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue