fix: 支持淘宝直播完整 tbzb 链接解析 & cookies风控解决#1400
Open
turnerkoo15 wants to merge 1 commit into
Open
Conversation
Handle full Taobao live URLs, refreshed tokens, and Taobao's current live status values so active rooms resolve m3u8/flv addresses reliably. Add helper and stream tests to cover URL parsing, sign generation, and real stream retrieval.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
https://tbzb.taobao.com/live?liveId=...,不再只依赖短链_m_h5_tk/_m_h5_tk_enc过期后的刷新与重试逻辑,并使用 md5 重新计算接口签名liveUrlList但被误判为未开播的问题,保证能正确拿到最终m3u8/flv地址liveId提取、cookie 合并、签名计算和流地址获取验证方式
python3 -m unittest tests.test_taobao_helpersTAOBAO_TEST_URL=... TAOBAO_TEST_COOKIES=... uv run python -m unittest tests.test_taobao_streamhttps://tbzb.taobao.com/live?liveId=557156521789验证,已成功返回最终m3u8和flv地址影响范围
main.pysrc/spider.pysrc/taobao_utils.pytests/test_taobao_helpers.pytests/test_taobao_stream.py