chore:sleep and retry
This commit is contained in:
parent
0e1173464b
commit
f5b2517e07
@ -7,7 +7,7 @@ from utils.channel import (
|
||||
from utils.tools import get_pbar_remaining, get_soup
|
||||
from utils.config import config
|
||||
from updates.proxy import get_proxy, get_proxy_next
|
||||
from time import time, sleep
|
||||
from time import time
|
||||
from driver.setup import setup_driver
|
||||
from utils.retry import (
|
||||
retry_func,
|
||||
@ -58,7 +58,6 @@ def search_submit(driver, name):
|
||||
)
|
||||
if not submit_button:
|
||||
return
|
||||
sleep(1)
|
||||
driver.execute_script("arguments[0].click();", submit_button)
|
||||
|
||||
|
||||
@ -141,9 +140,7 @@ async def get_channels_by_hotel(callback):
|
||||
),
|
||||
)
|
||||
if not page_link:
|
||||
# break
|
||||
continue
|
||||
sleep(1)
|
||||
break
|
||||
driver.execute_script("arguments[0].click();", page_link)
|
||||
else:
|
||||
request_url = (
|
||||
@ -153,7 +150,6 @@ async def get_channels_by_hotel(callback):
|
||||
lambda: get_soup_requests(request_url, proxy=proxy),
|
||||
name=f"hotel search:{name}, page:{page}",
|
||||
)
|
||||
sleep(1)
|
||||
soup = get_soup(driver.page_source) if open_driver else page_soup
|
||||
if soup:
|
||||
results = (
|
||||
|
@ -10,7 +10,7 @@ from utils.channel import (
|
||||
from utils.tools import get_pbar_remaining, get_soup
|
||||
from utils.config import config, resource_path
|
||||
from updates.proxy import get_proxy, get_proxy_next
|
||||
from time import time, sleep
|
||||
from time import time
|
||||
from driver.setup import setup_driver
|
||||
from utils.retry import (
|
||||
retry_func,
|
||||
@ -60,7 +60,6 @@ def search_submit(driver, name):
|
||||
)
|
||||
if not submit_button:
|
||||
return
|
||||
sleep(1)
|
||||
driver.execute_script("arguments[0].click();", submit_button)
|
||||
|
||||
|
||||
@ -151,9 +150,7 @@ async def get_channels_by_multicast(names, callback):
|
||||
),
|
||||
)
|
||||
if not page_link:
|
||||
# break
|
||||
continue
|
||||
sleep(1)
|
||||
break
|
||||
driver.execute_script("arguments[0].click();", page_link)
|
||||
else:
|
||||
request_url = (
|
||||
@ -163,7 +160,6 @@ async def get_channels_by_multicast(names, callback):
|
||||
lambda: get_soup_requests(request_url, proxy=proxy),
|
||||
name=f"multicast search:{name}, page:{page}",
|
||||
)
|
||||
sleep(1)
|
||||
soup = get_soup(driver.page_source) if open_driver else page_soup
|
||||
if soup:
|
||||
results = (
|
||||
|
@ -8,7 +8,7 @@ from utils.channel import (
|
||||
from utils.tools import check_url_by_patterns, get_pbar_remaining, get_soup
|
||||
from utils.config import config
|
||||
from updates.proxy import get_proxy, get_proxy_next
|
||||
from time import time, sleep
|
||||
from time import time
|
||||
from driver.setup import setup_driver
|
||||
from utils.retry import (
|
||||
retry_func,
|
||||
@ -54,7 +54,6 @@ def search_submit(driver, name):
|
||||
)
|
||||
if not submit_button:
|
||||
return
|
||||
sleep(1)
|
||||
driver.execute_script("arguments[0].click();", submit_button)
|
||||
|
||||
|
||||
@ -126,7 +125,6 @@ async def get_channels_by_online_search(names, callback):
|
||||
)
|
||||
if not page_link:
|
||||
break
|
||||
sleep(1)
|
||||
driver.execute_script(
|
||||
"arguments[0].click();", page_link
|
||||
)
|
||||
@ -136,7 +134,6 @@ async def get_channels_by_online_search(names, callback):
|
||||
lambda: get_soup_requests(request_url, proxy=proxy),
|
||||
name=f"online search:{name}, page:{page}",
|
||||
)
|
||||
sleep(1)
|
||||
soup = (
|
||||
get_soup(driver.page_source) if open_driver else page_soup
|
||||
)
|
||||
|
@ -3,7 +3,7 @@ from selenium.webdriver.support.ui import WebDriverWait
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
from selenium.common.exceptions import TimeoutException
|
||||
|
||||
max_retries = 3
|
||||
max_retries = 2
|
||||
timeout = 10
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user