fix(video.py): remove unnecessary prompt for generating thumbnail

fix(video.py): assign url and id properties after uploading video
fix(montage.py): fix unsplash_url to use source.unsplash.com instead of api.unsplash.com
fix(montage.py): fix image download logic in prepare function
fix(marp.md): add missing newline at end of file
fix(wiki_downloader.py): fix image download logic in download_image function
This commit is contained in:
Paillat
2023-07-02 12:43:43 +02:00
parent f7835f6604
commit d81b2ccebf
4 changed files with 58 additions and 13 deletions

View File

@@ -22,11 +22,25 @@ def download_image(query, download_path):
to.click()
break
time.sleep(1)
image = driver.find_element(By.CLASS_NAME, "rg_i")
image.click()
while True:
try:
image = driver.find_element(By.CLASS_NAME, "rg_i").click()
break
except:
pass
finally:
time.sleep(1)
time.sleep(5)
image = driver.find_element(By.CLASS_NAME, "r48jcc").get_attribute("src") or ""
while True:
try:
image = driver.find_element(By.CLASS_NAME, "iPVvYb").get_attribute("src") or driver.find_element(By.CLASS_NAME, "pT0Scc").get_attribute("src") or driver.find_element(By.CLASS_NAME, "r48jcc").get_attribute("src") or ""
if image != "":
break
except Exception as a:
print(a)
pass
finally:
time.sleep(1)
image_content = None
if image.startswith("data:"):