Jump to content
Sign in to follow this  
SHUVAM

DOWNLOADING

Recommended Posts

is there any way to download files through script? @enyby

 

Sent from my Redmi Y1 Lite using Tapatalk

 

 

Share this post


Link to post
Share on other sites

Yep. Load data via gg.makeRequest and store it via io.* functions.

Share this post


Link to post
Share on other sites

which io. func should i use

Sent from my Redmi Y1 Lite using Tapatalk

[added 1 minute later]

gg.makeRequest('https://doc-08-4o-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/j53ft9ui16r3t0blmodak5cs1ubss775/1552917600000/04169933601355940676/*/18KWCHguZlrm7yAC2Q1dDzxY-GJe_3_EY?e=download')

what to do nxt@enyby

Sent from my Redmi Y1 Lite using Tapatalk

Share this post


Link to post
Share on other sites

Io.open. Io.write io.close and so on. Read lua reference or lua-users wiki or lua book for know how to write byte data to file.

Share this post


Link to post
Share on other sites

i tried lua reference but i can't see how to create file

Sent from my Redmi Y1 Lite using Tapatalk

Share this post


Link to post
Share on other sites

Read about io.open.

Share this post


Link to post
Share on other sites
Read about io.open.
actually i want to make a utub downloader
how to write bytes?

Sent from my Redmi Y1 Lite using Tapatalk

[added 2 minutes later]

data=gg.makeRequest('anylink')
io.open('example.lua', "w")
--what to do next?

Sent from my Redmi Y1 Lite using Tapatalk

Share this post


Link to post
Share on other sites

At a minimum, read the API and description of makeRequest. Get data to variable. The contents of the variable to write to the file.
If you do not know how to do this, you should definitely read books or articles, because you will stumble at every step if you do not know such basic concepts.

I will not sit with you and write line by line.

Share this post


Link to post
Share on other sites
At a minimum, read the API and description of makeRequest. Get data to variable. The contents of the variable to write to the file.
If you do not know how to do this, you should definitely read books or articles, because you will stumble at every step if you do not know such basic concepts.
I will not sit with you and write line by line.
okay i will try my best thnx

Sent from my Redmi Y1 Lite using Tapatalk

Share this post


Link to post
Share on other sites
5 hours ago, SHUVAM said:

 

is there any way to download files through script? @enyby

 

local fileData = gg.makeRequest('https://badcase.org/yourFile.txt').content

file = io.open(gg.EXT_STORAGE .. '/Download/yourFileName.txt', 'w')
file:write(fileData)
file:close()

 

Share this post


Link to post
Share on other sites
local fileData = gg.makeRequest('https://badcase.org/yourFile.txt').contentfile = io.open(gg.EXT_STORAGE .. '/Download/yourFileName.txt', 'w')file:write(fileData)file:close()

 

why .content and what is gg.External

Sent from my Redmi Y1 Lite using Tapatalk

Share this post


Link to post
Share on other sites

Why you not read API help? Why you waste others time for explain what already described in API help? Why you disrespect others time?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...