0

Here's a link to a shared file:

https://drive.google.com/open?id=0B84DlMErV9QYSFVYbEluMXQ4VlE

How can the rar file behind be fetched and stored locally with GNU Octave commands? urlwrite() would not make it, as it downloads an html file. ftp connections are not allowed in Google drive.

nightcod3r
  • 752
  • 1
  • 7
  • 26

1 Answers1

1

Use Google Drive Direct Link Generator and then urlwrite:

urlwrite ("https://drive.google.com/uc?export=download&id=0B84DlMErV9QYSFVYbEluMXQ4VlE", "foobar.rar")

Or use regexprep to change the URL (the format should be obvious)

See also SO question howto use google drive because this is question is mostly howto get a direct link and not really Octave related.

Community
  • 1
  • 1
Andy
  • 7,931
  • 4
  • 25
  • 45
  • Following the instructions you provide, the link I get is of a different kind: `https://docs.google.com/document/d/1uKPq50DwwK3yaEY9l2btqV457bLGM3R8HQJO2jYgI4g/edit?usp=sharing`, and `urlwrite` does write an html file, not the original rar file. – nightcod3r Sep 15 '16 at 20:32
  • If I enter https://drive.google.com/file/d/0B84DlMErV9QYSFVYbEluMXQ4VlE/view I get https://drive.google.com/uc?export=download&id=0B84DlMErV9QYSFVYbEluMXQ4VlE perhaps you've missed the /view ? – Andy Sep 15 '16 at 21:11
  • Gosh, how do you get that url? If I enter it in the browser it simply opens up the Google drive site with the test.txt file in it. When I press the download button, it shows for a brief time the address `https://docs.google.com/uc?id=0B84DlMErV9QYSFVYbEluMXQ4VlE&export=download`, which I believe it's equivalent to yours, cause then `urlwrite` does work, but how to obtain it without pressing on download and been quick enough (before the window collapses and the download of the file starts) ? – nightcod3r Sep 16 '16 at 20:36
  • Are you trolling me? – Andy Sep 18 '16 at 08:26
  • ?? nope, this is just what it happens, don't know how do you get that address, it is not what I get. And, without that address, the original file is not fetched. – nightcod3r Sep 18 '16 at 18:53