Created
April 21, 2025 03:28
-
-
Save Fatih120/9979a7d8b7dd249dbeea5d591d93ba18 to your computer and use it in GitHub Desktop.
yt-dlp colab because f*#@ google and their Sign in to confirm you’re not a bot bullshit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "nbformat": 4, | |
| "nbformat_minor": 0, | |
| "metadata": { | |
| "colab": { | |
| "provenance": [] | |
| }, | |
| "kernelspec": { | |
| "name": "python3", | |
| "display_name": "Python 3" | |
| } | |
| }, | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "metadata": { | |
| "id": "_0SXspzOm7kD" | |
| }, | |
| "source": [ | |
| "!pip install --upgrade yt-dlp\n", | |
| "!apt -y install ffmpeg lame" | |
| ], | |
| "execution_count": null, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "metadata": { | |
| "id": "W7bW6g_AwxfX" | |
| }, | |
| "source": [ | |
| "# Change this to the youtube urls you want\n", | |
| "yt_urls = ['https://www.youtube.com/watch?v=C21hiBa5CQs']\n", | |
| "\n", | |
| "output_folder = '/content/tmp/'\n", | |
| "\n", | |
| "import os\n", | |
| "def my_mkdirs(folder):\n", | |
| " if os.path.exists(folder)==False:\n", | |
| " os.makedirs(folder)\n", | |
| "my_mkdirs('/content/tmp/')" | |
| ], | |
| "execution_count": null, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "metadata": { | |
| "id": "S2a09176Ni1w" | |
| }, | |
| "source": [ | |
| "# download youtube videos\n", | |
| "for ind,url in enumerate(yt_urls):\n", | |
| " !yt-dlp $url -f 'bestaudio+bestvideo'" | |
| ], | |
| "execution_count": null, | |
| "outputs": [] | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment