Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
backend
crawler
Commits
6dfdca49
Commit
6dfdca49
authored
Jan 08, 2021
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
48ab068f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
xiaohongshu_t.py
test/xiaohongshu_t.py
+57
-0
No files found.
test/xiaohongshu_t.py
0 → 100644
View file @
6dfdca49
# -*- coding:UTF-8 -*-
# @Time : 2020/8/13 11:47
# @File : xiaohongshu_t.py
# @email : litao@igengmei.com
# @author : litao
import
hashlib
def
md5
(
src
):
if
isinstance
(
src
,
str
):
src
=
src
.
encode
(
'utf-8'
)
m
=
hashlib
.
md5
()
m
.
update
(
src
)
return
m
.
hexdigest
()
def
cc
():
a
=
"fid=15972878231090404caae735a593231344ec8933c2cf&device_fingerprint=2020061115511043c9ecd8196208af8594f1819f7c53c001ef7ccc21dd7463&device_fingerprint1=2020061115511043c9ecd8196208af8594f1819f7c53c001ef7ccc21dd7463&channel=Xiaomi&versionName=6.57.0&deviceId=6e902889-1675-36dd-81d1-9653cafbd11a&platform=android&sid=session.1597287892454943279563&identifier_flag=4&t=1597288034&x_trace_page_current=search_result_notes&lang=zh-Hans&uis=light"
bArr
=
bytes
(
a
,
encoding
=
"utf8"
)
st1
=
"6e902889-1675-36dd-81d1-9653cafbd11a"
bys
=
bytes
(
st1
,
encoding
=
"utf8"
)
i2
=
0
sb2
=
[]
""
i
=
0
while
1
:
i3
=
i
if
(
i2
>=
len
(
bArr
))
:
print
(
sb2
)
print
(
""
.
join
([
str
(
c
)
for
c
in
sb2
]))
return
md5
(
bytes
(
md5
(
bytes
(
""
.
join
([
str
(
c
)
for
c
in
sb2
]),
encoding
=
"utf8"
))
.
lower
()
+
st1
,
encoding
=
"utf8"
))
.
lower
()
sb2
.
append
(
bArr
[
i2
]
^
bys
[
i3
])
i
=
(
i3
+
1
)
%
len
(
bys
)
i2
+=
1
if
__name__
==
"__name__"
:
url
=
"https://www.xiaohongshu.com/user/profile/5ea6909900000000010057a3"
headers
=
{
"accept"
:
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
,
"accept-encoding"
:
"gzip, deflate, br"
,
"accept-language"
:
"zh-CN,zh;q=0.9"
,
"cache-control"
:
"no-cache"
,
"cookie"
:
"xhsTracker=url=user-profile&xhsshare=CopyLink; xhsTrackerId=38ec6dcb-d882-45e8-c539-834386696a14; xhsuid=Dv4OTnGbDg9LivGu; timestamp2=202101062497d4bed842476b2618e0ea; timestamp2.sig=-Jax1vd_iNZtToaWYMOMoFUmCJwojKQPnfP8iMeOpAc; xhs_spses.5dde=*; extra_exp_ids=gif_clt1,ques_clt1; xhs_spid.5dde=59a50d47116c4333.1609921946.3.1610074315.1609997760.3be8232b-0407-44f8-8036-d40a4c47b120"
,
"pragma"
:
"no-cache"
,
"referer"
:
"https://www.xiaohongshu.com/discovery/item/5f90384e000000000100b8f0"
,
"sec-ch-ua"
:
'"Google Chrome";v="87", " Not;A Brand";v="99", "Chromium";v="87"'
,
"sec-ch-ua-mobile"
:
"?0"
,
"sec-fetch-dest"
:
"document"
,
"sec-fetch-mode"
:
"navigate"
,
"sec-fetch-site"
:
"same-origin"
,
"sec-fetch-user"
:
"?1"
,
"upgrade-insecure-requests"
:
"1"
,
"user-agent"
:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
,
}
import
requests
res
=
requests
.
get
(
url
,
headers
=
headers
)
print
(
res
.
text
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment