mirror of
https://github.com/Paillat-dev/FABLE.git
synced 2026-01-02 09:16:20 +00:00
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:
@@ -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:"):
|
||||
|
||||
Reference in New Issue
Block a user