Code Monkey home page Code Monkey logo

godot-youtube-dl's Introduction

An implementation of youtube-dl for the Godot engine that works on Linux, OSX and Windows

Features

  • Automatic youtube-dl and ffmpeg setup.
  • Downloading single videos from YouTube.
  • Converting videos to audio.
  • Downloading playlists of videos from YouTube. (yet to be implemented)
  • Searching YouTube videos. (yet to be implemented)

Installation

  • Clone the repository and place the youtube-dl folder in your project folder.

How to use

Setup:

Create a new YouTube-DL object like this:

var youtube_dl = YouTubeDl.new()

Usually you will want to connect it's signals immediately like this:

youtube_dl.connect("ready", self, "ready_to_dl")
youtube_dl.connect("download_complete", self, "yt_dowload_complete")
  • The ready signal is emitted when the YouTubeDL object has finished the initial setup and is ready to download YouTube videos.
  • The download_complete signal is emitted when the YouTubeDL object has finished downloading a video/audio.

Usage:

To download a YouTube video use the download function:

youtube_dl.download(url, destination_path, filename, convert_to_audio, video_format, audio_format)
  • string url: The YouTube video url
  • string destination_path: The folder where you want the video to be downloaded
  • string filename: Specify the filename without extension, can be leaved blank
  • bool convert_to_audio: If true the video will be converted to the specified audio format
  • int video_format: Used to specify the video format to download, use built-in constants like YouTubeDl.VIDEO_WEBM.
  • int audio_format: Used to specify the audio format for conversion, use built-in constants like YouTubeDl.AUDIO_VORBIS.

Examples:

Downloading a video:

youtube_dl.download("https://youtu.be/ogMNV33AhCY", "/home/noe/downloads/", "videoclip", false, YouTubeDl.VIDEO_WEBM)

Downloading a video as audio:

youtube_dl.download("https://youtu.be/ogMNV33AhCY", "/home/noe/downloads/", "audioclip", true, YouTubeDl.VIDEO_WEBM, YouTubeDl.AUDIO_VORBIS)

Supported formats audio/video formats:

Video:
  • webm - VIDEO_WEBM (only for non 60fps videos)
  • mp4 - VIDEO_MP4
Audio:
  • mp3 - AUDIO_MP3
  • flac - AUDIO_FLAC
  • aac - AUDIO_AAC
  • vorbis (ogg) - AUDIO_VORBIS
  • opus (ogg) - AUDIO_OPUS
  • m4a - AUDIO_M4A
  • wav - AUDIO_WAV

Future:

This project needs improvements and you are more than welcome to contribute to it by submitting Issues and Pull Requets.

godot-youtube-dl's People

Contributors

nolkaloid avatar o0meh0o avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.