Skip to content

Commit

Permalink
Update 2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lumina37 committed May 6, 2022
1 parent 86d8719 commit b621416
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tiebaBrowser/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async def enter(self) -> "Sessions":

# Init web client
web_headers = {
aiohttp.hdrs.USER_AGENT: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0',
aiohttp.hdrs.USER_AGENT: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0',
aiohttp.hdrs.ACCEPT_ENCODING: 'gzip, deflate, br',
aiohttp.hdrs.CACHE_CONTROL: 'no-cache',
aiohttp.hdrs.CONNECTION: 'keep-alive',
Expand Down Expand Up @@ -208,7 +208,7 @@ def _get_tieba_multipart_writer(proto_bytes: bytes) -> aiohttp.MultipartWriter:
aiohttp.MultipartWriter: 只可用于贴吧客户端
"""

writer = aiohttp.MultipartWriter('form-data', boundary="*--asoul-diana-bili-uid672328094")
writer = aiohttp.MultipartWriter('form-data', boundary="*--asoul-diana-bili")
payload_headers = {
aiohttp.hdrs.CONTENT_DISPOSITION: aiohttp.helpers.content_disposition_header(
'form-data', name='data', filename='file'
Expand Down
6 changes: 3 additions & 3 deletions tiebaBrowser/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,17 +403,17 @@ def origin_src(self) -> str:

@property
def hash(self) -> str:

if self._hash is None:
first_qmark_idx = self.src.find('?')
end_idx = self.src.rfind('.', 0, first_qmark_idx)

if end_idx == -1:
self._hash = ''
else:
start_idx = self.src.rfind('/', 0, end_idx)
self._hash = self.src[start_idx + 1 : end_idx]

return self._hash

@property
Expand Down

0 comments on commit b621416

Please sign in to comment.