HOW TO DOWNLOAD IMAGES

HI
HOW TO DOWNLOAD IMAGES OR ANY MEDIA FILES FROM WEB SITES
MY OB2 DOESNT RESPONDS
PLOX IF ANY EXAMPLE

Is the file it too big it will take time, avoid doing it in debugger because it will make openbullet lagging, also you can change the Request Timeout, so it have the time to download it.

Here a piece a config i made to download a video (I’ve set timeout 500000 millisecond):

BLOCK:HttpRequest
LABEL:DOWNLOAD VIDEO
  url = $"<DOWNLOAD_URL>"
  absoluteUriInFirstLine = True
  timeoutMilliseconds = 500000
  TYPE:STANDARD
  ""
  "application/x-www-form-urlencoded"
ENDBLOCK

BLOCK:FileWriteBytes
LABEL:SAVE VIDEO
  path = $"video/<NAME>.mp4"
  content = @data.RAWSOURCE
ENDBLOCK
2 Likes

Just wanted to add 2 things

You can disable logging for the request block if the output is too much like this

data.Logger.Enabled = false;
// your block
data.Logger.Enabled = true;

If you plan to use this with proxies in a Multi Run Job, please make sure to also set a high Read/Write timeout for proxies in the RL Settings

5 Likes