8 Replies - 908 Views - Last Post: 06 January 2014 - 03:34 PM Rate Topic: -----

#1 porkinspullup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-January 14

Downloading from MEGA with a batch script

Posted 06 January 2014 - 02:55 PM

I'm kind of a programming noob FYI, however I have a decent amount of experience writing batch scripts. I'm not sure this can be done with batch, it would probably have to be done in C++, or VBScript but I'll ask anyway.

I'd like to write a batch script that will download a file from the file sharing site MEGA. If MEGA provided direct links, I could easily use wget to download the file. However, MEGA doesn't support direct links in any way.

The only way I can think of to download it is to have the batch script communicate with the HTML on the download page such that I could execute the same actions as clicking the 'Download' button on MEGA. Is this possible? Could I somehow grab the
<div>
tag that represents the download button and get the same response as a mouse click?

Thanks for any help you guys can give.

Is This A Good Question/Topic? 0
  • +

Replies To: Downloading from MEGA with a batch script

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8377
  • View blog
  • Posts: 31,138
  • Joined: 12-June 08

Re: Downloading from MEGA with a batch script

Posted 06 January 2014 - 02:59 PM

Why not use their SDK?
https://mega.co.nz/#dev

It seems they would prefer you to use that than attempt to scrape pages.

https://mega.co.nz/#terms
Was This Post Helpful? 1
  • +
  • -

#3 porkinspullup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-January 14

Re: Downloading from MEGA with a batch script

Posted 06 January 2014 - 03:09 PM

I'd rather not mess with that unless I absolutely had to. I selected batch for doing it because it's something I'm fairly familiar with and it's relatively simple. It's also kind of an educational thing for me because I've never interacted with HTML in code before.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8377
  • View blog
  • Posts: 31,138
  • Joined: 12-June 08

Re: Downloading from MEGA with a batch script

Posted 06 January 2014 - 03:10 PM

Again.. their own terms of use advocates using the API and not trying to scrape/bot rip their html.
Was This Post Helpful? 0
  • +
  • -

#5 porkinspullup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-January 14

Re: Downloading from MEGA with a batch script

Posted 06 January 2014 - 03:11 PM

View Postmodi123_1, on 06 January 2014 - 03:10 PM, said:

Again.. their own terms of use advocates using the API and not trying to scrape/bot rip their html.


If it's a legal thing then I guess I have no choice...
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8377
  • View blog
  • Posts: 31,138
  • Joined: 12-June 08

Re: Downloading from MEGA with a batch script

Posted 06 January 2014 - 03:12 PM

It's in their terms of use.. so.. yeah.
Was This Post Helpful? 0
  • +
  • -

#7 porkinspullup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-January 14

Re: Downloading from MEGA with a batch script

Posted 06 January 2014 - 03:26 PM

Well I tried to compile the MEGA SDK source code and it wouldn't work. It's going to take me all night to figure this out assuming I do.
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8377
  • View blog
  • Posts: 31,138
  • Joined: 12-June 08

Re: Downloading from MEGA with a batch script

Posted 06 January 2014 - 03:30 PM

That may be true, but that is the legit way to go about accessing their site's information. If you choose to go another route that runs contrary to their terms of use then you would need to take the search elsewhere.

To be clear we will not be able to help you trample their terms of use. ;)
Was This Post Helpful? 0
  • +
  • -

#9 porkinspullup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-January 14

Re: Downloading from MEGA with a batch script

Posted 06 January 2014 - 03:34 PM

Very well, thank you for replying so quickly anyway. I really appreciate it. 90% of the forums I ask questions on take days for anyone to respond and it's usually with some annoying unhelpful answer.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1