Skip to content

Commit

Permalink
refactor: rename APP_INSECURE_SCHEME
Browse files Browse the repository at this point in the history
  • Loading branch information
lumina37 committed Jan 22, 2023
1 parent c52fb91 commit 3886edf
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion aiotieba/client/_helper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ._classdef import ForumInfoCache, WebsocketResponse
from ._const import APP_NON_SECURE_SCHEME, APP_SECURE_SCHEME, CHECK_URL_PERFIX, DEFAULT_TIMEOUT
from ._const import APP_INSECURE_SCHEME, APP_SECURE_SCHEME, CHECK_URL_PERFIX, DEFAULT_TIMEOUT
from ._func import (
TypeHeadersChecker,
check_status_code,
Expand Down
2 changes: 1 addition & 1 deletion aiotieba/client/_helper/_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
CHECK_URL_PERFIX = "http://tieba.baidu.com/mo/q/checkurl?url="

APP_SECURE_SCHEME = "https"
APP_NON_SECURE_SCHEME = "http"
APP_INSECURE_SCHEME = "http"

DEFAULT_TIMEOUT = aiohttp.ClientTimeout(connect=3.0, sock_read=12.0, sock_connect=4.0)
4 changes: 2 additions & 2 deletions aiotieba/client/get_bawu_info/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from .._core import APP_BASE_HOST, TbCore
from .._exception import TiebaServerError
from .._helper import APP_NON_SECURE_SCHEME, log_exception, pack_proto_request, send_request
from .._helper import APP_INSECURE_SCHEME, log_exception, pack_proto_request, send_request
from ._classdef import UserInfo_bawu
from .protobuf import GetBawuInfoReqIdl_pb2, GetBawuInfoResIdl_pb2

Expand Down Expand Up @@ -39,7 +39,7 @@ async def request_http(connector: aiohttp.TCPConnector, core: TbCore, fid: int)
request = pack_proto_request(
core,
yarl.URL.build(
scheme=APP_NON_SECURE_SCHEME, host=APP_BASE_HOST, path="/c/f/forum/getBawuInfo", query_string="cmd=301007"
scheme=APP_INSECURE_SCHEME, host=APP_BASE_HOST, path="/c/f/forum/getBawuInfo", query_string="cmd=301007"
),
pack_proto(core, fid),
)
Expand Down
4 changes: 2 additions & 2 deletions aiotieba/client/get_comments/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from .._core import APP_BASE_HOST, TbCore
from .._exception import TiebaServerError
from .._helper import APP_NON_SECURE_SCHEME, log_exception, pack_proto_request, send_request
from .._helper import APP_INSECURE_SCHEME, log_exception, pack_proto_request, send_request
from ._classdef import Comments
from .protobuf import PbFloorReqIdl_pb2, PbFloorResIdl_pb2

Expand Down Expand Up @@ -44,7 +44,7 @@ async def request_http(
request = pack_proto_request(
core,
yarl.URL.build(
scheme=APP_NON_SECURE_SCHEME, host=APP_BASE_HOST, path="/c/f/pb/floor", query_string="cmd=302002"
scheme=APP_INSECURE_SCHEME, host=APP_BASE_HOST, path="/c/f/pb/floor", query_string="cmd=302002"
),
pack_proto(core, tid, pid, pn, is_floor),
)
Expand Down
4 changes: 2 additions & 2 deletions aiotieba/client/get_forum_detail/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from .._core import APP_BASE_HOST, TbCore
from .._exception import TiebaServerError
from .._helper import APP_NON_SECURE_SCHEME, log_exception, pack_form_request, parse_json, send_request
from .._helper import APP_INSECURE_SCHEME, log_exception, pack_form_request, parse_json, send_request
from ._classdef import Forum_detail


Expand All @@ -29,7 +29,7 @@ async def request(connector: aiohttp.TCPConnector, core: TbCore, fid: int) -> Fo

request = pack_form_request(
core,
yarl.URL.build(scheme=APP_NON_SECURE_SCHEME, host=APP_BASE_HOST, path="/c/f/forum/getforumdetail"),
yarl.URL.build(scheme=APP_INSECURE_SCHEME, host=APP_BASE_HOST, path="/c/f/forum/getforumdetail"),
data,
)

Expand Down
4 changes: 2 additions & 2 deletions aiotieba/client/get_homepage/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from .._core import APP_BASE_HOST, TbCore
from .._exception import TiebaServerError
from .._helper import APP_NON_SECURE_SCHEME, log_exception, pack_proto_request, send_request
from .._helper import APP_INSECURE_SCHEME, log_exception, pack_proto_request, send_request
from ._classdef import Thread_home, UserInfo_home
from .protobuf import ProfileReqIdl_pb2, ProfileResIdl_pb2

Expand Down Expand Up @@ -55,7 +55,7 @@ async def request_http(
request = pack_proto_request(
core,
yarl.URL.build(
scheme=APP_NON_SECURE_SCHEME, host=APP_BASE_HOST, path="/c/u/user/profile", query_string="cmd=303012"
scheme=APP_INSECURE_SCHEME, host=APP_BASE_HOST, path="/c/u/user/profile", query_string="cmd=303012"
),
pack_proto(core, portrait, with_threads),
)
Expand Down
4 changes: 2 additions & 2 deletions aiotieba/client/get_threads/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from .._core import APP_BASE_HOST, TbCore
from .._exception import TiebaServerError
from .._helper import APP_NON_SECURE_SCHEME, log_exception, pack_proto_request, send_request
from .._helper import APP_INSECURE_SCHEME, log_exception, pack_proto_request, send_request
from ._classdef import Threads
from .protobuf import FrsPageReqIdl_pb2, FrsPageResIdl_pb2

Expand Down Expand Up @@ -43,7 +43,7 @@ async def request_http(
request = pack_proto_request(
core,
yarl.URL.build(
scheme=APP_NON_SECURE_SCHEME, host=APP_BASE_HOST, path="/c/f/frs/page", query_string="cmd=301001"
scheme=APP_INSECURE_SCHEME, host=APP_BASE_HOST, path="/c/f/frs/page", query_string="cmd=301001"
),
pack_proto(core, fname, pn, rn, sort, is_good),
)
Expand Down
4 changes: 2 additions & 2 deletions aiotieba/client/get_uinfo_getuserinfo_app/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from .._core import APP_BASE_HOST, TbCore
from .._exception import TiebaServerError
from .._helper import APP_NON_SECURE_SCHEME, log_exception, pack_proto_request, send_request
from .._helper import APP_INSECURE_SCHEME, log_exception, pack_proto_request, send_request
from ._classdef import UserInfo_guinfo_app
from .protobuf import GetUserInfoReqIdl_pb2, GetUserInfoResIdl_pb2

Expand Down Expand Up @@ -35,7 +35,7 @@ async def request_http(connector: aiohttp.TCPConnector, core: TbCore, user_id: i
request = pack_proto_request(
core,
yarl.URL.build(
scheme=APP_NON_SECURE_SCHEME, host=APP_BASE_HOST, path="/c/u/user/getuserinfo", query_string="cmd=303024"
scheme=APP_INSECURE_SCHEME, host=APP_BASE_HOST, path="/c/u/user/getuserinfo", query_string="cmd=303024"
),
pack_proto(user_id),
)
Expand Down
4 changes: 2 additions & 2 deletions aiotieba/client/search_post/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from .._core import APP_BASE_HOST, TbCore
from .._exception import TiebaServerError
from .._helper import APP_NON_SECURE_SCHEME, log_exception, pack_form_request, parse_json, send_request
from .._helper import APP_INSECURE_SCHEME, log_exception, pack_form_request, parse_json, send_request
from ._classdef import Searches


Expand Down Expand Up @@ -42,7 +42,7 @@ async def request(

request = pack_form_request(
core,
yarl.URL.build(scheme=APP_NON_SECURE_SCHEME, host=APP_BASE_HOST, path="/c/s/searchpost"),
yarl.URL.build(scheme=APP_INSECURE_SCHEME, host=APP_BASE_HOST, path="/c/s/searchpost"),
data,
)

Expand Down
4 changes: 2 additions & 2 deletions aiotieba/client/tieba_uid2user_info/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from .._core import APP_BASE_HOST, TbCore
from .._exception import TiebaServerError
from .._helper import APP_NON_SECURE_SCHEME, log_exception, pack_proto_request, send_request
from .._helper import APP_INSECURE_SCHEME, log_exception, pack_proto_request, send_request
from ._classdef import UserInfo_TUid
from .protobuf import GetUserByTiebaUidReqIdl_pb2, GetUserByTiebaUidResIdl_pb2

Expand Down Expand Up @@ -36,7 +36,7 @@ async def request_http(connector: aiohttp.TCPConnector, core: TbCore, tieba_uid:
request = pack_proto_request(
core,
yarl.URL.build(
scheme=APP_NON_SECURE_SCHEME,
scheme=APP_INSECURE_SCHEME,
host=APP_BASE_HOST,
path="/c/u/user/getUserByTiebaUid",
query_string="cmd=309702",
Expand Down

0 comments on commit 3886edf

Please sign in to comment.