Skip to content

[BUG] - Failed to create Sound with data #1253

@Aurora-ks

Description

@Aurora-ks

When I get trending with api.trending.videos, it always returns live instead of video, is it possible to filter it?
response like this:
TikTokApi.tiktok - ERROR - Failed to create Sound with data:

{
  "CategoryType": 120,
  "containerType": 2,
  "createTime": 0,
  "desc": "",
  "digged": false,
  "forFriend": false,
  "id": "",
  "itemCommentStatus": 0,
  "liveRoomInfo": {
    "coverUrl": "https://p16-sign-sg.tiktokcdn.com/tos-alisg-avt-0068/aa288c342cb7f621786c55b460d15a0c~tplv-tiktokx-cropcenter:720:720.webp?dr=14579&refresh_token=f17d6509&x-expires=1755914400&x-signature=KKKvxvX%2BLQNuMiPygcOYxQmXwv0%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=fdd36af4&idc=sg1",
    "followStatus": 0,
    "fypRoomTag": {
      "sub_tag": [
        {
          "content": "",
          "da_info": "",
          "id": 0,
          "recommond_info": "",
          "style": 0
        }
      ],
      "tag": [
        {
          "content": "直播中",
          "da_info": "",
          "id": 4,
          "recommond_info": "",
          "style": 1
        }
      ]
    },
    "landscape": 2,
    "likeCount": 13893,
    "liveRoomStats": {
      "userCount": 7
    },
    "liveSubOnly": 0,
    "liveUrl": "",
    "mode": 0,
    "ownerInfo": {
      "UserStoryStatus": 0,
      "avatarLarger": "https://p16-sign-sg.tiktokcdn.com/tos-alisg-avt-0068/aa288c342cb7f621786c55b460d15a0c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=9de82cff&x-expires=1755914400&x-signature=BCLkg7wY5c1e7Lu4uWZHTVCwVcM%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=sg1",
      "avatarMedium": "https://p16-sign-sg.tiktokcdn.com/tos-alisg-avt-0068/aa288c342cb7f621786c55b460d15a0c~tplv-tiktokx-cropcenter:720:720.jpeg?dr=14579&refresh_token=093e286c&x-expires=1755914400&x-signature=CTrd9%2F5BhBQqXoxH%2Bsm2N9eRjpc%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=sg1",
      "avatarThumb": "https://p16-sign-sg.tiktokcdn.com/tos-alisg-avt-0068/aa288c342cb7f621786c55b460d15a0c~tplv-tiktokx-cropcenter:100:100.jpeg?dr=14579&refresh_token=a7bdb084&x-expires=1755914400&x-signature=hdV5QGe6qjWMkOZTitu8%2FRkKQco%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=sg1",
      "ftc": false,
      "id": "7502338145633174546",
      "nickname": "House of Archons",
      "openFavorite": false,
      "privateAccount": false,
      "relation": 0,
      "secret": false,
      "signature": "",
      "uniqueId": "archons89",
      "verified": false
    },
    "previewCommentInfo": {
      "comment_list": [
        {
          "content": "点赞数排名前0.1%",
          "id": 7540853646217465000,
          "item_type": 3
        }
      ],
      "expire_time": 0,
      "polling_interval": 0,
      "title": "AI"
    },
    "roomID": "7540790307853798162",
    "shareCount": 13,
    "status": 2,
    "streamData": "https://v19-web-newkey.tiktokcdn.com/9badc1da9d060de1c038950402c6856d/68ce0c5a/video/tos/alisg/tos-alisg-v-518157-sg/owgGeADAIFYAINLARMrL3rKekzwjCT9TMIDe2t/?a=1988&bti=MzY5QDQyM2A%3D&ch=0&cr=0&dr=0&cd=0%7C0%7C0%7C0&br=3556&bt=1778&cs=0&ds=3&ft=.CApiInz7ThVXC0KXq8Zmo&mime_type=video_mp4&qs=13&rc=anRxbXY5cnQ4NTQzOGY6NEBpanRxbXY5cnQ4NTQzOGY6NEBzamExMmRjYGdhLS1kYi1zYSNzamExMmRjYGdhLS1kYi1zcw%3D%3D&vvpl=1&l=202508211006218D150E2929D4C40D9EFF&btag=e00050000&download=true&filename=1755741982.mp4",
    "title": "Genshin honkai love and deepspace"
  },
  "officalItem": false,
  "originalItem": false,
  "privateItem": false,
  "secret": false
}

my code:

    async with TikTokApi() as api:
        ms_token = ""
        await api.create_sessions(ms_tokens=ms_token, num_sessions=1, sleep_after=5, headless=False)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions