refactor:driver and requests path
This commit is contained in:
parent
b11f5f39e2
commit
78922938e8
updates
utils
@ -10,10 +10,10 @@ from tqdm.asyncio import tqdm_asyncio
|
||||
|
||||
import updates.fofa.fofa_map as fofa_map
|
||||
import utils.constants as constants
|
||||
from requests_custom.utils import get_source_requests, close_session
|
||||
from updates.proxy import get_proxy, get_proxy_next
|
||||
from utils.channel import format_channel_name
|
||||
from utils.config import config
|
||||
from utils.requests.tools import get_source_requests, close_session
|
||||
from utils.retry import retry_func
|
||||
from utils.tools import merge_objects, get_pbar_remaining, add_url_info, resource_path
|
||||
|
||||
@ -92,7 +92,7 @@ async def get_channels_by_fofa(urls=None, multicast=False, callback=None):
|
||||
open_proxy = config.open_proxy
|
||||
open_driver = config.open_driver
|
||||
if open_driver:
|
||||
from driver.setup import setup_driver
|
||||
from utils.driver import setup_driver
|
||||
open_sort = config.open_sort
|
||||
if open_proxy:
|
||||
test_url = fofa_urls[0][0]
|
||||
|
@ -9,9 +9,6 @@ from tqdm.asyncio import tqdm_asyncio
|
||||
|
||||
import updates.fofa.fofa_map as fofa_map
|
||||
import utils.constants as constants
|
||||
from driver.setup import setup_driver
|
||||
from driver.utils import search_submit
|
||||
from requests_custom.utils import get_soup_requests, close_session
|
||||
from updates.proxy import get_proxy, get_proxy_next
|
||||
from updates.subscribe import get_channels_by_subscribe_urls
|
||||
from utils.channel import (
|
||||
@ -19,6 +16,9 @@ from utils.channel import (
|
||||
get_results_from_multicast_soup_requests,
|
||||
)
|
||||
from utils.config import config
|
||||
from utils.driver.setup import setup_driver
|
||||
from utils.driver.tools import search_submit
|
||||
from utils.requests.tools import get_soup_requests, close_session
|
||||
from utils.retry import (
|
||||
retry_func,
|
||||
find_clickable_element_with_retry,
|
||||
|
@ -8,9 +8,6 @@ from urllib.parse import parse_qs
|
||||
from tqdm.asyncio import tqdm_asyncio
|
||||
|
||||
import utils.constants as constants
|
||||
from driver.setup import setup_driver
|
||||
from driver.utils import search_submit
|
||||
from requests_custom.utils import get_soup_requests, close_session
|
||||
from updates.fofa import get_channels_by_fofa
|
||||
from updates.proxy import get_proxy, get_proxy_next
|
||||
from utils.channel import (
|
||||
@ -23,6 +20,9 @@ from utils.channel import (
|
||||
format_channel_name
|
||||
)
|
||||
from utils.config import config
|
||||
from utils.driver.setup import setup_driver
|
||||
from utils.driver.tools import search_submit
|
||||
from utils.requests.tools import get_soup_requests, close_session
|
||||
from utils.retry import (
|
||||
retry_func,
|
||||
find_clickable_element_with_retry,
|
||||
|
@ -4,7 +4,7 @@ import sys
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
|
||||
|
||||
from updates.subscribe import get_channels_by_subscribe_urls
|
||||
from driver.utils import get_soup_driver
|
||||
from utils.driver.tools import get_soup_driver
|
||||
from utils.config import config
|
||||
import utils.constants as constants
|
||||
from utils.channel import format_channel_name
|
||||
|
@ -4,9 +4,6 @@ from time import time
|
||||
from tqdm.asyncio import tqdm_asyncio
|
||||
|
||||
import utils.constants as constants
|
||||
from driver.setup import setup_driver
|
||||
from driver.utils import search_submit
|
||||
from requests_custom.utils import get_soup_requests, close_session
|
||||
from updates.proxy import get_proxy, get_proxy_next
|
||||
from utils.channel import (
|
||||
format_channel_name,
|
||||
@ -14,6 +11,9 @@ from utils.channel import (
|
||||
get_results_from_soup_requests,
|
||||
)
|
||||
from utils.config import config
|
||||
from utils.driver.setup import setup_driver
|
||||
from utils.driver.tools import search_submit
|
||||
from utils.requests.tools import get_soup_requests, close_session
|
||||
from utils.retry import (
|
||||
retry_func,
|
||||
find_clickable_element_with_retry,
|
||||
|
@ -4,9 +4,9 @@ from concurrent.futures import ThreadPoolExecutor
|
||||
from tqdm import tqdm
|
||||
from tqdm.asyncio import tqdm_asyncio
|
||||
|
||||
from driver.utils import get_soup_driver
|
||||
from requests_custom.utils import get_soup_requests, close_session
|
||||
from utils.config import config
|
||||
from utils.driver.tools import get_soup_driver
|
||||
from utils.requests.tools import get_soup_requests, close_session
|
||||
from utils.retry import retry_func
|
||||
from utils.speed import get_delay_requests
|
||||
|
||||
|
@ -1,12 +1,14 @@
|
||||
import re
|
||||
from time import sleep
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from utils.config import config
|
||||
from utils.retry import (
|
||||
retry_func,
|
||||
locate_element_with_retry,
|
||||
find_clickable_element_with_retry,
|
||||
)
|
||||
from time import sleep
|
||||
import re
|
||||
from bs4 import BeautifulSoup
|
||||
from utils.config import config
|
||||
|
||||
if config.open_driver:
|
||||
try:
|
||||
@ -19,7 +21,7 @@ def get_soup_driver(url):
|
||||
"""
|
||||
Get the soup by driver
|
||||
"""
|
||||
from driver.setup import setup_driver
|
||||
from utils.driver.setup import setup_driver
|
||||
|
||||
driver = setup_driver()
|
||||
retry_func(lambda: driver.get(url), name=url)
|
Loading…
x
Reference in New Issue
Block a user