Guest User

Untitled

a guest
Nov 20th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import requests
  2.  
  3. r = requests.get('https://www.google.com/images/srpr/logo11w.png')
  4.  
  5. with open('google_logo.png', 'wb') as f:
  6. f.write(r.content)
  7.  
  8. from flask import request
  9. import requests
  10.  
  11.  
  12. @app.route('/user_download')
  13. def user_download():
  14. url = request.args['url'] # user provides url in query string
  15. r = requests.get(url)
  16.  
  17. # write to a file in the app's instance folder
  18. # come up with a better file name
  19. with app.open_instance_resource('downloaded_file', 'wb') as f:
  20. f.write(r.content)
  21.  
  22. from urllib.request import urlopen
  23. //I used python3
  24.  
  25. location = 'http://ical.citesi.nl/?icalguid=81b4676a-b3c0-4b4c-89bd-d91c3a52fa7d&1511210388789'
  26. result = urlopen(location)
Add Comment
Please, Sign In to add comment