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

请问/api/hybrid/video_data?minimal=false的时候 如何判断传入的链接是视频还是图集 #552

Closed
kiko923 opened this issue Feb 15, 2025 · 6 comments
Assignees
Labels
BUG Something isn't working enhancement New feature or request

Comments

@kiko923
Copy link

kiko923 commented Feb 15, 2025

请问**/api/hybrid/video_data?minimal=false**的时候
如何判断传入的链接是视频还是图集
只有minimal=true的时候 会有一个type字段
"type": "image"
当minimal=false的时候 这个type字段就不见了 无法判断是视频还是图集

@kiko923 kiko923 added BUG Something isn't working enhancement New feature or request labels Feb 15, 2025
@Evil0ctal
Copy link
Owner

url_type = url_type_code_dict.get(aweme_type, 'video')

@Evil0ctal
Copy link
Owner

在这里使用aweme_type进行判断即可

@kiko923
Copy link
Author

kiko923 commented Feb 15, 2025

我的意思是 返回的json数据里面 没有这个值
我看了下只有这个

"aweme_type": 68,
"aweme_type_tags": "",
"boost_status": 0,
"can_cache_to_local": false,
"caption": "#cos #剑网3  #古风 #充能计划 诶 又让我找到一些花絮了哈哈哈哈",

@kiko923
Copy link
Author

kiko923 commented Feb 15, 2025

还有 麻烦4.1.0可以推送一下docker镜像嘛

@kiko923
Copy link
Author

kiko923 commented Feb 15, 2025

我的意思是 返回的json数据里面 没有这个值 我看了下只有这个

"aweme_type": 68,
"aweme_type_tags": "",
"boost_status": 0,
"can_cache_to_local": false,
"caption": "#cos #剑网3  #古风 #充能计划 诶 又让我找到一些花絮了哈哈哈哈",
        # 如果是最小数据,处理数据/If it is minimal data, process the data
        url_type_code_dict = {
            # common
            0: 'video',
            # Douyin
            2: 'image',
            4: 'video',
            68: 'image',
            # TikTok
            51: 'video',
            55: 'video',
            58: 'video',
            61: 'video',
            150: 'image'
        }
        # 判断链接类型/Judge link type
        url_type = url_type_code_dict.get(aweme_type, 'video')

明白了 从数组里面找键值来判断 刚刚才看到

@Evil0ctal
Copy link
Owner

是的,刚刚已经修复了dockerfile,你可以尝试拉取一下最新的镜像然后看看有没有问题👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants