{"id":27170,"date":"2025-07-10T16:36:34","date_gmt":"2025-07-10T09:36:34","guid":{"rendered":"https:\/\/dps.media\/?page_id=27170"},"modified":"2025-07-10T16:53:00","modified_gmt":"2025-07-10T09:53:00","slug":"youtube-%e6%92%ad%e6%94%be%e5%88%97%e8%a1%a8%e8%a7%86%e9%a2%91%e6%8f%90%e5%8f%96%e5%99%a8","status":"publish","type":"page","link":"https:\/\/dps.media\/zh\/youtube-%e6%92%ad%e6%94%be%e5%88%97%e8%a1%a8%e8%a7%86%e9%a2%91%e6%8f%90%e5%8f%96%e5%99%a8\/","title":{"rendered":"YouTube\u64ad\u653e\u5217\u8868\u89c6\u9891\u63d0\u53d6\u5668"},"content":{"rendered":"<!DOCTYPE html>\n<?xml encoding=\"utf-8\" ?><html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>YouTube\u64ad\u653e\u5217\u8868\u89c6\u9891\u63d0\u53d6\u5668<\/title>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      margin: 20px auto;\n      padding: 20px;\n      background-color: #f4f4f4;\n    }\n    h1 {\n      text-align: center;\n      color: #333;\n    }\n    .input-container {\n      display: flex;\n      gap: 10px;\n      margin-bottom: 20px;\n    }\n    #playlistUrl {\n      padding: 10px;\n      font-size: 16px;\n      flex-grow: 1;\n    }\n    button {\n      padding: 10px 20px;\n      background-color: #ff0000;\n      color: white;\n      border: none;\n      cursor: pointer;\n      font-size: 16px;\n    }\n    button:hover {\n      background-color: #cc0000;\n    }\n    #videoTable {\n      width: 100%;\n      border-collapse: collapse;\n      margin-top: 20px;\n    }\n    #videoTable th, #videoTable td {\n      border: 1px solid #ddd;\n      padding: 8px;\n      text-align: left;\n    }\n    #videoTable th {\n      background-color: #f2f2f2;\n    }\n    .thumbnail-container {\n      width: 100%;\n      padding-top: 56.25%; \/* 9\/16 * 100 = 56.25% for 16:9 ratio *\/\n      position: relative;\n    }\n    .thumbnail-container img {\n      position: absolute;\n      top: 0;\n      left: 0;\n      width: 100%;\n      height: 100%;\n      object-fit: cover;\n    }\n    #videoTable a {\n      color: #0066cc;\n      text-decoration: none;\n    }\n    #videoTable a:hover {\n      text-decoration: underline;\n    }\n    #error {\n      color: red;\n      text-align: center;\n      display: none;\n      margin-bottom: 20px;\n    }\n  <\/style>\n<\/head>\n<body>\n  <div class=\"input-container\">\n    <input type=\"text\" id=\"playlistUrl\" placeholder=\"\u8f93\u5165YouTube\u64ad\u653e\u5217\u8868URL\">\n    <button onclick=\"fetchVideos()\">\u63d0\u53d6\u89c6\u9891<\/button>\n  <\/div>\n  <div id=\"error\"><\/div>\n  <table id=\"videoTable\">\n    <thead>\n      <tr>\n        <th>\u5934\u50cf<\/th>\n        <th>\u94fe\u63a5<\/th>\n        <th>\u89c6\u9891\u540d\u79f0<\/th>\n      <\/tr>\n    <\/thead>\n    <tbody><\/tbody>\n  <\/table>\n\n  <script>\n    \/\/ Replace with your YouTube Data API key\n    const API_KEY = 'AIzaSyAQ3ICN5REWArOWcvxEgx0QjYqNeLJmqlk';\n\n    async function fetchVideos() {\n      const playlistUrl = document.getElementById('playlistUrl').value.trim();\n      const errorDiv = document.getElementById('error');\n      const tableBody = document.getElementById('videoTable').getElementsByTagName('tbody')[0];\n      tableBody.innerHTML = '';\n      errorDiv.style.display = 'none';\n\n      if (!playlistUrl) {\n        showError('Please enter a YouTube playlist URL.');\n        return;\n      }\n\n      const playlistId = extractPlaylistId(playlistUrl);\n      if (!playlistId) {\n        showError('Invalid playlist URL.');\n        return;\n      }\n\n      try {\n        const videos = await getPlaylistVideos(playlistId);\n        displayVideos(videos);\n      } catch (error) {\n        showError('Error fetching videos: ' + error.message);\n      }\n    }\n\n    function extractPlaylistId(url) {\n      const match = url.match(\/[?&]list=([a-zA-Z0-9_-]+)\/);\n      return match ? match[1] : null;\n    }\n\n    async function getPlaylistVideos(playlistId) {\n      let videos = [];\n      let nextPageToken = '';\n      const maxResults = 50; \/\/ Max per page allowed by YouTube API\n\n      do {\n        const response = await fetch(\n          `https:\/\/www.googleapis.com\/youtube\/v3\/playlistItems?part=snippet&maxResults=${maxResults}&playlistId=${playlistId}&key=${API_KEY}&pageToken=${nextPageToken}`\n        );\n        if (!response.ok) {\n          throw new Error('Failed to fetch playlist data. Check your API key or playlist ID.');\n        }\n        const data = await response.json();\n        videos = videos.concat(data.items);\n        nextPageToken = data.nextPageToken || '';\n      } while (nextPageToken);\n\n      return videos;\n    }\n\n    function displayVideos(videos) {\n      const tableBody = document.getElementById('videoTable').getElementsByTagName('tbody')[0];\n      if (videos.length === 0) {\n        showError('No videos found in the playlist.');\n        return;\n      }\n\n      videos.forEach(item => {\n        const video = item.snippet;\n        const videoId = video.resourceId.videoId;\n        const title = video.title;\n        const thumbnail = video.thumbnails?.medium?.url || 'https:\/\/via.placeholder.com\/160x90';\n        const videoUrl = `https:\/\/www.youtube.com\/watch?v=${videoId}`;\n\n        const row = tableBody.insertRow();\n        row.innerHTML = `\n          <td><div class=\"thumbnail-container\"><img decoding=\"async\" src=\"${thumbnail}\" alt=\"${title}\">\n          <td><a href=\"${videoUrl}\" target=\"_blank\">${videoUrl}\n          <td>${title}\n        `;\n      });\n    }\n\n    function showError(message) {\n      const errorDiv = document.getElementById('error');\n      errorDiv.textContent = message;\n      errorDiv.style.display = 'block';\n    }\n  <\/script>\n<\/body>\n<\/html><h3 class=\"wp-block-heading\">\u5728DPS.MEDIA\u4e0a\u514d\u8d39\u63a2\u7d22YouTube\u64ad\u653e\u5217\u8868\u89c6\u9891\u63d0\u53d6\u5668\u5de5\u5177<\/h3><h2 class=\"wp-block-heading\">\u4ec0\u4e48\u662fYouTube\u64ad\u653e\u5217\u8868\u89c6\u9891\u63d0\u53d6\u5668\u5de5\u5177\uff1f<\/h2><p><strong>YouTube\u64ad\u653e\u5217\u8868\u89c6\u9891\u63d0\u53d6\u5668<\/strong> \u8fd9\u662f\u4e00\u4e2a\u7531 <strong>DPS.MEDIA<\/strong>\u5f00\u53d1\u7684\u5728\u7ebf\u5de5\u5177\uff0c\u5141\u8bb8\u60a8\u901a\u8fc7\u51e0\u4e2a\u7b80\u5355\u7684\u64cd\u4f5c\u63d0\u53d6YouTube\u64ad\u653e\u5217\u8868\u4e2d\u7684\u6240\u6709\u89c6\u9891\u3002\u53ea\u9700\u8f93\u5165\u64ad\u653e\u5217\u8868URL\uff0c\u5de5\u5177\u5c06\u81ea\u52a8\u5206\u6790\u5e76\u63d0\u4f9b\u5e26\u6709\u8be6\u7ec6\u4fe1\u606f\u7684\u89c6\u9891\u5217\u8868\u3002\u8fd9\u662f\u5185\u5bb9\u521b\u4f5c\u8005\u3001\u8425\u9500\u4eba\u5458\u6216\u4efb\u4f55\u60f3\u8981\u4e13\u4e1a\u7ba1\u7406\u548c\u7ec4\u7ec7\u89c6\u9891\u7684\u4eba\u7684\u7406\u60f3\u5de5\u5177\u3002<\/p><h2 class=\"wp-block-heading\">\u5728DPS.MEDIA\u4e0a\u4f7f\u7528YouTube\u64ad\u653e\u5217\u8868\u89c6\u9891\u63d0\u53d6\u5668\u7684\u4f18\u52bf<\/h2><ul class=\"wp-block-list\">\n<li><strong>\u8282\u7701\u65f6\u95f4<\/strong>\uff1a\u65e0\u9700\u624b\u52a8\u590d\u5236\u6bcf\u4e2a\u89c6\u9891\u94fe\u63a5\uff0c\u8be5\u5de5\u5177\u53ef\u5728\u51e0\u79d2\u949f\u5185\u81ea\u52a8\u63d0\u53d6\u6240\u6709\u94fe\u63a5\u3002<\/li>\n\n\n\n<li><strong>100%\u514d\u8d39<\/strong>\uff1a\u60a8\u65e0\u9700\u652f\u4ed8\u4efb\u4f55\u8d39\u7528\u5373\u53ef\u4f7f\u7528\uff0c\u9002\u5408\u4ece\u4e2a\u4eba\u5230\u5c0f\u578b\u4f01\u4e1a\u7684\u6240\u6709\u7528\u6237\u3002<\/li>\n\n\n\n<li><strong>\u6613\u4e8e\u4f7f\u7528<\/strong>\uff1a\u754c\u9762\u53cb\u597d\uff0c\u65e0\u9700\u9ad8\u6df1\u6280\u672f\u6280\u80fd\uff0c\u9002\u5408\u6240\u6709\u521d\u5b66\u8005\u3002<\/li>\n\n\n\n<li><strong>\u652f\u6301SEO\u4f18\u5316<\/strong>\uff1a\u63d0\u53d6\u7684\u6570\u636e\u5e2e\u52a9\u60a8\u5206\u6790\u6807\u9898\u3001\u6807\u7b7e\u548c\u89c6\u9891\u63cf\u8ff0\uff0c\u4ee5\u63d0\u5347YouTube\u548cGoogle\u4e0a\u7684\u6392\u540d\u3002<\/li>\n<\/ul><h2 class=\"wp-block-heading\">DPS.MEDIA\u5de5\u5177\u4f7f\u7528\u6307\u5357<\/h2><p>\u4f7f\u7528 <strong>YouTube\u64ad\u653e\u5217\u8868\u89c6\u9891\u63d0\u53d6\u5668<\/strong> \u975e\u5e38\u7b80\u5355\uff1a<\/p><ul class=\"wp-block-list\">\n<li>\u8bbf\u95ee\u5de5\u5177\u9875\u9762 <strong><a class=\"wpil_keyword_link\" href=\"https:\/\/dps.media\/zh\/\" title=\"DPS.MEDIA \u80a1\u4efd\u516c\u53f8\" data-wpil-keyword-link=\"linked\" data-wpil-monitor-id=\"31\">DPS.MEDIA<\/a><\/strong>.<\/li>\n\n\n\n<li>\u5c06YouTube\u64ad\u653e\u5217\u8868URL\u7c98\u8d34\u5230\u8f93\u5165\u6846\u4e2d\u3002<\/li>\n\n\n\n<li>Nh\u1ea5n n\u00fat \u201cExtract Videos\u201d \u0111\u1ec3 b\u1eaft \u0111\u1ea7u qu\u00e1 tr\u00ecnh tr\u00edch xu\u1ea5t.<\/li>\n\n\n\n<li>\u67e5\u770b\u5305\u542b\u94fe\u63a5\u548c\u8be6\u7ec6\u4fe1\u606f\u7684\u89c6\u9891\u5217\u8868\u7ed3\u679c\u3002<\/li>\n<\/ul><h2 class=\"wp-block-heading\">\u4e3a\u4ec0\u4e48\u9009\u62e9DPS.MEDIA\uff1f<\/h2><p><strong>DPS.MEDIA<\/strong> \u4e0d\u4ec5\u63d0\u4f9b\u5de5\u5177 <strong>YouTube\u64ad\u653e\u5217\u8868\u89c6\u9891\u63d0\u53d6\u5668<\/strong> \uff0c\u8fd8\u652f\u6301\u591a\u79cd\u6570\u5b57\u8425\u9500\u548c\u4f20\u64ad\u89e3\u51b3\u65b9\u6848\u3002DPS.MEDIA\u627f\u8bfa\u63d0\u4f9b\u514d\u8d39\u4e14\u9ad8\u6548\u7684\u5de5\u5177\uff0c\u6b63\u6210\u4e3a\u8d8a\u5357\u5185\u5bb9\u521b\u4f5c\u8005\u793e\u533a\u7684\u9996\u9009\u3002\u63a2\u7d22\u66f4\u591a\u670d\u52a1\uff0c\u5982\u514d\u8d39\u751f\u6210\u4e8c\u7ef4\u7801\u6216\u591a\u5a92\u4f53\u5185\u5bb9\u7ba1\u7406\uff01<\/p><h2 class=\"wp-block-heading\">\u5229\u7528\u63d0\u53d6\u6570\u636e\u4f18\u5316\u5185\u5bb9<\/h2><p>\u8be5\u5de5\u5177\u7684\u6570\u636e\u4e0d\u4ec5\u5e2e\u52a9\u60a8\u7ba1\u7406\u89c6\u9891\uff0c\u8fd8\u4e3aSEO\u4f18\u5316\u63d0\u4f9b\u5b9d\u8d35\u8d44\u6599\u3002\u60a8\u53ef\u4ee5\uff1a<\/p><ul class=\"wp-block-list\">\n<li>\u5206\u6790\u6807\u9898\u548c\u63cf\u8ff0\u4e2d\u7684\u5173\u952e\u8bcd\u4ee5\u5e94\u7528\u4e8e\u60a8\u7684\u89c6\u9891\u3002<\/li>\n\n\n\n<li>\u521b\u5efa\u5438\u5f15\u4eba\u7684\u64ad\u653e\u5217\u8868\uff0c\u589e\u52a0\u89c2\u770b\u65f6\u957f\u2014\u2014YouTube\u7b97\u6cd5\u7684\u91cd\u8981\u56e0\u7d20\u3002<\/li>\n\n\n\n<li>\u4e0e\u7ade\u4e89\u64ad\u653e\u5217\u8868\u6bd4\u8f83\uff0c\u4f18\u5316\u5185\u5bb9\u7b56\u7565\u3002<\/li>\n<\/ul><h2 class=\"wp-block-heading\">\u603b\u7ed3<\/h2><p><strong>YouTube\u64ad\u653e\u5217\u8868\u89c6\u9891\u63d0\u53d6\u5668<\/strong> \u5728 <strong>DPS.MEDIA<\/strong> \u662f\u4efb\u4f55\u60f3\u6700\u5927\u5316YouTube\u89c6\u9891\u6f5c\u529b\u8005\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177\u3002\u51ed\u501f\u514d\u8d39\u3001\u6613\u7528\u548c\u9ad8\u6548\u7684SEO\u652f\u6301\u529f\u80fd\uff0c\u8fd9\u662f\u63d0\u5347\u60a8\u9891\u9053\u8d28\u91cf\u7684\u5b8c\u7f8e\u8d77\u70b9\u3002\u4eca\u5929\u5c31\u6765DPS.MEDIA\u4f53\u9a8c\u4e0d\u540c\uff01<\/p>","protected":false},"excerpt":{"rendered":"<p>YouTube Playlist Video Extractor Extract Videos \u1ea2nh \u0111\u1ea1i di\u1ec7n Link T\u00ean video async function fetchVideos() { const playlistUrl = document.getElementById(&#8216;playlistUrl&#8217;).value.trim(); const errorDiv = document.getElementById(&#8216;error&#8217;); const tableBody = document.getElementById(&#8216;videoTable&#8217;).getElementsByTagName(&#8216;tbody&#8217;)[0]; tableBody.innerHTML = &#8221;; errorDiv.style.display = &#8216;none&#8217;; if (!playlistUrl) { showError(&#8216;Please enter a YouTube playlist URL.&#8217;); return; } const playlistId = extractPlaylistId(playlistUrl); if (!playlistId) { showError(&#8216;Invalid playlist URL.&#8217;); [&hellip;]<\/p>","protected":false},"author":1,"featured_media":27055,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-27170","page","type-page","status-publish","has-post-thumbnail","hentry"],"acf":[],"rankmath_keywords":{"primary":"","secondary":[""]},"yoast_keywords":{"primary":"","secondary":[]},"yoast_focuskw":"","rankmath_focuskw":"","seo_keywords":{"primary":"","secondary":[""]},"_links":{"self":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/pages\/27170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/comments?post=27170"}],"version-history":[{"count":0,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/pages\/27170\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/media\/27055"}],"wp:attachment":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/media?parent=27170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}