-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Synology DS214play comes with
wget
withouthttps://
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.