Skip to content

Commit

Permalink
使用isort对引用进行格式化排序 修改微博获取图片默认配置关闭
Browse files Browse the repository at this point in the history
  • Loading branch information
Ermeng98 committed Apr 10, 2024
1 parent 52c7205 commit 9cd6efb
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config/base_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
MAX_CONCURRENCY_NUM = 4

# 是否开启爬图片模式, 默认不开启爬图片
ENABLE_GET_IMAGES = True
ENABLE_GET_IMAGES = False

# 是否开启爬评论模式, 默认不开启爬评论
ENABLE_GET_COMMENTS = False
Expand Down
1 change: 0 additions & 1 deletion media_platform/weibo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import httpx
from playwright.async_api import BrowserContext, Page

from tools import utils

from .exception import DataFetchError
Expand Down
5 changes: 2 additions & 3 deletions media_platform/weibo/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
from asyncio import Task
from typing import Dict, List, Optional, Tuple

from playwright.async_api import (BrowserContext, BrowserType, Page,
async_playwright)

import config
from base.base_crawler import AbstractCrawler
from playwright.async_api import (BrowserContext, BrowserType, Page,
async_playwright)
from proxy.proxy_ip_pool import IpInfoModel, create_ip_pool
from store import weibo as weibo_store
from tools import utils
Expand Down
3 changes: 1 addition & 2 deletions media_platform/weibo/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
import sys
from typing import Optional

from base.base_crawler import AbstractLogin
from playwright.async_api import BrowserContext, Page
from tenacity import (RetryError, retry, retry_if_result, stop_after_attempt,
wait_fixed)

from base.base_crawler import AbstractLogin
from tools import utils


Expand Down
2 changes: 1 addition & 1 deletion store/weibo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import config

from .weibo_store_impl import *
from .weibo_store_image import *
from .weibo_store_impl import *


class WeibostoreFactory:
Expand Down
7 changes: 4 additions & 3 deletions store/weibo/weibo_store_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
# @Time : 2024/4/9 17:35
# @Desc : 微博保存图片类
import pathlib
from typing import Dict

from tools import utils
from base.base_crawler import AbstractStoreImage
import aiofiles
from typing import Dict
from base.base_crawler import AbstractStoreImage
from tools import utils


class WeiboStoreImage(AbstractStoreImage):
image_store_path: str = "data/weibo/images"
Expand Down
1 change: 0 additions & 1 deletion store/weibo/weibo_store_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from typing import Dict

import aiofiles

from base.base_crawler import AbstractStore
from tools import utils
from var import crawler_type_var
Expand Down

0 comments on commit 9cd6efb

Please sign in to comment.