zoukankan      html  css  js  c++  java
  • curl

    1.channel id
    curl -i -G -d "id=UCCj956IF62FbT7Gouszaj9w&part=snippet%2CcontentDetails%2Cstatistics&key=AIzaSyAdNHDMYEFZeNVZwzXleX8e2iYZqom-No4" https://www.googleapis.com/youtube/v3/channels

    {
    "kind": "youtube#channelListResponse",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/7wbJ4-j3I6e1NsOShVOrz50pRis"",
    "pageInfo": {
    "totalResults": 1,
    "resultsPerPage": 1
    },
    "items": [
    {
    "kind": "youtube#channel",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/-Q5dTJEn9ynxIjzP3HhUni1B13U"",
    "id": "UCCj956IF62FbT7Gouszaj9w",
    "snippet": {
    "title": "BBC",
    "description": "Highlights from the BBC.",
    "publishedAt": "2005-11-12T02:36:31.000Z",
    "thumbnails": {
    "default": {
    "url": "https://yt3.ggpht.com/-8EjKDh376Uw/AAAAAAAAAAI/AAAAAAAAAAA/-91t-1CKRD0/s88-c-k-no-mo-rj-c0xffffff/photo.jpg"
    },
    "medium": {
    "url": "https://yt3.ggpht.com/-8EjKDh376Uw/AAAAAAAAAAI/AAAAAAAAAAA/-91t-1CKRD0/s240-c-k-no-mo-rj-c0xffffff/photo.jpg"
    },
    "high": {
    "url": "https://yt3.ggpht.com/-8EjKDh376Uw/AAAAAAAAAAI/AAAAAAAAAAA/-91t-1CKRD0/s240-c-k-no-mo-rj-c0xffffff/photo.jpg"
    }
    },
    "localized": {
    "title": "BBC",
    "description": "Highlights from the BBC."
    }
    },
    "contentDetails": {
    "relatedPlaylists": {
    "uploads": "UUCj956IF62FbT7Gouszaj9w",
    "watchHistory": "HL",
    "watchLater": "WL"
    }
    },
    "statistics": {
    "viewCount": "4450747024",
    "commentCount": "15510",
    "subscriberCount": "4362357",
    "hiddenSubscriberCount": false,
    "videoCount": "22086"
    }
    }
    ]
    }

    2.uploads playlist
    curl -i -G -d "playlistId=UUCj956IF62FbT7Gouszaj9w&maxResults=4&part=snippet%2CcontentDetails&key=AIzaSyAdNHDMYEFZeNVZwzXleX8e2iYZqom-No4" https://www.googleapis.com/youtube/v3/playlistItems

    {
    "kind": "youtube#playlistItemListResponse",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/Mz-9o86xSB0msdWoZDhfpymK3f8"",
    "nextPageToken": "CAQQAA",
    "pageInfo": {
    "totalResults": 22086,
    "resultsPerPage": 4
    },
    "items": [
    {
    "kind": "youtube#playlistItem",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/wD3tSKDEbeDvoke0Eom3ji7RTmU"",
    "id": "VVVDajk1NklGNjJGYlQ3R291c3phajl3LkVZcHBOX2NLNXNJ",
    "snippet": {
    "publishedAt": "2018-01-29T17:47:26.000Z",
    "channelId": "UCCj956IF62FbT7Gouszaj9w",
    "title": "Extraordinary Footage of Baby Meerkats - Animals With Cameras Episode 1 | BBC One",
    "description": "Programme website: http://bbc.in/2EgRbvn Wearing tiny cameras around their necks, these meerkats give us an intimate insight into their world.",
    "thumbnails": {
    "default": {
    "url": "https://i.ytimg.com/vi/EYppN_cK5sI/default.jpg",
    "width": 120,
    "height": 90
    },
    "medium": {
    "url": "https://i.ytimg.com/vi/EYppN_cK5sI/mqdefault.jpg",
    "width": 320,
    "height": 180
    },
    "high": {
    "url": "https://i.ytimg.com/vi/EYppN_cK5sI/hqdefault.jpg",
    "width": 480,
    "height": 360
    },
    "standard": {
    "url": "https://i.ytimg.com/vi/EYppN_cK5sI/sddefault.jpg",
    "width": 640,
    "height": 480
    },
    "maxres": {
    "url": "https://i.ytimg.com/vi/EYppN_cK5sI/maxresdefault.jpg",
    "width": 1280,
    "height": 720
    }
    },
    "channelTitle": "BBC",
    "playlistId": "UUCj956IF62FbT7Gouszaj9w",
    "position": 0,
    "resourceId": {
    "kind": "youtube#video",
    "videoId": "EYppN_cK5sI"
    }
    },
    "contentDetails": {
    "videoId": "EYppN_cK5sI",
    "videoPublishedAt": "2018-01-29T17:47:26.000Z"
    }
    },
    {
    "kind": "youtube#playlistItem",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/yaGwlqwnugpQ_aLtpbvuEg4K_H4"",
    "id": "VVVDajk1NklGNjJGYlQ3R291c3phajl3Lm1MM0Nvc2VwWThn",
    "snippet": {
    "publishedAt": "2018-01-29T14:00:03.000Z",
    "channelId": "UCCj956IF62FbT7Gouszaj9w",
    "title": "How Does A Chimp Wash Its Hands? - Animals With Cameras Episode 1 | BBC One",
    "description": "Programme website: http://bbc.in/2EgRbvn Wearing small cameras, these chimpanzees take us up into the canopy and reveal their extraordinary intelligence.",
    "thumbnails": {
    "default": {
    "url": "https://i.ytimg.com/vi/mL3CosepY8g/default.jpg",
    "width": 120,
    "height": 90
    },
    "medium": {
    "url": "https://i.ytimg.com/vi/mL3CosepY8g/mqdefault.jpg",
    "width": 320,
    "height": 180
    },
    "high": {
    "url": "https://i.ytimg.com/vi/mL3CosepY8g/hqdefault.jpg",
    "width": 480,
    "height": 360
    },
    "standard": {
    "url": "https://i.ytimg.com/vi/mL3CosepY8g/sddefault.jpg",
    "width": 640,
    "height": 480
    },
    "maxres": {
    "url": "https://i.ytimg.com/vi/mL3CosepY8g/maxresdefault.jpg",
    "width": 1280,
    "height": 720
    }
    },
    "channelTitle": "BBC",
    "playlistId": "UUCj956IF62FbT7Gouszaj9w",
    "position": 1,
    "resourceId": {
    "kind": "youtube#video",
    "videoId": "mL3CosepY8g"
    }
    },
    "contentDetails": {
    "videoId": "mL3CosepY8g",
    "videoPublishedAt": "2018-01-29T14:00:03.000Z"
    }
    },
    {
    "kind": "youtube#playlistItem",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/h7CNGGwVik0JF44PsoQLsbPcZIw"",
    "id": "VVVDajk1NklGNjJGYlQ3R291c3phajl3LnMySkozcUIwdl9r",
    "snippet": {
    "publishedAt": "2018-01-26T19:03:40.000Z",
    "channelId": "UCCj956IF62FbT7Gouszaj9w",
    "title": "Tom Cruise & Simon Pegg teased Henry Cavill while filming - The Graham Norton Show - BBC One",
    "description": "Programme website: http://bbc.in/2FkwhuK Simon Pegg describes how he and tom cruise sang the superman theme tune as Henry Cavill ran alongside them when filming their latest movie.",
    "thumbnails": {
    "default": {
    "url": "https://i.ytimg.com/vi/s2JJ3qB0v_k/default.jpg",
    "width": 120,
    "height": 90
    },
    "medium": {
    "url": "https://i.ytimg.com/vi/s2JJ3qB0v_k/mqdefault.jpg",
    "width": 320,
    "height": 180
    },
    "high": {
    "url": "https://i.ytimg.com/vi/s2JJ3qB0v_k/hqdefault.jpg",
    "width": 480,
    "height": 360
    },
    "standard": {
    "url": "https://i.ytimg.com/vi/s2JJ3qB0v_k/sddefault.jpg",
    "width": 640,
    "height": 480
    },
    "maxres": {
    "url": "https://i.ytimg.com/vi/s2JJ3qB0v_k/maxresdefault.jpg",
    "width": 1280,
    "height": 720
    }
    },
    "channelTitle": "BBC",
    "playlistId": "UUCj956IF62FbT7Gouszaj9w",
    "position": 2,
    "resourceId": {
    "kind": "youtube#video",
    "videoId": "s2JJ3qB0v_k"
    }
    },
    "contentDetails": {
    "videoId": "s2JJ3qB0v_k",
    "videoPublishedAt": "2018-01-26T19:03:40.000Z"
    }
    },
    {
    "kind": "youtube#playlistItem",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/H4oE3Jm_NQ5hW1e168W0RHMdSyI"",
    "id": "VVVDajk1NklGNjJGYlQ3R291c3phajl3LmRVQy1UTTF5NUVj",
    "snippet": {
    "publishedAt": "2018-01-26T19:03:37.000Z",
    "channelId": "UCCj956IF62FbT7Gouszaj9w",
    "title": "Simon Pegg has now appeared in Star Trek, Star Wars and Doctor Who - The Graham Norton Show",
    "description": "Programme website: http://bbc.in/2FkwhuK Simon Pegg has achieved the trifecta of appearing in Star Trek, Star Wars and Doctor Who",
    "thumbnails": {
    "default": {
    "url": "https://i.ytimg.com/vi/dUC-TM1y5Ec/default.jpg",
    "width": 120,
    "height": 90
    },
    "medium": {
    "url": "https://i.ytimg.com/vi/dUC-TM1y5Ec/mqdefault.jpg",
    "width": 320,
    "height": 180
    },
    "high": {
    "url": "https://i.ytimg.com/vi/dUC-TM1y5Ec/hqdefault.jpg",
    "width": 480,
    "height": 360
    },
    "standard": {
    "url": "https://i.ytimg.com/vi/dUC-TM1y5Ec/sddefault.jpg",
    "width": 640,
    "height": 480
    },
    "maxres": {
    "url": "https://i.ytimg.com/vi/dUC-TM1y5Ec/maxresdefault.jpg",
    "width": 1280,
    "height": 720
    }
    },
    "channelTitle": "BBC",
    "playlistId": "UUCj956IF62FbT7Gouszaj9w",
    "position": 3,
    "resourceId": {
    "kind": "youtube#video",
    "videoId": "dUC-TM1y5Ec"
    }
    },
    "contentDetails": {
    "videoId": "dUC-TM1y5Ec",
    "videoPublishedAt": "2018-01-26T19:03:37.000Z"
    }
    }
    ]
    }

    3.//简化信息,方便处理
    curl -i -G -d "id=EYppN_cK5sI%2CmL3CosepY8g%2Cs2JJ3qB0v_k%2CdUC-TM1y5Ec&part=contentDetails%2Cstatistics&key=AIzaSyAdNHDMYEFZeNVZwzXleX8e2iYZqom-No4" https://www.googleapis.com/youtube/v3/videos/
    {
    "kind": "youtube#videoListResponse",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/GdfbhjSV2PDGkc12wvih4ctiho0"",
    "pageInfo": {
    "totalResults": 4,
    "resultsPerPage": 4
    },
    "items": [
    {
    "kind": "youtube#video",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/7geNuiQePuG8bGRmC2O0VD7FPC8"",
    "id": "EYppN_cK5sI",
    "contentDetails": {
    "duration": "PT2M37S",
    "dimension": "2d",
    "definition": "hd",
    "caption": "false",
    "licensedContent": true,
    "projection": "rectangular"
    },
    "statistics": {
    "viewCount": "5010",
    "likeCount": "275",
    "dislikeCount": "2",
    "favoriteCount": "0",
    "commentCount": "28"
    }
    },
    {
    "kind": "youtube#video",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/dr4iY4CAc48emSjuGCZAk8MYGXA"",
    "id": "mL3CosepY8g",
    "contentDetails": {
    "duration": "PT1M16S",
    "dimension": "2d",
    "definition": "hd",
    "caption": "false",
    "licensedContent": true,
    "projection": "rectangular"
    },
    "statistics": {
    "viewCount": "8345",
    "likeCount": "294",
    "dislikeCount": "5",
    "favoriteCount": "0",
    "commentCount": "30"
    }
    },
    {
    "kind": "youtube#video",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/jXQpWYQm0apFAOnN0cSNZx5VqCc"",
    "id": "s2JJ3qB0v_k",
    "contentDetails": {
    "duration": "PT1M7S",
    "dimension": "2d",
    "definition": "hd",
    "caption": "false",
    "licensedContent": true,
    "projection": "rectangular"
    },
    "statistics": {
    "viewCount": "94774",
    "likeCount": "712",
    "dislikeCount": "15",
    "favoriteCount": "0",
    "commentCount": "68"
    }
    },
    {
    "kind": "youtube#video",
    "etag": ""Wu2llbfqCdxIVjGbVPm2DslKPCA/HjwPMZTH_nx-uPwoCZa08TinsZs"",
    "id": "dUC-TM1y5Ec",
    "contentDetails": {
    "duration": "PT1M3S",
    "dimension": "2d",
    "definition": "hd",
    "caption": "false",
    "licensedContent": true,
    "projection": "rectangular"
    },
    "statistics": {
    "viewCount": "32586",
    "likeCount": "333",
    "dislikeCount": "3",
    "favoriteCount": "0",
    "commentCount": "24"
    }
    }
    ]
    }


    curl -i -G -d "playlistId=UUCj956IF62FbT7Gouszaj9w&maxResults=4&pageToken=CAQQAA&part=snippet%2CcontentDetails&key=AIzaSyAdNHDMYEFZeNVZwzXleX8e2iYZqom-No4" https://www.googleapis.com/youtube/v3/playlistItems

  • 相关阅读:
    java中public、private、protected区别
    Java构造函数
    吸血鬼数字算法
    JsonConvert.DeserializeObject<T>对象属性为空
    vs2015项目引用其他项目无法引用
    iis express 无法访问此网站
    c#Dictionary保存不同类型
    HttpContext.GetOwinContext().Authentication 报错 解决办法
    CSS基础1
    CSS基础3
  • 原文地址:https://www.cnblogs.com/jiangzhaowei/p/8408982.html
Copyright © 2011-2022 走看看