Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
download file from url
#1
Hi folks

I know how to download with the direct link, but we always have updates.

import requests

print ('Download')

url = 'https://github.com/roundcube/roundcubemail/releases/download/1.4.9/roundcubemail-1.4.9-complete.tar.gz'

r = requests.get (url)

filename = url.split ('/') [- 1]

with open (filename, 'wb') as output_file:
     output_file.write (r.content)

print ('Download Completed')
How can I download the latest version without having to copy the link and edit my script.

Could you please help me?

Best Regards
Reply


Messages In This Thread
download file from url - by fernandosianet - Oct-27-2020, 05:42 PM
RE: download file from url - by Axel_Erfurt - Oct-27-2020, 06:53 PM
RE: download file from url - by fernandosianet - Oct-27-2020, 08:14 PM
RE: download file from url - by bowlofred - Oct-29-2020, 03:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  FTP Download of Last File jland47 4 412 Mar-16-2024, 09:15 AM
Last Post: Pedroski55
  download a file from a URL JayManPython 7 1,375 Jun-28-2023, 07:52 AM
Last Post: JayManPython
  FTP File Download question / concern cubangt 3 1,320 Jan-06-2022, 07:46 PM
Last Post: cubangt
  download with internet download manager coral_raha 0 2,972 Jul-18-2021, 03:11 PM
Last Post: coral_raha
  Download file from Private GitHub rep vinuvt 0 1,982 Jul-27-2020, 11:38 AM
Last Post: vinuvt
  PyDrive download file path MiniMinnow 0 3,250 Apr-28-2020, 03:01 PM
Last Post: MiniMinnow
  download file from google drive .. evilcode1 7 13,894 Sep-21-2018, 06:13 PM
Last Post: evilcode1
  Download entire web pages and save them as html file with urllib.request fyec 2 14,738 Jul-13-2018, 10:12 AM
Last Post: Larz60+
  download dataset from SH file Felix 1 2,607 Mar-28-2018, 05:04 AM
Last Post: Larz60+
  Download file from Internet Tribunal 1 2,788 Oct-11-2017, 06:03 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020