Jump to content

updating/edit modpack using a bash script (curl)


BMicraft

Recommended Posts

Hello guys :)

Today I was wondering if it is possible to update and/or edit my modpack using curl and it looked like it could work but I encountered a problem

Here is a snippet of my script; Please take a look at it:

curl --cookie out/cookies.txt --cookie-jar out/cookies.txt -d "username=myuser&password=mypass" --location --output ./out/response1.html http://www.technicpack.net/user/authenticate curl --cookie out/cookies.txt -d "pack-id=3824xx&name=mypackname&version=1.1&minecraft_version_id=21&is_hidden=1&url=http://dl.xxxxxxx.com/modpacks/xxxxxx-xxx/1-7-2.zip&short_description=...nothing here...&force_directory=1" --location --output ./out/response2.html www.technicpack.net/modpack/edit_pack

technicpack.net/modpack/edit_pack

Of course I edited the posted script here so nobody can get my login data :-P

 

So here is my problem:

 

The file out/response1.html has a save of my dashboard (technicpack.net/dashboard)

The file out/response2.html has a save of the "home" page in it.

If the login failed I would get an 503 (or similar) error so it must work but the pack does just not update :(

If I enter (after I am logged in)...

www.technicpack.net/modpack/edit_pack?"pack-id=3824xx&name=mypackname&version=1.1&minecraft_version_id=21&is_hidden=1&url=http://dl.xxxxxxx.com/modpacks/xxxxxx-xxx/1-7-2.zip&short_description=...nothing here...&force_directory=1" 

... into my browser I would get exactly the same result so I came to the conclusion that something with the parameters has to be wrong but I can't find the problem.

 

Or is there a better solution for doing that (like a "secret" api)? (The only thing I want to be able to do is automatically increase the version number to make the client update the installation!)

 

If you have any tips for me I highly appreciate them. Thanks in advance!

 

---BMicraft

Edited by BMicraft
Link to comment
Share on other sites

If you are to the point of trying to script your pack management with curl it might be time to switch to the Solder API.

Thanks you really helped me!

But I have to ask this:

How are you supposed to know about this - on the comlete site is link or anything to this api.... or am I wrong?

 

---BMicraft

Link to comment
Share on other sites

  • Discord Moderator

(might not want to "sign" your posts, it is against the rules)

 

Link to Github Solder API respository and instructions: https://github.com/TechnicPack/TechnicSolder

 

Some possibly helpful info:

 

'?do=embed' frameborder='0' data-embedContent>>

'?do=embed' frameborder='0' data-embedContent>>

 

How are folks supposed to know about this? Really, just the way you did. Solder is not for the faint of heart or the inexperienced. It has no "official" support. I do have an instance of Solder running for my packs so I might be able to help you if you get stuck. Well, that and 20+ years of Linux admin work :)

Edited by plowmanplow
Link to comment
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
×
×
  • Create New...