Skip to content

Commit

Permalink
🔵获取数据失败时请从浏览器重新获取cookie
Browse files Browse the repository at this point in the history
由于接口变化大,如遇刷新cookie还是无法获取的情况可以注释referer键或切换网络环境清除缓存重试。
#437 #432 #403 #335 #330 #329 #311
  • Loading branch information
Johnserf-Seed committed Jun 9, 2023
1 parent 41bb54b commit fd757bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Util/Cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def dyCookie(self, conf):
else:
self.dyheaders = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36',
# 'referer': 'https://www.douyin.com/',
'referer': 'https://www.douyin.com/',
'Cookie': self.conf[3]
}
return self.dyheaders
Expand Down
2 changes: 1 addition & 1 deletion Util/Lives.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_Live(live_url:str):
headers = Util.Cookies(cmd.setting()).dyheaders
response = Util.requests.request("GET", live_api, headers=headers)
if response.text == '':
input('[ 🎦 ]:获取直播信息失败,请从web端获取新ttwid填入配置文件\r')
input('[ 🎦 ]:获取直播信息失败,请从web端获取新cookie填入配置文件\r')
exit()
live_json = Util.json.loads(response.text)

Expand Down
2 changes: 1 addition & 1 deletion Util/Profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def getProfile(self, param):
url=self.urls.USER_POST + datas[0], headers=self.headers, timeout=3)

if response.text == '':
input('[ 提示 ]:获取用户数据失败,请从web端获取新ttwid填入配置文件\r')
input('[ 提示 ]:获取用户数据失败,请从web端获取新cookie填入配置文件\r')
exit()

post_name_json = Util.json.loads(response.content.decode())
Expand Down

0 comments on commit fd757bf

Please sign in to comment.