Download file from google drive

Godot Version

4.2.1

Question

I tried to download a file from Google Drive, the problem is if I paste my link to the browser it works but I don’t know why inside Godot is not working
URL is valid and u can tested
Code:

extends Node2D

var url = "https://drive.google.com/uc?export=download&id=16oF7J-vGCGYTY6qIkyir4pro8qB-svLo"

@onready var http_request: HTTPRequest = $HTTPRequest

func _ready() -> void:
	if FileAccess.file_exists("user://game_config.ini"):
		var file = FileAccess.open("user://game_config.ini",FileAccess.READ)
	http_request.download_file = "user://game_config.ini"
	http_request.request(url)

func _on_http_request_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void:
	print(body.get_string_from_utf8())
1 Like