Skip to content

Fix: Improve X media extraction and manual cookie fallback#76

Open
SiIverAsh wants to merge 1 commit intotonhowtf:mainfrom
SiIverAsh:fix/twitter-media-cookie
Open

Fix: Improve X media extraction and manual cookie fallback#76
SiIverAsh wants to merge 1 commit intotonhowtf:mainfrom
SiIverAsh:fix/twitter-media-cookie

Conversation

@SiIverAsh
Copy link
Copy Markdown

Summary

This PR improves X media extraction and fallback behavior.

Changes

  • add a manual cookie setting that can be used when downloads fail
  • pass the manual cookie into X native requests and yt-dlp fallback
  • skip cookies-from-browser when an explicit Cookie: header is already provided
  • improve X media extraction for nested, quoted, and retweeted media structures
  • improve fallback error reporting so native and yt-dlp failures are both visible
  • support original-size X photo URLs
  • treat multi-item X posts as multi-file media consistently

Why

Some X posts could fail with No media found in tweet even when media existed.

There were several failure modes behind that:

  • public endpoints returning tombstone or unavailable results
  • media being nested inside quoted or retweeted tweet structures
  • HLS-only video variants
  • yt-dlp fallback being blocked by cookie, browser-cookie, or proxy issues
  • photo posts needing better handling

This PR makes the extraction path more robust and adds a manual cookie fallback when automatic cookie handling is not enough.

Validation

Tested locally with:

  • a X video URL that previously failed with No media found in tweet
  • a X video URL that already worked
  • X image and mixed-media parsing behavior in the updated extraction path
problem_example success_parse

@SiIverAsh SiIverAsh changed the title Fix: Improve twitter media extraction and manual cookie fallback Fix: Improve X media extraction and manual cookie fallback Apr 14, 2026
@tonhowtf tonhowtf self-requested a review April 14, 2026 17:35
@tonhowtf tonhowtf self-assigned this Apr 14, 2026
@tonhowtf tonhowtf added the enhancement New feature or request label Apr 14, 2026
@tonhowtf
Copy link
Copy Markdown
Owner

哥们儿,你根本不知道 omniget 项目能多一个贡献者我有多开心!你那个 PR 我今天肯定会抽时间看的!进我们 Discord 吧,可以看到最新动态,有啥事也能快速找到我,我基本上是秒回的,很少会拖着不回。

@tonhowtf tonhowtf removed their request for review April 14, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants