Not fail on non-valid gallery images
This commit is contained in:
parent
1caef9097b
commit
43d3920023
|
@ -298,10 +298,11 @@ async def main():
|
||||||
files = []
|
files = []
|
||||||
captions = []
|
captions = []
|
||||||
for a, i in enumerate(random_post.media_metadata):
|
for a, i in enumerate(random_post.media_metadata):
|
||||||
captions.append(f'{text}\n#{a + 1}')
|
|
||||||
filename = os.path.join(tempdir, str(time.time()))
|
|
||||||
i = random_post.media_metadata[i]
|
i = random_post.media_metadata[i]
|
||||||
|
if i['status'] == 'valid':
|
||||||
|
filename = os.path.join(tempdir, str(time.time()))
|
||||||
await _download_file(filename, i['s']['u'])
|
await _download_file(filename, i['s']['u'])
|
||||||
|
captions.append(f'{text}\n#{a + 1}')
|
||||||
files.append(filename)
|
files.append(filename)
|
||||||
url = None
|
url = None
|
||||||
if url:
|
if url:
|
||||||
|
|
Loading…
Reference in New Issue