Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 可以正常解析,正常返回,但是下载的视频是个403文件,详情请见…… #500

Open
shuntan opened this issue Nov 13, 2024 · 14 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@shuntan
Copy link

shuntan commented Nov 13, 2024

403 Forbidden
openresty
Date: 2024/11/13 12:31:59

Node_info: 2308-CACHE14

Request_id: c305545f97701c59e2c90c84c6c22bf1

Client_ip: 2408:8469:900:2213:49:fccf:3c2d:2e70

Forbid_code: 020200

Hit-status: MISS

@shuntan shuntan added BUG Something isn't working enhancement New feature or request labels Nov 13, 2024
@Evil0ctal
Copy link
Owner

请提供更多上下文信息。

@Evil0ctal
Copy link
Owner

了解,尝试一下使用APP接口获取数据,Web的返回数据有限制。

@Evil0ctal
Copy link
Owner

不对,你这个是抖音的接口,那你使用响应中的其他key尝试下载一下。

@shuntan
Copy link
Author

shuntan commented Nov 13, 2024

WX20241113-163325@2x
实测返回的url有3个,前面1和2已经不可用了,第三个也不太稳定。

日志:2024/11/13 16:24:12 [Debug] Key 'play_addr' list=>[https://v26-webe.douyinvod.com/8a0469aaf9a4fae5f6aa14910dbca309/67348c7f/video/tos/cn/tos-cn-ve-15/ocIGcxgFDmZeDEem9RjCjOaAIRMekkEQzAeL2C/?a=6383&ch=26&cr=3&dr=0&lr=all&cd=0%7C0%7C0%7C3&cv=1&br=504&bt=504&cs=0&ds=6&ft=-t47actjjM9gAxR3bPsK2TO5CTJw60iXq1aUzUMyeF4&mime_type=video_mp4&qs=12&rc=NmQ2MzdlOjlkaTg0ODw7Z0Bpajw5dWs5cnV5djMzNGkzM0AuYDNfYC0tNTExLzUwLmM0YSM0NDRgMmQ0NWxgLS1kLTBzcw%3D%3D&btag=80000e00018000&cquery=100B_100H_100K_100o_100w&dy_q=1731486252&feature_id=46a7bb47b4fd1280f3d3825bf2b29388&l=20241113162412241FD709064ADE010611 https://v26-web.douyinvod.com/8a0469aaf9a4fae5f6aa14910dbca309/67348c7f/video/tos/cn/tos-cn-ve-15/ocIGcxgFDmZeDEem9RjCjOaAIRMekkEQzAeL2C/?a=6383&ch=26&cr=3&dr=0&lr=all&cd=0%7C0%7C0%7C3&cv=1&br=504&bt=504&cs=0&ds=6&ft=-t47actjjM9gAxR3bPsK2TO5CTJw60iXq1aUzUMyeF4&mime_type=video_mp4&qs=12&rc=NmQ2MzdlOjlkaTg0ODw7Z0Bpajw5dWs5cnV5djMzNGkzM0AuYDNfYC0tNTExLzUwLmM0YSM0NDRgMmQ0NWxgLS1kLTBzcw%3D%3D&btag=80000e00018000&cquery=100o_100w_100B_100H_100K&dy_q=1731486252&feature_id=46a7bb47b4fd1280f3d3825bf2b29388&l=20241113162412241FD709064ADE010611 https://www.douyin.com/aweme/v1/play/?video_id=v0300fg10000csov8r7og65hcr76797g&line=0&file_id=7df8193581254f4a86070bc4b063ca13&sign=e861fcff20a27d09dc59733b0cf59520&is_play_url=1&source=PackSourceEnum_AWEME_DETAIL]

你刚刚说可以用APP接口获取数据,抖音也可以用吗?

@Evil0ctal
Copy link
Owner

只有TikTok可用,抖音不可用。

@huazhiyeluo
Copy link

怎么解决403问题?

@shuntan
Copy link
Author

shuntan commented Nov 28, 2024

怎么解决403问题?

解决不了,只能用没有跨域验证的url,或者3xx moved的链接

@huazhiyeluo
Copy link

怎么解决403问题?

解决不了,只能用没有跨域验证的url,或者3xx moved的链接

问题一:
为啥别人的去水印工具又可以播放视频,又可以下载视频?
问题二: 他们的链接地址为啥以https://v3-dy.ixigua.com开头或者https://v5-coldy.douyinvod.com这样的,我接口获得是v26/v3那种格式?

@shuntan
Copy link
Author

shuntan commented Nov 28, 2024

怎么解决403问题?

解决不了,只能用没有跨域验证的url,或者3xx moved的链接

问题一:
为啥别人的去水印工具又可以播放视频,又可以下载视频?
问题二: 他们的链接地址为啥以https://v3-dy.ixigua.com开头或者https://v5-coldy.douyinvod.com这样的,我接口获得是v26/v3那种格式?

别人的接口可能是用的ios或者安卓客户端的API,而且是付费的,我也暂时没找到douyin App的解析接口,大佬上面也说了目前4.09的版本抖音用的是web解析接口。

@huazhiyeluo
Copy link

怎么解决403问题?

解决不了,只能用没有跨域验证的url,或者3xx moved的链接

问题一:
为啥别人的去水印工具又可以播放视频,又可以下载视频?
问题二: 他们的链接地址为啥以https://v3-dy.ixigua.com开头或者https://v5-coldy.douyinvod.com这样的,我接口获得是v26/v3那种格式?

别人的接口可能是用的ios或者安卓客户端的API,而且是付费的,我也暂时没找到douyin App的解析接口,大佬上面也说了目前4.09的版本抖音用的是web解析接口。

感谢大佬解惑,一直郁闷为啥人家的地址不一样,app端和web分开的啊

@Evil0ctal
Copy link
Owner

是的,目前APP的API可以付费调用,如果有需要可以看看这个项目:

https://api.tikhub.io/

@huazhiyeluo
Copy link

是的,目前APP的API可以付费调用,如果有需要可以看看这个项目:

https://api.tikhub.io/

这问个问题,还被你打个广告…

@Evil0ctal
Copy link
Owner

Evil0ctal commented Nov 29, 2024

是的,目前APP的API可以付费调用,如果有需要可以看看这个项目:
api.tikhub.io

这问个问题,还被你打个广告…

各取所需,不需要忽略即可,开源的Web接口使用这个JSON Path取播放链接也可以正常获取视频资源:

$.data.aweme_detail.video.bit_rate.[0].play_addr.url_list.[2]

附带上来自演示站点的请求CURL:

curl -X 'GET' \
  'https://douyin.wtf/api/douyin/web/fetch_one_video?aweme_id=7372484719365098803' \
  -H 'accept: application/json'

例子:

https://www.douyin.com/aweme/v1/play/?video_id=v0300fg10000cp856k7og65v9dtsd470&line=0&file_id=69d0639ea2a44ccc8a8c1c05a0134ef2&sign=9dc3d39482d5a99c1bece975da135bc3&is_play_url=1&source=PackSourceEnum_AWEME_DETAIL

请求代码:

import http.client

conn = http.client.HTTPSConnection("www.douyin.com")
payload = ''
headers = {

}
conn.request("GET", "/aweme/v1/play/?video_id=v0300fg10000cp856k7og65v9dtsd470&line=0&file_id=69d0639ea2a44ccc8a8c1c05a0134ef2&sign=9dc3d39482d5a99c1bece975da135bc3&is_play_url=1&source=PackSourceEnum_AWEME_DETAIL", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

@Evil0ctal Evil0ctal added help wanted Extra attention is needed and removed BUG Something isn't working labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants