Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- r = requests.get('https://www.google.com/images/srpr/logo11w.png')
- with open('google_logo.png', 'wb') as f:
- f.write(r.content)
- from flask import request
- import requests
- @app.route('/user_download')
- def user_download():
- url = request.args['url'] # user provides url in query string
- r = requests.get(url)
- # write to a file in the app's instance folder
- # come up with a better file name
- with app.open_instance_resource('downloaded_file', 'wb') as f:
- f.write(r.content)
- from urllib.request import urlopen
- //I used python3
- location = 'http://ical.citesi.nl/?icalguid=81b4676a-b3c0-4b4c-89bd-d91c3a52fa7d&1511210388789'
- result = urlopen(location)
Add Comment
Please, Sign In to add comment