nolkaloid / godot-yt-dlp Goto Github PK
View Code? Open in Web Editor NEWAn implementation of yt-dlp for Godot 4.x
License: MIT License
An implementation of yt-dlp for Godot 4.x
License: MIT License
I'm using Godot Engine v3.2.stable.official and it get's stuck on Requesting. . .
I have already set the certificates option. In the error debugger I get this error 3 times: ~_Thread: Reference to a Thread object was lost while the thread is still running...
Project Music Theory.zip
There is an exception being thrown when attempting to access the OS name:
ie
yt_dlp_sources[OS.get_name()]
This can return macOS which doesnt exist on the yt_dlp_sources
I ended up resolving this by adding macOS to the sources:
const yt_dlp_sources: Dictionary = {
"Linux": "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp",
"Windows": "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe",
"OSX": "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos",
"macOS": "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos",
}
You can see in this debug output that mp3 is being supplied but it's saving as webm.
This issue does not exist on Windows.
options_and_arguments:
["-x", "--audio-format", "mp3", "--no-continue", "-o", "/Users/michaelfarrell/Documents/Code/transcription/audio/Ginza Samba.%(ext)s", "https://www.youtube.com/watch?v=TuVkSWhx28Y"]
OUTPUT:
["[youtube] Extracting URL: https://www.youtube.com/watch?v=TuVkSWhx28Y\n[youtube] TuVkSWhx28Y: Downloading webpage\n[youtube] TuVkSWhx28Y: Downloading android player API JSON\n[info] TuVkSWhx28Y: Downloading 1 format(s): 251\n[dashsegments] Total fragments: 2\n[download] Destination: /Users/michaelfarrell/Documents/Code/transcription/audio/Ginza Samba.webm\n\r[download] 0.0% of ~ 20.00MiB at 2.64KiB/s ETA 02:09:15 (frag 0/2)\r[download] 0.0% of ~ 20.00MiB at 7.89KiB/s ETA 43:16 (frag 0/2) \r[download] 0.0% of ~ 20.00MiB at 18.28KiB/s ETA 18:39 (frag 0/2)\r[download] 0.1% of ~ 20.00MiB at 38.88KiB/s ETA 08:46 (frag 0/2)\r[download] 0.2% of ~ 20.00MiB at 78.12KiB/s ETA 04:21 (frag 0/2)\r[download] 0.3% of ~ 20.00MiB at 152.70KiB/s ETA 02:13 (frag 0/2)\r[download] 0.6% of ~ 20.00MiB at 294.26KiB/s ETA 01:09 (frag 0/2)\r[download] 1.2% of ~ 20.00MiB at 562.96KiB/s ETA 00:35 (frag 0/2)\r[download] 2.5% of ~ 20.00MiB at 1.04MiB/s ETA 00:18 (frag 0/2)\r[download] 5.0% of ~ 20.00MiB at 2.00MiB/s ETA 00:09 (frag 0/2)\r[download] 10.0% of ~ 20.00MiB at 3.74MiB/s ETA 00:04 (frag 0/2)\r[download] 20.0% of ~ 20.00MiB at 6.94MiB/s ETA 00:02 (frag 0/2)\r[download] 40.0% of ~ 20.00MiB at 11.09MiB/s ETA 00:01 (frag 0/2)\r[download] 50.0% of ~ 20.00MiB at 13.30MiB/s ETA 00:00 (frag 0/2)\r[download] 50.0% of ~ 20.00MiB at 13.23MiB/s ETA 00:00 (frag 1/2)\r[download] 93.8% of ~ 10.66MiB at 7.61KiB/s ETA 00:00 (frag 1/2)\r[download] 93.9% of ~ 10.66MiB at 22.62KiB/s ETA 00:00 (frag 1/2)\r[download] 93.9% of ~ 10.66MiB at 52.16KiB/s ETA 00:00 (frag 1/2)\r[download] 94.0% of ~ 10.66MiB at 109.79KiB/s ETA 00:00 (frag 1/2)\r[download] 94.1% of ~ 10.66MiB at 210.03KiB/s ETA 00:00 (frag 1/2)\r[download] 94.4% of ~ 10.66MiB at 392.12KiB/s ETA 00:00 (frag 1/2)\r[download] 95.0% of ~ 10.66MiB at 723.23KiB/s ETA 00:00 (frag 1/2)\r[download] 96.2% of ~ 10.66MiB at 1.26MiB/s ETA 00:00 (frag 1/2)\r[download] 98.5% of ~ 10.66MiB at 2.22MiB/s ETA 00:00 (frag 1/2)\r[download] 100.0% of ~ 10.66MiB at 2.87MiB/s ETA 00:00 (frag 1/2)\r[download] 100.0% of ~ 10.66MiB at 2.82MiB/s ETA 00:00 (frag 2/2)\r[download] 100% of 10.66MiB in 00:00:00 at 10.72MiB/s \n"]
Here is the modified code that I added for debugging:
options_and_arguments.append_array(["--no-continue", "-o", file_path, _url])
print('options_and_arguments: ', options_and_arguments)
var output: Array = []
OS.execute(executable, PackedStringArray(options_and_arguments), output)
print('OUTPUT: ', output)
my script
`
extends Node3D
func _ready():
if not YtDlp.is_setup():
YtDlp.setup()
await YtDlp.setup_completed
var download := YtDlp.download("https://youtube.com/watch?v=dQw4w9WgXcQ")
.set_destination("user://audio/")
.set_file_name("ok_computer")
.convert_to_audio(YtDlp.Audio.MP3)
.start()
await download.download_completed
var stream = AudioStreamMP3.new()
var audio_file = FileAccess.open("user://audio/ok_computer.mp3", FileAccess.READ)
stream.data = audio_file.get_buffer(audio_file.get_length())
audio_file.close()
$AudioStreamPlayer.stream = stream
$AudioStreamPlayer.play()
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.