extends Node class_name GalleryRequest # This holds a http requester and uses it to grab gallery list then # uses the FAreader to get the data then adds it to a global array # then frees. export var url:String var http = HTTPRequest.new() var loaded = false var least_id:int = 0 onready var gatherer = get_parent() func _ready(): owner = get_parent().owner add_child(http) http.connect("request_completed",self,"complete") if url.empty(): queue_free() func _process(delta): if not loaded and Global.busy < 4: http.request(url,Global.headers) loaded = true Global.busy += 1 func complete(result, response_code, headers, body:PoolByteArray): print_debug(body.get_string_from_utf8().substr(128,256)) Global.busy -= 1 gatherer.stuff_loaded += 1 var FA = FAParser.new() FA.open_buffer(body) #var dat = FA.get_sub_urls() var dat = FA.get_sublist_data() print("Found %d submissions from %s"%[dat.size(),url]) $"%Log".text += "\nFound %d submissions from %s"%[dat.size(),url] $"%Loading".value += 1 for i in dat.keys(): var include = true # Check if submission title contains blacklisted string for check in get_parent().blacklist: if dat[i]["title"].matchn("*%s*"%[check]): include = false print(check," is in ",dat[i]["title"]) break # check if submission was made by a user in the blacklist for check in Settings.settings.UserBL: if dat[i]["user"] == check: include = false print(check," is in user blacklist") break if include and i > least_id: gatherer.sub_data[i] = dat[i] queue_free()