diff --git a/crawlers/tiktok/web/config.yaml b/crawlers/tiktok/web/config.yaml index 0d333b8..c3016fb 100644 --- a/crawlers/tiktok/web/config.yaml +++ b/crawlers/tiktok/web/config.yaml @@ -10,7 +10,7 @@ TokenManager: https: msToken: - url: https://mssdk-sg.tiktok.com/web/common?msToken=1Ab-7YxR9lUHSem0PraI_XzdKmpHb6j50L8AaXLAd2aWTdoJCYLfX_67rVQFE4UwwHVHmyG_NfIipqrlLT3kCXps-5PYlNAqtdwEg7TrDyTAfCKyBrOLmhMUjB55oW8SPZ4_EkNxNFUdV7MquA== + url: https://mssdk.tiktokw.us/web/report?msToken=1Ab-7YxR9lUHSem0PraI_XzdKmpHb6j50L8AaXLAd2aWTdoJCYLfX_67rVQFE4UwwHVHmyG_NfIipqrlLT3kCXps-5PYlNAqtdwEg7TrDyTAfCKyBrOLmhMUjB55oW8SPZ4_EkNxNFUdV7MquA== magic: 538969122 version: 1 dataType: 8 diff --git a/crawlers/tiktok/web/utils.py b/crawlers/tiktok/web/utils.py index 8212727..a53fd76 100644 --- a/crawlers/tiktok/web/utils.py +++ b/crawlers/tiktok/web/utils.py @@ -76,9 +76,6 @@ class TokenManager: msToken = str(httpx.Cookies(response.cookies).get("msToken")) - if len(msToken) not in [148]: - raise APIResponseError("{0} 内容不符合要求".format("msToken")) - return msToken # except httpx.RequestError as exc: @@ -90,7 +87,7 @@ class TokenManager: # except httpx.HTTPStatusError as e: # # 捕获 httpx 的状态代码错误 (captures specific status code errors from httpx) # if response.status_code == 401: - # raise APIUnauthorizedError("参数验证失败,请更新 F2 配置文件中的 {0},以匹配 {1} 新规则" + # raise APIUnauthorizedError("参数验证失败,请更新 Douyin_TikTok_Download_API 配置文件中的 {0},以匹配 {1} 新规则" # .format("msToken", "tiktok") # ) # @@ -151,7 +148,7 @@ class TokenManager: except httpx.HTTPStatusError as e: # 捕获 httpx 的状态代码错误 (captures specific status code errors from httpx) if response.status_code == 401: - raise APIUnauthorizedError("参数验证失败,请更新 F2 配置文件中的 {0},以匹配 {1} 新规则" + raise APIUnauthorizedError("参数验证失败,请更新 Douyin_TikTok_Download_API 配置文件中的 {0},以匹配 {1} 新规则" .format("ttwid", "tiktok") ) @@ -190,7 +187,7 @@ class TokenManager: except httpx.HTTPStatusError as e: # 捕获 httpx 的状态代码错误 (captures specific status code errors from httpx) if response.status_code == 401: - raise APIUnauthorizedError("参数验证失败,请更新 F2 配置文件中的 {0},以匹配 {1} 新规则" + raise APIUnauthorizedError("参数验证失败,请更新 Douyin_TikTok_Download_API 配置文件中的 {0},以匹配 {1} 新规则" .format("odin_tt", "tiktok") ) diff --git a/crawlers/tiktok/web/web_crawler.py b/crawlers/tiktok/web/web_crawler.py index 8fd2b37..ce293a3 100644 --- a/crawlers/tiktok/web/web_crawler.py +++ b/crawlers/tiktok/web/web_crawler.py @@ -348,10 +348,10 @@ class TikTokWebCrawler: # print(response) # 获取用户的个人信息 - # secUid = "MS4wLjABAAAAfDPs6wbpBcMMb85xkvDGdyyyVAUS2YoVCT9P6WQ1bpuwEuPhL9eFtTmGvxw1lT2C" - # uniqueId = "c4shjaz" - # response = await self.fetch_user_profile(secUid, uniqueId) - # print(response) + secUid = "MS4wLjABAAAAfDPs6wbpBcMMb85xkvDGdyyyVAUS2YoVCT9P6WQ1bpuwEuPhL9eFtTmGvxw1lT2C" + uniqueId = "c4shjaz" + response = await self.fetch_user_profile(secUid, uniqueId) + print(response) # 获取用户的作品列表 # secUid = "MS4wLjABAAAAfDPs6wbpBcMMb85xkvDGdyyyVAUS2YoVCT9P6WQ1bpuwEuPhL9eFtTmGvxw1lT2C"