|
28 | 28 | from urbandict import define |
29 | 29 | from wikipedia import summary |
30 | 30 | from wikipedia.exceptions import DisambiguationError, PageError |
31 | | -from youtube_search import YoutubeSearch |
32 | 31 | from youtube_dl import YoutubeDL |
33 | 32 | from youtube_dl.utils import ( |
34 | 33 | ContentTooShortError, |
|
40 | 39 | UnavailableVideoError, |
41 | 40 | XAttrMetadataError, |
42 | 41 | ) |
43 | | -from asyncio import sleep |
| 42 | +from youtube_search import YoutubeSearch |
| 43 | + |
44 | 44 | from userbot import BOTLOG, BOTLOG_CHATID, CMD_HELP, TEMP_DOWNLOAD_DIRECTORY, WOLFRAM_ID |
45 | 45 | from userbot.events import register |
46 | 46 | from userbot.utils import chrome, googleimagesdownload, progress |
@@ -78,15 +78,14 @@ async def carbon_api(e): |
78 | 78 | driver = await chrome() |
79 | 79 | driver.get(url) |
80 | 80 | await e.edit("`Processing..\n50%`") |
81 | | - download_path = './' |
| 81 | + download_path = "./" |
82 | 82 | driver.command_executor._commands["send_command"] = ( |
83 | | - "POST", '/session/$sessionId/chromium/send_command') |
| 83 | + "POST", |
| 84 | + "/session/$sessionId/chromium/send_command", |
| 85 | + ) |
84 | 86 | params = { |
85 | | - 'cmd': 'Page.setDownloadBehavior', |
86 | | - 'params': { |
87 | | - 'behavior': 'allow', |
88 | | - 'downloadPath': download_path |
89 | | - } |
| 87 | + "cmd": "Page.setDownloadBehavior", |
| 88 | + "params": {"behavior": "allow", "downloadPath": download_path}, |
90 | 89 | } |
91 | 90 | driver.execute("send_command", params) |
92 | 91 | driver.find_element_by_xpath("//button[@id='export-menu']").click() |
|
0 commit comments