腾讯视频刮削器链接匹配正则优化#27
Merged
fzlins merged 1 commit intofzlins:masterfrom Jun 3, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes the regular expression in the Tencent Video extractor to handle URLs that end directly with .html (without a trailing slash) and adds error handling when the cid cannot be extracted.
- Updated the
cidregex to match URLs both with and without a trailing segment. - Added a guard clause to raise a clear exception if
cidextraction fails.
Comments suppressed due to low confidence (2)
tmdb-import/extractors/qq.py:18
- There's a typo in the variable name
soureData; it should besourceDatato reflect the correct spelling.
soureData = json.loads(open_url(apiRequest).lstrip("QZOutputJson=").rstrip(";"))
tmdb-import/extractors/qq.py:11
- Consider adding unit tests covering both URL patterns (with and without
.html) to ensure thecidextraction works as intended.
cid_match = re.search(r'/cover/([^/.]+)', url)
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.
ex: https://v.qq.com/x/cover/mzc00200t0fg7k8/o0043eaefxx.html
ex: https://v.qq.com/x/cover/mzc00200t0fg7k8.html