Skip to content

腾讯视频刮削器链接匹配正则优化#27

Merged
fzlins merged 1 commit intofzlins:masterfrom
onelxzy:master
Jun 3, 2025
Merged

腾讯视频刮削器链接匹配正则优化#27
fzlins merged 1 commit intofzlins:masterfrom
onelxzy:master

Conversation

@onelxzy
Copy link
Copy Markdown
Contributor

@onelxzy onelxzy commented Jun 3, 2025

@fzlins fzlins requested a review from Copilot June 3, 2025 10:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 cid regex to match URLs both with and without a trailing segment.
  • Added a guard clause to raise a clear exception if cid extraction 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 be sourceData to 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 the cid extraction works as intended.
cid_match = re.search(r'/cover/([^/.]+)', url)

@fzlins fzlins merged commit eeed163 into fzlins:master Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants