Skip to main content
Glama

YouTube Content Management MCP Server

youtube_serach.ipynbβ€’30.8 kB
{ "cells": [ { "cell_type": "markdown", "id": "63d2035a", "metadata": {}, "source": [ "## Configuration" ] }, { "cell_type": "code", "execution_count": 14, "id": "946d88ba", "metadata": {}, "outputs": [], "source": [ "import os\n", "from dotenv import load_dotenv\n", "from googleapiclient.discovery import build\n", "from googleapiclient.errors import HttpError\n", "from mcp.types import TextContent\n", "\n", "load_dotenv()\n", "\n", "class YouTubeAPIError(Exception):\n", " \"\"\"Custom exception for YouTube API errors\"\"\"\n", " pass\n", "\n", "api_key = os.getenv('YOUTUBE_API_KEY')\n", "if not api_key:\n", " raise YouTubeAPIError(\"YouTube API key is not set in environment variables\")\n", "\n", "def get_youtube_client():\n", " \"\"\"Get a singleton YouTube API client instance.\"\"\"\n", " api_key = os.getenv('YOUTUBE_API_KEY')\n", " if not api_key:\n", " raise YouTubeAPIError(\"YouTube API key is not set in environment variables\")\n", " \n", " # Cache the client instance (module-level singleton)\n", " if not hasattr(get_youtube_client, 'client'):\n", " get_youtube_client.client = build('youtube', 'v3', developerKey=api_key)\n", " \n", " return get_youtube_client.client" ] }, { "cell_type": "markdown", "id": "0ea928d4", "metadata": {}, "source": [ "## YouTube Video Search" ] }, { "cell_type": "code", "execution_count": 16, "id": "39633344", "metadata": {}, "outputs": [], "source": [ "arguments = {\n", " \"query\": \"AI\",\n", " \"max_results\": 10,\n", " \"order\": \"viewCount\",\n", " \"published_after\": \"2025-01-01T00:00:00Z\"\n", " }\n", "\n", "youtube = get_youtube_client()\n", "\n", "try:\n", " query = arguments.get(\"query\", \"\")\n", " max_results = min(arguments.get(\"max_results\", 25), 50) # API limit\n", " order = arguments.get(\"order\", \"relevance\")\n", " duration = arguments.get(\"duration\", \"medium\")\n", " upload_date = arguments.get(\"published_after\", None)\n", " \n", " search_params = {\n", " 'part': 'snippet',\n", " 'q': query,\n", " 'type': 'video',\n", " 'maxResults': max_results,\n", " 'order': order\n", " }\n", " \n", " if duration != \"any\":\n", " search_params['videoDuration'] = duration\n", " if upload_date:\n", " search_params['publishedAfter'] = upload_date\n", " \n", " response = youtube.search().list(**search_params).execute()\n", " \n", " results = []\n", " for item in response.get('items', []):\n", " description = item['snippet']['description']\n", " truncated_desc = description[:200] + ('...' if description else '')\n", " video_info = {\n", " 'video_id': item['id']['videoId'],\n", " 'title': item['snippet']['title'],\n", " 'description': truncated_desc,\n", " 'channel_title': item['snippet']['channelTitle'],\n", " 'published_at': item['snippet']['publishedAt'],\n", " 'thumbnail_url': item['snippet']['thumbnails'].get('default', {}).get('url', '')\n", " }\n", " # Create one TextContent per video\n", " results.append(TextContent(\n", " type=\"text\",\n", " text=(f\"**{video_info['title']}**\\n\"\n", " f\"Channel: {video_info['channel_title']}\\n\"\n", " f\"Video ID: {video_info['video_id']}\\n\"\n", " f\"Published: {video_info['published_at']}\\n\"\n", " f\"Description: {video_info['description']}\")\n", " ))\n", " \n", "except HttpError as e:\n", " raise YouTubeAPIError(f\"YouTube API error for query '{query}': {e}\")\n", "except Exception as e:\n", " raise YouTubeAPIError(f\"Unexpected error for query '{query}': {e}\")" ] }, { "cell_type": "code", "execution_count": 22, "id": "14de3473", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[TextContent(type='text', text='**Guess The ITALIAN BRAINROT AI Animals Memes Part 1 | Bombardiro Crocodilo, Tralalero Tralala**\\nChannel: Quiz Mirage\\nVideo ID: DYYDxLIUASE\\nPublished: 2025-04-03T16:26:53Z\\nDescription: Guess The ITALIAN BRAINROT AI Animals Memes Part 1 | Bombardiro Crocodilo, Tralalero Tralala, Brr Brr Patapim Did you ......', annotations=None, meta=None),\n", " TextContent(type='text', text='**Grok AI is Exposing Everyone! | Is it Biased? | Elon Musk | Dhruv Rathee**\\nChannel: Dhruv Rathee\\nVideo ID: 3cZNbwTXixU\\nPublished: 2025-03-20T14:46:02Z\\nDescription: Learn 20+ AI Tools and supercharge your productivity. Join my AI Masterclass here: ......', annotations=None, meta=None),\n", " TextContent(type='text', text='**Drive Thru A.I. Robot Prank**\\nChannel: Airrack\\nVideo ID: t-oLGxzHyWQ\\nPublished: 2025-06-30T17:14:17Z\\nDescription: Get an exclusive 15% discount on Saily data plans! Use code AIRRACK at checkout. Download Saily app or go to ......', annotations=None, meta=None),\n", " TextContent(type='text', text='**AI Learns to Play Soccer (and breaks physics)**\\nChannel: AI Warehouse\\nVideo ID: ta99S6Fh53c\\nPublished: 2025-05-31T23:14:58Z\\nDescription: AI vs AI Playing Soccer! https://brilliant.org/AIWarehouse/ If you want to learn more about AI and deep reinforcement learning (how ......', annotations=None, meta=None),\n", " TextContent(type='text', text='**AI Decides on Absurd Trolley Problems**\\nChannel: Clarified Mind\\nVideo ID: 1boxiCcpZ-w\\nPublished: 2025-05-19T17:14:05Z\\nDescription: I let 5 AI models decide on absurd trolley problems. ChatGPT, Claude, DeepSeek, Grok and Gemini share their opinions on what ......', annotations=None, meta=None),\n", " TextContent(type='text', text='**AI Agents, Clearly Explained**\\nChannel: Jeff Su\\nVideo ID: FwOTs4UxQS4\\nPublished: 2025-04-08T13:00:28Z\\nDescription: My AI Toolkit: https://academy.jeffsu.org/ai-toolkit?utm_source=youtube&utm_medium=video&utm_campaign=177 Understanding ......', annotations=None, meta=None),\n", " TextContent(type='text', text='**Kinaaaliwang lolo't lola, 'di mga tao kundi AI o Artificial Intelligence?! | Kapuso Mo, Jessica Soho**\\nChannel: GMA Public Affairs\\nVideo ID: l34hAuvJkYk\\nPublished: 2025-06-23T12:00:06Z\\nDescription: Aired (June 22, 2025): KINAAALIWANG LOLO AT LOLA ONLINE, HINDI PALA MGA TOTOONG TAO KUNDI…AI O ARTIFICIAL ......', annotations=None, meta=None),\n", " TextContent(type='text', text='**πŸ”΄ Ai video kaise banaye | Text to video ai free | Ai se video kaise banaye | Ai courses for beginner**\\nChannel: Digital Raj\\nVideo ID: xJhbirj2tnw\\nPublished: 2025-06-01T06:00:50Z\\nDescription: Best AI Video Maker to Create Cartoon Video: https://bit.ly/44qecZv ......', annotations=None, meta=None),\n", " TextContent(type='text', text=\"**What's next for AI at DeepMind, Google's artificial intelligence lab | 60 Minutes**\\nChannel: 60 Minutes\\nVideo ID: 1XF-NG_35NE\\nPublished: 2025-04-21T03:00:03Z\\nDescription: At Google DeepMind, researchers are chasing what's called artificial general intelligence: a silicon intellect as versatile as a ......\", annotations=None, meta=None),\n", " TextContent(type='text', text=\"**We used AI GLASSES to cheat against GothamChess**\\nChannel: BotezLive\\nVideo ID: DzSNskpoqIk\\nPublished: 2025-03-20T17:45:05Z\\nDescription: Listen to 'The Unusual Suspects' with Kenya Barris and Malcolm Gladwell on Audible now: https://audible.com/unusualsuspects ......\", annotations=None, meta=None)]" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results" ] }, { "cell_type": "code", "execution_count": 13, "id": "b115a8f6", "metadata": {}, "outputs": [], "source": [ "youtube = get_youtube_client()\n", "\n", "arguments = {\n", " \"query\": \"python tutorial\",\n", " \"max_results\": 10,\n", " \"duration\": \"short\",\n", " \"published_after\": \"2025-01-01T00:00:00Z\"\n", " }\n", "\n", "query = arguments.get(\"query\", \"\")\n", "max_results = min(arguments.get(\"max_results\", 25), 50)\n", "\n", "response = youtube.search().list(\n", " part='snippet',\n", " q=query,\n", " type='video',\n", " maxResults=max_results\n", ").execute()" ] }, { "cell_type": "code", "execution_count": 10, "id": "58b5eaf6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'kind': 'youtube#searchListResponse',\n", " 'etag': '9pJ3jeQidI54dSKO20Kxp0Irjqo',\n", " 'nextPageToken': 'CAoQAA',\n", " 'regionCode': 'IN',\n", " 'pageInfo': {'totalResults': 1000000, 'resultsPerPage': 10},\n", " 'items': [{'kind': 'youtube#searchResult',\n", " 'etag': 'cktaRZ4BcxaKMuI25UaJfU_p9e0',\n", " 'id': {'kind': 'youtube#video', 'videoId': '_uQrJ0TkZlc'},\n", " 'snippet': {'publishedAt': '2019-02-18T15:00:08Z',\n", " 'channelId': 'UCWv7vMbMWH4-V0ZXdmDpPBA',\n", " 'title': 'Python Full Course for Beginners',\n", " 'description': 'Learn Python for AI, machine learning, and web development with this beginner-friendly course! Get 6 months of PyCharm ...',\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/_uQrJ0TkZlc/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/_uQrJ0TkZlc/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/_uQrJ0TkZlc/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360}},\n", " 'channelTitle': 'Programming with Mosh',\n", " 'liveBroadcastContent': 'none',\n", " 'publishTime': '2019-02-18T15:00:08Z'}},\n", " {'kind': 'youtube#searchResult',\n", " 'etag': '_60hcA4HpX24O_XHkHRpPcZCbQs',\n", " 'id': {'kind': 'youtube#video', 'videoId': 'UrsmFxEIp5k'},\n", " 'snippet': {'publishedAt': '2024-06-16T05:36:24Z',\n", " 'channelId': 'UCeVMnSShP_Iviwkknt83cww',\n", " 'title': 'Python Tutorial For Beginners in Hindi | Complete Python Course πŸ”₯',\n", " 'description': \"Exciting News! I've just launched my Data Science Course – and it's now in Early Bird Access! If you loved this Python course, ...\",\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/UrsmFxEIp5k/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/UrsmFxEIp5k/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/UrsmFxEIp5k/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360}},\n", " 'channelTitle': 'CodeWithHarry',\n", " 'liveBroadcastContent': 'none',\n", " 'publishTime': '2024-06-16T05:36:24Z'}},\n", " {'kind': 'youtube#searchResult',\n", " 'etag': 'PUL10z9cEAmJEX3A7BJbZwPzdko',\n", " 'id': {'kind': 'youtube#video', 'videoId': 'nluUYtejoIE'},\n", " 'snippet': {'publishedAt': '2024-06-21T07:55:33Z',\n", " 'channelId': 'UCAy1PN6jrZXrGFg79WP_91A',\n", " 'title': 'Python Basics: Your FIRST Program in Under a Minute! πŸš€',\n", " 'description': 'In this quick tutorial, I\\'ll show you how to write your very first line of Python code: the classic \"Hello, World!\" ✨ Whether you\\'re a ...',\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/nluUYtejoIE/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/nluUYtejoIE/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/nluUYtejoIE/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360}},\n", " 'channelTitle': 'The Programmers Realm',\n", " 'liveBroadcastContent': 'none',\n", " 'publishTime': '2024-06-21T07:55:33Z'}},\n", " {'kind': 'youtube#searchResult',\n", " 'etag': 'ZNjEOiNqrXo3Zpb0XRsoVze-f8k',\n", " 'id': {'kind': 'youtube#video', 'videoId': 'q2-pnQffZik'},\n", " 'snippet': {'publishedAt': '2024-12-31T02:30:33Z',\n", " 'channelId': 'UC7zZ2-Q_oxbUaoMVL0z51wg',\n", " 'title': 'Learn Python for FREE in 2025',\n", " 'description': 'Learn Python for FREE in 2025 #coding #compsci #python #fyp Source: TikTok (individualkex)',\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/q2-pnQffZik/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/q2-pnQffZik/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/q2-pnQffZik/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360}},\n", " 'channelTitle': 'Sajjaad Khader',\n", " 'liveBroadcastContent': 'none',\n", " 'publishTime': '2024-12-31T02:30:33Z'}},\n", " {'kind': 'youtube#searchResult',\n", " 'etag': 'YdZRy1PG3-MG9SKTEmabvxT0QA4',\n", " 'id': {'kind': 'youtube#video', 'videoId': 'Sl4zqWLC9Xw'},\n", " 'snippet': {'publishedAt': '2023-08-30T13:00:21Z',\n", " 'channelId': 'UCkcqmxjMXaBb0kDWqqSEU1g',\n", " 'title': 'Fastest way to learn Python #coding #python #programming',\n", " 'description': 'Fastest way to learn Python . ❣️ Save for later and subscribe for more! . For more content like this: ...',\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/Sl4zqWLC9Xw/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/Sl4zqWLC9Xw/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/Sl4zqWLC9Xw/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360}},\n", " 'channelTitle': 'Sahil & Sarra',\n", " 'liveBroadcastContent': 'none',\n", " 'publishTime': '2023-08-30T13:00:21Z'}},\n", " {'kind': 'youtube#searchResult',\n", " 'etag': 'bQ4LkjMi1zeTpuv84nZGiDtKPCI',\n", " 'id': {'kind': 'youtube#video', 'videoId': 'dZ8VrmzYL2A'},\n", " 'snippet': {'publishedAt': '2023-07-13T10:43:16Z',\n", " 'channelId': 'UC-oMMgCI8QXoQGcuU0ItEZQ',\n", " 'title': 'Pygame - Display Image in Pygame python || Pygame python tutorial #python #pygame',\n", " 'description': 'Pygame - Display image pygame in python || How to make game using python #shorts #trending #tutorials #python ...',\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/dZ8VrmzYL2A/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/dZ8VrmzYL2A/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/dZ8VrmzYL2A/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360}},\n", " 'channelTitle': 'Creativewiz',\n", " 'liveBroadcastContent': 'none',\n", " 'publishTime': '2023-07-13T10:43:16Z'}},\n", " {'kind': 'youtube#searchResult',\n", " 'etag': 'BqNERjeCo98XevCcgPWLTbKtPf8',\n", " 'id': {'kind': 'youtube#video', 'videoId': 'eaMDDseIL7E'},\n", " 'snippet': {'publishedAt': '2022-08-24T16:52:44Z',\n", " 'channelId': 'UCqz1Z9I6GY0q0xvUnLqGHOg',\n", " 'title': 'How to create graphics using Python turtle 🐍🐒 #coding',\n", " 'description': \"This tutorial will create colorful graphics using the python turtle library. Let's have some fun by making some excellent graphics in ...\",\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/eaMDDseIL7E/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/eaMDDseIL7E/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/eaMDDseIL7E/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360}},\n", " 'channelTitle': 'Fun with Python',\n", " 'liveBroadcastContent': 'none',\n", " 'publishTime': '2022-08-24T16:52:44Z'}},\n", " {'kind': 'youtube#searchResult',\n", " 'etag': 'By0wti670DuTZVMK-3fd_SXPYuk',\n", " 'id': {'kind': 'youtube#video', 'videoId': 'Zsa26236rio'},\n", " 'snippet': {'publishedAt': '2024-12-09T12:09:23Z',\n", " 'channelId': 'UC4JX40jDee_tINbkjycV4Sg',\n", " 'title': 'Stop learning PythonπŸ‘€',\n", " 'description': '',\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/Zsa26236rio/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/Zsa26236rio/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/Zsa26236rio/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360}},\n", " 'channelTitle': 'Tech With Tim',\n", " 'liveBroadcastContent': 'none',\n", " 'publishTime': '2024-12-09T12:09:23Z'}},\n", " {'kind': 'youtube#searchResult',\n", " 'etag': '3nBPacW0sIROtmpE_kDLA1bqQAI',\n", " 'id': {'kind': 'youtube#video', 'videoId': 'PocK7wEuBuA'},\n", " 'snippet': {'publishedAt': '2025-07-20T12:35:44Z',\n", " 'channelId': 'UCx9hFCXI8l3X9Ac1feZq9KA',\n", " 'title': 'From Turtle to Matplotlib: The Ultimate Coding Adventure!πŸ”₯ | Python tutorial for beginners|',\n", " 'description': \"Still using Python Turtle? It's fun for beginners, but if you're ready to level up your visuals and stop dealing with weird bugs (like ...\",\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/PocK7wEuBuA/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/PocK7wEuBuA/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/PocK7wEuBuA/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360}},\n", " 'channelTitle': 'Python coding with me',\n", " 'liveBroadcastContent': 'none',\n", " 'publishTime': '2025-07-20T12:35:44Z'}},\n", " {'kind': 'youtube#searchResult',\n", " 'etag': 'fPAQIil2PeSf0P7K6E0PPHHRVq4',\n", " 'id': {'kind': 'youtube#video', 'videoId': 'eWRfhZUzrAc'},\n", " 'snippet': {'publishedAt': '2022-08-09T12:54:23Z',\n", " 'channelId': 'UC8butISFwT-Wl7EV0hUK0BQ',\n", " 'title': 'Python for Beginners – Full Course [Programming Tutorial]',\n", " 'description': 'Learn the Python programming language in this full course for beginners! You will learn the fundamentals of Python and code two ...',\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/eWRfhZUzrAc/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/eWRfhZUzrAc/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/eWRfhZUzrAc/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360}},\n", " 'channelTitle': 'freeCodeCamp.org',\n", " 'liveBroadcastContent': 'none',\n", " 'publishTime': '2022-08-09T12:54:23Z'}}]}" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "response" ] }, { "cell_type": "markdown", "id": "1c9f030f", "metadata": {}, "source": [ "## Get Video Metrics" ] }, { "cell_type": "code", "execution_count": 19, "id": "bc5a4e96", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'kind': 'youtube#video',\n", " 'etag': 'mizc1jubY7k0_joo9Tr3rXEbQYs',\n", " 'id': '_uQrJ0TkZlc',\n", " 'snippet': {'publishedAt': '2019-02-18T15:00:08Z',\n", " 'channelId': 'UCWv7vMbMWH4-V0ZXdmDpPBA',\n", " 'title': 'Python Full Course for Beginners',\n", " 'description': 'Learn Python for AI, machine learning, and web development with this beginner-friendly course! πŸš€ Get 6 months of PyCharm FREE with the coupon in the description!\\n\\n❀️ Join this channel to get access to perks:\\nhttps://www.youtube.com/channel/UCWv7vMbMWH4-V0ZXdmDpPBA/join\\n\\nπŸš€ Want to dive deeper?\\n- Check out my Python mastery course: https://mosh.link/python-course\\n- Subscribe for more awesome Python content: https://goo.gl/6PYaGF\\n\\nπŸ”— Related videos \\nhttps://youtu.be/yVl_G-F7m8c?si=aoIiT6CyaRRfBsRM\\n\\nπŸ‘‰ New version available Watch here: https://youtu.be/kqtD5dpn9C8\\n\\nπŸ“• Get the FREE goodies:\\n- Python cheat sheet: https://mosh.link/python-cheatsheet\\n- Supplementary materials (spreadsheet): https://github.com/mosh-hamedani/python-supplementary-materials\\n- Get 6 months of PyCharm for free with this coupon code: MOSH_YOUTUBE - Redeem it at: https://jb.gg/redeem\\n\\nβœ‹ Stay connected:\\n- Twitter: https://twitter.com/moshhamedani\\n- Facebook: https://www.facebook.com/programmingwithmosh/\\n- Instagram: https://www.instagram.com/codewithmosh.official/\\n- LinkedIn: https://www.linkedin.com/school/codewithmosh/\\n\\n⭐ My favorite Python books\\n- Python Crash Course: https://amzn.to/2GqMdjG\\n- Automate the Boring Stuff with Python: https://amzn.to/2N71d6S\\n- A Smarter Way to Learn Python: https://amzn.to/2UZa6lE\\n- Machine Learning for Absolute Beginners: https://amzn.to/2Gs0koL\\n- Hands-on Machine Learning with scikit-learn and TensorFlow: https://amzn.to/2IdUuJy\\n\\nπŸ“– TABLE OF CONTENT\\n00:00:00 Introduction\\n00:01:49 Installing Python 3\\n00:06:10 Your First Python Program\\n00:08:11 How Python Code Gets Executed \\n00:11:24 How Long It Takes To Learn Python \\n00:13:03 Variables\\n00:18:21 Receiving Input\\n00:22:16 Python Cheat Sheet\\n00:22:46 Type Conversion\\n00:29:31 Strings\\n00:37:36 Formatted Strings\\n00:40:50 String Methods\\n00:48:33 Arithmetic Operations\\n00:51:33 Operator Precedence\\n00:55:04 Math Functions\\n00:58:17 If Statements\\n01:06:32 Logical Operators\\n01:11:25 Comparison Operators\\n01:16:17 Weight Converter Program \\n01:20:43 While Loops\\n01:24:07 Building a Guessing Game\\n01:30:51 Building the Car Game\\n01:41:48 For Loops\\n01:47:46 Nested Loops\\n01:55:50 Lists\\n02:01:45 2D Lists\\n02:05:11 My Complete Python Course \\n02:06:00 List Methods\\n02:13:25 Tuples\\n02:15:34 Unpacking\\n02:18:21 Dictionaries\\n02:26:21 Emoji Converter\\n02:30:31 Functions\\n02:35:21 Parameters\\n02:39:24 Keyword Arguments \\n02:44:45 Return Statement\\n02:48:55 Creating a Reusable Function \\n02:53:42 Exceptions\\n02:59:14 Comments\\n03:01:46 Classes\\n03:07:46 Constructors\\n03:14:41 Inheritance\\n03:19:33 Modules\\n03:30:12 Packages\\n03:36:22 Generating Random Values\\n03:44:37 Working with Directories \\n03:50:47 Pypi and Pip\\n03:55:34 Project 1: Automation with Python\\n04:10:22 Project 2: Machine Learning with Python \\n04:58:37 Project 3: Building a Website with Django\\n\\n#Python #AI #MachineLearning #WebDevelopment',\n", " 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/_uQrJ0TkZlc/default.jpg',\n", " 'width': 120,\n", " 'height': 90},\n", " 'medium': {'url': 'https://i.ytimg.com/vi/_uQrJ0TkZlc/mqdefault.jpg',\n", " 'width': 320,\n", " 'height': 180},\n", " 'high': {'url': 'https://i.ytimg.com/vi/_uQrJ0TkZlc/hqdefault.jpg',\n", " 'width': 480,\n", " 'height': 360},\n", " 'standard': {'url': 'https://i.ytimg.com/vi/_uQrJ0TkZlc/sddefault.jpg',\n", " 'width': 640,\n", " 'height': 480},\n", " 'maxres': {'url': 'https://i.ytimg.com/vi/_uQrJ0TkZlc/maxresdefault.jpg',\n", " 'width': 1280,\n", " 'height': 720}},\n", " 'channelTitle': 'Programming with Mosh',\n", " 'tags': ['python tutorial',\n", " 'python',\n", " 'python for beginners',\n", " 'python tutorial for beginners',\n", " 'learn python',\n", " 'python crash course',\n", " 'python 2019',\n", " 'python tutorial for beginners full',\n", " 'python (programming language)',\n", " 'python basics',\n", " 'python course',\n", " 'python from scratch',\n", " 'python full course',\n", " 'python language',\n", " 'python programming',\n", " 'python programming language',\n", " 'python programming tutorial',\n", " 'getting started with python',\n", " 'learn python programming',\n", " 'web development',\n", " 'mosh hamedani',\n", " 'machine learning',\n", " 'python 2020'],\n", " 'categoryId': '27',\n", " 'liveBroadcastContent': 'none',\n", " 'defaultLanguage': 'en',\n", " 'localized': {'title': 'Python Full Course for Beginners',\n", " 'description': 'Learn Python for AI, machine learning, and web development with this beginner-friendly course! πŸš€ Get 6 months of PyCharm FREE with the coupon in the description!\\n\\n❀️ Join this channel to get access to perks:\\nhttps://www.youtube.com/channel/UCWv7vMbMWH4-V0ZXdmDpPBA/join\\n\\nπŸš€ Want to dive deeper?\\n- Check out my Python mastery course: https://mosh.link/python-course\\n- Subscribe for more awesome Python content: https://goo.gl/6PYaGF\\n\\nπŸ”— Related videos \\nhttps://youtu.be/yVl_G-F7m8c?si=aoIiT6CyaRRfBsRM\\n\\nπŸ‘‰ New version available Watch here: https://youtu.be/kqtD5dpn9C8\\n\\nπŸ“• Get the FREE goodies:\\n- Python cheat sheet: https://mosh.link/python-cheatsheet\\n- Supplementary materials (spreadsheet): https://github.com/mosh-hamedani/python-supplementary-materials\\n- Get 6 months of PyCharm for free with this coupon code: MOSH_YOUTUBE - Redeem it at: https://jb.gg/redeem\\n\\nβœ‹ Stay connected:\\n- Twitter: https://twitter.com/moshhamedani\\n- Facebook: https://www.facebook.com/programmingwithmosh/\\n- Instagram: https://www.instagram.com/codewithmosh.official/\\n- LinkedIn: https://www.linkedin.com/school/codewithmosh/\\n\\n⭐ My favorite Python books\\n- Python Crash Course: https://amzn.to/2GqMdjG\\n- Automate the Boring Stuff with Python: https://amzn.to/2N71d6S\\n- A Smarter Way to Learn Python: https://amzn.to/2UZa6lE\\n- Machine Learning for Absolute Beginners: https://amzn.to/2Gs0koL\\n- Hands-on Machine Learning with scikit-learn and TensorFlow: https://amzn.to/2IdUuJy\\n\\nπŸ“– TABLE OF CONTENT\\n00:00:00 Introduction\\n00:01:49 Installing Python 3\\n00:06:10 Your First Python Program\\n00:08:11 How Python Code Gets Executed \\n00:11:24 How Long It Takes To Learn Python \\n00:13:03 Variables\\n00:18:21 Receiving Input\\n00:22:16 Python Cheat Sheet\\n00:22:46 Type Conversion\\n00:29:31 Strings\\n00:37:36 Formatted Strings\\n00:40:50 String Methods\\n00:48:33 Arithmetic Operations\\n00:51:33 Operator Precedence\\n00:55:04 Math Functions\\n00:58:17 If Statements\\n01:06:32 Logical Operators\\n01:11:25 Comparison Operators\\n01:16:17 Weight Converter Program \\n01:20:43 While Loops\\n01:24:07 Building a Guessing Game\\n01:30:51 Building the Car Game\\n01:41:48 For Loops\\n01:47:46 Nested Loops\\n01:55:50 Lists\\n02:01:45 2D Lists\\n02:05:11 My Complete Python Course \\n02:06:00 List Methods\\n02:13:25 Tuples\\n02:15:34 Unpacking\\n02:18:21 Dictionaries\\n02:26:21 Emoji Converter\\n02:30:31 Functions\\n02:35:21 Parameters\\n02:39:24 Keyword Arguments \\n02:44:45 Return Statement\\n02:48:55 Creating a Reusable Function \\n02:53:42 Exceptions\\n02:59:14 Comments\\n03:01:46 Classes\\n03:07:46 Constructors\\n03:14:41 Inheritance\\n03:19:33 Modules\\n03:30:12 Packages\\n03:36:22 Generating Random Values\\n03:44:37 Working with Directories \\n03:50:47 Pypi and Pip\\n03:55:34 Project 1: Automation with Python\\n04:10:22 Project 2: Machine Learning with Python \\n04:58:37 Project 3: Building a Website with Django\\n\\n#Python #AI #MachineLearning #WebDevelopment'},\n", " 'defaultAudioLanguage': 'en'},\n", " 'statistics': {'viewCount': '45136613',\n", " 'likeCount': '1203279',\n", " 'favoriteCount': '0',\n", " 'commentCount': '60472'}}" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "response = youtube.videos().list(\n", " part='snippet,statistics',\n", " id=\"_uQrJ0TkZlc\"\n", " ).execute()\n", "\n", "items = response.get('items', [])\n", "item = items[0]\n", "item" ] }, { "cell_type": "code", "execution_count": null, "id": "87cf4882", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.3" } }, "nbformat": 4, "nbformat_minor": 5 }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NastyRunner13/youtube-content-management-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server