Cloxl / xhshow

小红书xs纯算 小红书个人主页 批量爬取数据 文章批量下载 小红书x-s x-t x-s-common x_b3_traceid search_id 旋转验证码参数纯算纯协议逆向
https://xhs.show
MIT License
71 stars 19 forks source link

解析出来的mp4url带了水印 #8

Closed qidai77777 closed 3 weeks ago

qidai77777 commented 3 weeks ago

{ "note": { "prevRouteData": {

    },
    "prevRoute": "Empty",
    "commentTarget": {

    },
    "isImgFullscreen": false,
    "gotoPage": "",
    "firstNoteId": "663c7d8d000000001e0351b5",
    "autoOpenNote": false,
    "topCommentId": "",
    "noteDetailMap": {
        "663c7d8d000000001e0351b5": {
            "comments": {
                "list": [

                ],
                "cursor": "",
                "hasMore": true,
                "loading": false,
                "firstRequestFinish": false
            },
            "currentTime": 1729583006262,
            "note": {
                "title": "戴这些劳力士的才是真大哥",
                "user": {
                    "nickname": "涛哥说表",
                    "avatar": "https://sns-avatar-qc.xhscdn.com/avatar/64538ff1ef5d5457eb82deca.jpg",
                    "userId": "5fa4baaf0000000001006195"
                },
                "tagList": [
                    {
                        "id": "53c40892b4c4d63304f8b07b",
                        "name": "手表",
                        "type": "topic"
                    },
                    {
                        "id": "53ddec64b4c4d60e382e5668",
                        "name": "男表",
                        "type": "topic"
                    },
                    {
                        "id": "5db2a97f0000000001038280",
                        "name": "劳力士",
                        "type": "topic"
                    },
                    {
                        "type": "topic",
                        "id": "5bf6939a29605b00018ac449",
                        "name": "高端腕表"
                    }
                ],
                "atUserList": [

                ],
                "time": 1715240333000,
                "shareInfo": {
                    "unShare": false
                },
                "noteId": "663c7d8d000000001e0351b5",
                "type": "video",
                "desc": "#手表[话题]#  #男表[话题]#  #劳力士[话题]#  #高端腕表[话题]#",
                "interactInfo": {
                    "collected": false,
                    "collectedCount": "59",
                    "commentCount": "1",
                    "shareCount": "12",
                    "followed": false,
                    "relation": "none",
                    "liked": false,
                    "likedCount": "197"
                },
                "imageList": [
                    {
                        "fileId": "",
                        "height": 1920,
                        "width": 1080,
                        "url": "",
                        "infoList": [
                            {
                                "imageScene": "WB_PRV",
                                "url": "http://sns-webpic-qc.xhscdn.com/202410221543/6429d62f018f2738246e513c7b3140a0/217/0/01e63c7d702954a80010000000018f5c4a0831_0.jpg!nd_prv_wlteh_webp_3"
                            },
                            {
                                "imageScene": "WB_DFT",
                                "url": "http://sns-webpic-qc.xhscdn.com/202410221543/0f900925eb392310b14e9754aa16d31f/217/0/01e63c7d702954a80010000000018f5c4a0831_0.jpg!nd_dft_wlteh_webp_3"
                            }
                        ],
                        "livePhoto": false,
                        "traceId": "",
                        "urlPre": "http://sns-webpic-qc.xhscdn.com/202410221543/6429d62f018f2738246e513c7b3140a0/217/0/01e63c7d702954a80010000000018f5c4a0831_0.jpg!nd_prv_wlteh_webp_3",
                        "urlDefault": "http://sns-webpic-qc.xhscdn.com/202410221543/0f900925eb392310b14e9754aa16d31f/217/0/01e63c7d702954a80010000000018f5c4a0831_0.jpg!nd_dft_wlteh_webp_3",
                        "stream": {

                        }
                    }
                ],
                "video": {
                    "image": {
                        "thumbnailFileid": "110/0/01e63c7d8d4fc1b00010000000018f5c4a7e85_0.webp"
                    },
                    "capa": {
                        "duration": 16
                    },
                    "consumer": {
                        "originVideoKey": "spectrum/1040g2f0312iohnapni005nt4nang8ocligc8t08"
                    },
                    "media": {
                        "stream": {
                            "h264": [
                                {
                                    "vmaf": -1,
                                    "psnr": 0,
                                    "videoCodec": "h264",
                                    "audioBitrate": 56073,
                                    "ssim": 0,
                                    "streamType": 259,
                                    "duration": 16743,
                                    "audioCodec": "aac",
                                    "height": 1280,
                                    "volume": 0,
                                    "fps": 30,
                                    "videoDuration": 16700,
                                    "backupUrls": [
                                        "http://sns-bak-v1.xhscdn.com/stream/110/259/01e63c7d8d4fc1b0010373038f5c4abd22_259.mp4",
                                        "http://sns-bak-v2.xhscdn.com/stream/110/259/01e63c7d8d4fc1b0010373038f5c4abd22_259.mp4"
                                    ],
                                    "width": 720,
                                    "size": 1193782,
                                    "videoBitrate": 508452,
                                    "avgBitrate": 570402,
                                    "masterUrl": "http://sns-video-al.xhscdn.com/stream/110/259/01e63c7d8d4fc1b0010373038f5c4abd22_259.mp4",
                                    "qualityType": "HD",
                                    "defaultStream": 0,
                                    "audioChannels": 2,
                                    "weight": 62,
                                    "rotate": 0,
                                    "hdrType": 0,
                                    "streamDesc": "WM_X264_MP4",
                                    "format": "mp4",
                                    "audioDuration": 16742
                                }
                            ],
                            "h265": [

                            ],
                            "h266": [

                            ],
                            "av1": [

                            ]
                        },
                        "videoId": 136863348620771760,
                        "video": {
                            "drmType": 0,
                            "streamTypes": [
                                259
                            ],
                            "bizName": 110,
                            "bizId": "280978536699482549",
                            "duration": 17,
                            "md5": "be0d23232e7fbb831325ad5998ac6720",
                            "hdrType": 0
                        }
                    }
                },
                "lastUpdateTime": 1715240333000
            }
        }
    },
    "serverRequestInfo": {
        "state": "success",
        "errorCode": 0,
        "errMsg": ""
    },
    "volume": 0,
    "recommendVideoMap": {

    },
    "videoFeedType": "note_source",
    "rate": 1,
    "currentNoteId": "663c7d8d000000001e0351b5",
    "mediaWidth": 450,
    "noteHeight": 800
}

}

Cloxl commented 3 weeks ago

本项目不太关注视频创作 基于您提供的 NoteId: 663c7d8d000000001e0351b5 位于["note"]["noteDetailMap"]["663c7d8d000000001e0351b5"]["note"]["video"]["media"]["stream"]["h265"][0]["masterUrl"] 这里的url是无水印的 http://sns-video-bd.xhscdn.com/stream/110/433/01e63c7d8d4fc1b0010373038f5e2a06c0_433.mp4

yinsijia849 commented 2 weeks ago

本项目不太关注视频创作 基于您提供的 NoteId: 663c7d8d000000001e0351b5 位于["note"]["noteDetailMap"]["663c7d8d000000001e0351b5"]["note"]["video"]["media"]["stream"]["h265"][0]["masterUrl"] 这里的url是无水印的 http://sns-video-bd.xhscdn.com/stream/110/433/01e63c7d8d4fc1b0010373038f5e2a06c0_433.mp4

这个url是怎么提取出来的?我采集的 ["663c7d8d000000001e0351b5"]["note"]["video"]["media"]["stream"]["h265"]这个位置下面没有值

Cloxl commented 2 weeks ago

很简单 这个值在index.html内才能提取 请求对应帖子(带xsec token) 把html content使用 提取器提取

replacements = {
    'undefined': 'null',
    "'": '"',
    'True': 'true',
    'False': 'false',
    'None': 'null'
}