File size: 3,019 Bytes
ea71ddf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": [],
      "authorship_tag": "ABX9TyN+xevYdvEEVskrZElzE6/6"
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# RVC Playground\n",
        "\n",
        "\n",
        "Simply click `Runtime` in the top navigation bar and `Run all`. Wait for the output of the final cell to show the public gradio url and click on it.\n",
        "\n",
        "\n",
        "## credits :\n",
        "\n",
        "- [Rejekts](https://github.com/RejektsAI/EasyTools) : Original creator\n",
        "\n",
        "- [ Blane187](https://github.com/Blane187): create this colab notebook"
      ],
      "metadata": {
        "id": "j_bf0AWbbwlA"
      }
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "id": "cNC0NDQyXIc9"
      },
      "outputs": [],
      "source": [
        "#@title install\n",
        "\n",
        "!git clone https://huggingface.co/spaces/Rejekts/RVC_PlayGround RVC\n",
        "!cd RVC && pip install -r requirements.txt --quiet\n",
        "!pip install yt_dlp ffmpeg --quiet"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "\n",
        "\n",
        "#@title download youtube acapella\n",
        "%cd /content/RVC\n",
        "url= \"https://youtu.be/F_BDaMGiNQw?si=XEjG4Zq6f8Ta4cU9\" #@param {type:\"string\"}\n",
        "\n",
        "AUDIO_NAME= \"cry_baby\" #@param {type:\"string\"}\n",
        "\n",
        "import yt_dlp\n",
        "import ffmpeg\n",
        "import sys\n",
        "\n",
        "\n",
        "ydl_opts = {\n",
        "    'format': 'bestaudio/best',\n",
        " #    'outtmpl': 'output.%(ext)s',\n",
        "    'postprocessors': [{\n",
        "        'key': 'FFmpegExtractAudio',\n",
        "        'preferredcodec': 'wav',\n",
        "    }],\n",
        "    \"outtmpl\": f'audios/{AUDIO_NAME}',  # this is where you can edit how you'd like the filenames to be formatted\n",
        "}\n",
        "def download_from_url(url):\n",
        "    ydl.download([url])\n",
        "    # stream = ffmpeg.input('output.m4a')\n",
        "    # stream = ffmpeg.output(stream, 'output.wav')\n",
        "\n",
        "\n",
        "with yt_dlp.YoutubeDL(ydl_opts) as ydl:\n",
        "\n",
        "      download_from_url(url)"
      ],
      "metadata": {
        "cellView": "form",
        "id": "uGig8kXxaA6c"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "\n",
        "\n",
        "#@title run webui\n",
        "\n",
        "\n",
        "!python app.py"
      ],
      "metadata": {
        "cellView": "form",
        "id": "nBbnIzygXeJE"
      },
      "execution_count": null,
      "outputs": []
    }
  ]
}