Skip to content

Instantly share code, notes, and snippets.

@wkoszek
Last active October 4, 2015 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wkoszek/48b4ac725664d324c9d5 to your computer and use it in GitHub Desktop.
Save wkoszek/48b4ac725664d324c9d5 to your computer and use it in GitHub Desktop.
wget in 9 lines of Python for running in hostile environments (aka. how to fetch HTTPS stuff on Synology DS214play)
#!/usr/bin/env python
import urllib2, sys
urlstr = sys.argv[1]
fname = urlstr.split('/')[-1]
response = urllib2.urlopen(urlstr)
f = open(fname, "w")
f.write(response.read())
f.close()
print "written " + fname
@wkoszek
Copy link
Author

wkoszek commented Oct 4, 2015

Synology DS214play comes with wget without https:// support. While working on https://github.com/wkoszek/synology I wanted to actually fetch it and test it from GitHub releases, but GitHub now redirects to HTTPS always. So I wrote this simple thing for letting me fetch the release and do further bootstrapping/testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment