mirror of
https://github.com/googlefonts/noto-emoji.git
synced 2025-07-08 13:36:40 +00:00
add filename exceptions
This commit is contained in:
parent
2a87f618be
commit
e6e8aacc0a
1 changed files with 24 additions and 19 deletions
|
@ -146,28 +146,33 @@ def download_files(service, file_list, output_dir):
|
||||||
file_id = file['id']
|
file_id = file['id']
|
||||||
filename = file['name']
|
filename = file['name']
|
||||||
|
|
||||||
request = service.files().get_media(fileId=file_id)
|
if "emoji_u" in filename and ".png" in filename:
|
||||||
fh = io.BytesIO()
|
|
||||||
downloader = MediaIoBaseDownload(fh, request)
|
|
||||||
done = False
|
|
||||||
while done is False:
|
|
||||||
status, done = downloader.next_chunk()
|
|
||||||
|
|
||||||
filelocation = f"./{output_dir}/{filename}"
|
request = service.files().get_media(fileId=file_id)
|
||||||
with open(filelocation, "wb") as f:
|
fh = io.BytesIO()
|
||||||
f.write(fh.getbuffer())
|
downloader = MediaIoBaseDownload(fh, request)
|
||||||
|
done = False
|
||||||
|
while done is False:
|
||||||
|
status, done = downloader.next_chunk()
|
||||||
|
|
||||||
print(f"Downloading: {filename} ({file_id})")
|
filelocation = f"./{output_dir}/{filename}"
|
||||||
request = service.files().get_media(fileId=file_id)
|
with open(filelocation, "wb") as f:
|
||||||
fh = io.BytesIO()
|
f.write(fh.getbuffer())
|
||||||
downloader = MediaIoBaseDownload(fh, request)
|
|
||||||
done = False
|
|
||||||
while done is False:
|
|
||||||
status, done = downloader.next_chunk()
|
|
||||||
|
|
||||||
filelocation = f"{output_dir}/{filename}"
|
print(f"Downloading: {filename} ({file_id})")
|
||||||
with open(filelocation, "wb") as f:
|
request = service.files().get_media(fileId=file_id)
|
||||||
f.write(fh.getbuffer())
|
fh = io.BytesIO()
|
||||||
|
downloader = MediaIoBaseDownload(fh, request)
|
||||||
|
done = False
|
||||||
|
while done is False:
|
||||||
|
status, done = downloader.next_chunk()
|
||||||
|
|
||||||
|
filelocation = f"{output_dir}/{filename}"
|
||||||
|
with open(filelocation, "wb") as f:
|
||||||
|
f.write(fh.getbuffer())
|
||||||
|
|
||||||
|
else:
|
||||||
|
print(f"{filename} does not have a valid emoji name")
|
||||||
|
|
||||||
|
|
||||||
def report_on_download(output_dir):
|
def report_on_download(output_dir):
|
||||||
|
|
Loading…
Add table
Reference in a new issue