-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release v0.0.1.6 pw2累计更新修复 24/May/04 - 24/Jun/28 #106
Conversation
.mp4 -> .flv
适用于嵌套的带转义字符的json
.mp4 -> .flv
添加了一些ssl错误的解决方案
添加status_code和exclude_list
"PyExecJS==1.5.1" "protobuf==4.23.0"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth considering. View full project report here.
return data_dict | ||
|
||
@classmethod | ||
async def WebcastLikeMessage(self, data: bytes): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async def WebcastLikeMessage(self, data: bytes): | |
async def WebcastLikeMessage(cls, data: bytes): |
Likewise, Consider using cls
instead.
) | ||
logger.info( | ||
"[WebcastLikeMessage] [👍点赞消息] | " | ||
+ "[用户Id:{0}] [当前用户点赞:{1}] [总点赞:{2}]".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-string is easier to read, write, and less computationally expensive than legacy string formatting. More info.
return data_dict | ||
|
||
@classmethod | ||
async def WebcastMemberMessage(self, data: bytes): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async def WebcastMemberMessage(self, data: bytes): | |
async def WebcastMemberMessage(cls, data: bytes): |
Likewise, Consider using cls
instead.
return data_dict | ||
|
||
@classmethod | ||
async def WebcastChatMessage(self, data: bytes): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async def WebcastChatMessage(self, data: bytes): | |
async def WebcastChatMessage(cls, data: bytes): |
As above, Consider using cls
instead.
except httpx.NetworkError as exc: | ||
logger.error(traceback.format_exc()) | ||
raise APIConnectionError( | ||
"{0}。 链接:{1},代理:{2},异常类名:{3},异常详细信息:{4}".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, Consider using f-string instead.
except httpx.ProtocolError as exc: | ||
logger.error(traceback.format_exc()) | ||
raise APIUnauthorizedError( | ||
"{0}。 链接:{1},代理:{2},异常类名:{3},异常详细信息:{4}".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, Consider using f-string instead.
except httpx.ProxyError as exc: | ||
logger.error(traceback.format_exc()) | ||
raise APIConnectionError( | ||
"{0}。 链接:{1},代理:{2},异常类名:{3},异常详细信息:{4}".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: Consider using f-string instead.
except httpx.HTTPStatusError as exc: | ||
logger.error(traceback.format_exc()) | ||
raise APIResponseError( | ||
"{0}。链接:{1} 代理:{2},异常类名:{3},异常详细信息:{4}".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, Consider using f-string instead.
_("输入的URL List不合法。类名:{0}").format(cls.__name__) | ||
) | ||
raise APINotFoundError( | ||
"输入的URL List不合法。类名:{0}".format(cls.__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, Consider using f-string instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Worth considering though. View full project report here.
if response.status_code in {200, 444}: | ||
if cls._TIKTOK_NOTFOUND_PARREN.search(str(response.url)): | ||
raise APINotFoundError( | ||
"页面不可用,可能是由于区域限制(代理)造成的。类名:{0}".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: Consider using f-string instead.
tweet_media_url = [tweet_data_dict.get("tweet_media_url")] | ||
for i, image_url in enumerate(tweet_media_url): | ||
image_name = f"{format_file_name(kwargs.get('naming'), tweet_data_dict)}_image_{i + 1}" | ||
if image_url != None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if image_url != None: | |
if image_url is not None: |
None
is a singleton data type, so should be compared using is not
. More info.
try: | ||
return naming_template.format(**fields) | ||
except KeyError as e: | ||
raise KeyError(_("文件名模板字段 {0} 不存在,请检查".format(e))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-string is easier to read, write, and less computationally expensive than legacy string formatting. Explained here.
for i, image_url in enumerate(weibo_data_dict.get("pic_infos")): | ||
image_name = f"{format_file_name(kwargs.get('naming'), weibo_data_dict)}_image_{i + 1}" | ||
image_url = WeiboAPIEndpoints.LARGEST + f"/{image_url}" | ||
if image_url != None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if image_url != None: | |
if image_url is not None: |
None
is a singleton data type, so should be compared using is not
. Read more.
try: | ||
return naming_template.format(**fields) | ||
except KeyError as e: | ||
raise KeyError(_("文件名模板字段 {0} 不存在,请检查".format(e))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-string is easier to read, write, and less computationally expensive than legacy string formatting. More info.
@@ -74,10 +91,12 @@ async def get_content_length(url: str, headers: dict = {}, proxies: dict = {}) - | |||
) | |||
return 0 | |||
except httpx.RequestError as e: | |||
logger.error(f"httpx 请求错误: {0}, 错误详情: {1}".format(url, e)) | |||
logger.error(traceback.format_exc()) | |||
logger.error(_("httpx 请求错误:{0},错误详情:{1}".format(url, e))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-string is easier to read, write, and less computationally expensive than legacy string formatting. More details.
) | ||
|
||
abogus = self.crypto_utility.abogus_encode(abogus_bytes_str, 0) | ||
params = "%s&a_bogus=%s" % (params, abogus) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params = "%s&a_bogus=%s" % (params, abogus) | |
params = f"{params}&a_bogus={abogus}" |
f-string is easier to read, write, and less computationally expensive than legacy string formatting. Read more.
""" | ||
|
||
# 将输入字符串转换为ASCII码的二进制形式 | ||
binary_string = "".join(["{:08b}".format(ord(char)) for char in input_string]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, Consider using f-string instead.
@@ -216,16 +219,21 @@ def getXBogus(self, url_path): | |||
ord(garbled_code[idx + 2]), | |||
) | |||
idx += 3 | |||
self.params = "%s&X-Bogus=%s" % (url_path, xb_) | |||
self.params = "%s&X-Bogus=%s" % (url_params, xb_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.params = "%s&X-Bogus=%s" % (url_params, xb_) | |
self.params = f"{url_params}&X-Bogus={xb_}" |
f-string is easier to read, write, and less computationally expensive than legacy string formatting. More.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
[0.0.1.6] - 2024-05-04
Added
weibo
应用abogus(limit ua)
加密douyin
加密算法切换配置WebSocket
爬虫客户端douyin
直播wss签名管理器douyin
直播wss签名生成类douyin
工具JS库webmssdk.es5-1.0.0.53
douyin
直播间弹幕wss接口F2
版本检测tiktok
直播间开播状态PyExecJS==1.5.1
依赖protobuf==4.23.0
依赖websockets>=11.0
依赖tiktok
的device_id注册
与cookie
管理类douyin
生成webid
配置douyin
关注用户直播douyin
,tiktok
模型配置conf.yaml
配置版本号tiktok
集成测试traceback
输出douyin
短剧作品transport
douyin
直播弹幕初始化douyin
合集mix_id
获取方法douyin
查询用户UTC/GMT+08:00
)ClientConfManager
为每个应用提供方便的配置读取uniqueId
查询tiktok
的user_db
segments
的duration
列表方法tiktok
作品搜索tiktok
用户直播JSON
方法douyin
相关推荐douyin
好友作品Changed
__aexit__
方法douyin
加密算法代码片段weibo
测试用例bool
的预处理douyin
的xbogus
调用Content-Length
的方法douyin
直播结束时下载崩溃BaseCrawler
类处理httpx
即将弃用proxies
参数tiktok
的msToken
配置ClientConfManager
参数base_downloader
的区块下载参数douyin
生成的ttwid
将绑定ua
tiktok
用户直播下载流地址douyin
,tiktok
获取用户信息方法名http: https: -> http://: https://:
)xb
算法示例部分base_crawler
异常捕获与输出--auto-cookie
命令后退出douyin
过滤器,将video_play_addr
返回完整视频列表便于下载失败轮替douyin
图集文件名(jpg -> webp
)mp4 -> flv
)Deprecated
douyin
SSO扫码登录BaseModel
中的dict
方法已弃用(pydantic>=2.6.4
)datetime
中的utcnow
方法已弃用douyin
,tiktok
获取用户名方法Removed
tiktok
基础请求模型的无用参数f2\utils\utils.py
无效导入Fixed
douyin
接口更新导致的错误 [BUG] [Fixed] if len(aweme) == 1 TypeError: object of type 'NoneType' has no len() 报错的看这里 #104_dl
日志输出douyin
下载合集时合集链接无法识别的情况tiktok
下载播放列表(合集)的错误m3u8
流下载时会重复下载ts
片段的问题m3u8
流获取content_length
时没有提供代理参数造成的访问失败douyin
,tiktok
因提前引发异常导致无法生成虚假的msTokenSecurity
pytest
版本到8.2.1
pydantic
版本到2.6.4
httpx
版本到0.27.0
aiosqlite
版本到0.20.0
Resolve
#104
#103
#102
#99
#98
#95
#88
#79
#78
Johnserf-Seed/TikTokDownload#703
Johnserf-Seed/TikTokDownload#718
Johnserf-Seed/TikTokDownload#711
Johnserf-Seed/TikTokDownload#702