detached 最近的时间轴更新
detached

detached

V2EX 第 527789 号会员,加入于 2021-01-11 15:27:43 +08:00
今日活跃度排名 9013
detached 最近回复了
@MyFaith "又要部署前端,又要配数据库( MySQL/Redis )"
@itechify anyroute, agentrouter
@frostpg11 id 1834
注册不了,gmail 收不到邮件
16 天前
回复了 ChuanZhang714 创建的主题 职场话题 船长的副业日记
一台手机一个月 150 ,这回本周期有点长啊
@guiyumin 效率太高了🤣,你真棒🎉🎉

是不是有可能将这个问题上升到一个更大 feature 的程度,而不是对 X 的 workaround ?
@guiyumin 不好意思,我没有 telegram :(, 要不 GitHub Issue or Discord or Gmail 讨论一下?
@guiyumin

随便找的一个视频 https://x.com/ebh6p/status/1996271881436250173 (! nsfw)。未登录的情况下,直接通过浏览器是无法查看的,会显示:

「 Age-restricted adult content. This content might not be appropriate for people under 18 years old. To view this media, you’ll need to log in to X. Learn more



遇到的第一个问题 (HTTP 400):

工具一开始无法解析,报错提示 GraphQL 请求缺少了一些必要的 Feature 参数:

✗ 解析失败: failed to fetch tweet: GraphQL request failed with status 400: {"errors":[{"message":"The following features cannot be

Error: failed to fetch tweet: GraphQL request failed with status 400: {"errors":[{"message":"The following features cannot be null: rweb_lists_timeline_redesign_enabled, tweetypie_unmention_optimization_enabled, responsive_web_media_download_video_enabled","extensions":{"name":"BadRequestError","source":"Client","code":336,"kind":"Validation","tracing":{"trace_id":"01c962adb89f6e35"}},"code":336,"kind":"Validation","name":"BadRequestError","source":"Client","tracing":{"trace_id":"01c962adb89f6e35"}}]}


修改之后:

diff --git a/internal/extractor/twitter.go b/internal/extractor/twitter.go
index f5ca9c0..fd8c7aa 100644
--- a/internal/extractor/twitter.go
+++ b/internal/extractor/twitter.go
@@ -178,6 +178,9 @@ func (t *TwitterExtractor) fetchFromGraphQL(tweetID string) (Media, error) {
"responsive_web_graphql_timeline_navigation_enabled": true,
"responsive_web_enhance_cards_enabled": false,
+ "rweb_lists_timeline_redesign_enabled": true,
+ "responsive_web_media_download_video_enabled": true,
+ "tweetypie_unmention_optimization_enabled": true,
}

再次执行:

➜ vget git:(main) ✗ ./build/vget https://x.com/ebh6p/status/1996271881436250173

✗ 解析失败: failed to fetch tweet: GraphQL request failed with status 404:

Error: failed to fetch tweet: GraphQL request failed with status 404:
@guiyumin 😯我没表述清楚,sorry 。

我的意思是推特上有一些视频是无法直接访问(在不登陆的情况下),所以 vget 下载不了。

所以需要增加用户登陆之后的 cookie/auth[1]之类的,vget 会考虑增加这一类的 feature 吗?

[1] https://github.com/caolvchong-top/twitter_download
有一些视频( e.g. nsfw )无法直接下载,应该是需要登陆,有考虑支持这一类的需求吗?
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2646 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms · UTC 12:00 · PVG 20:00 · LAX 04:00 · JFK 07:00
♥ Do have faith in what you're doing.