How do I seek to a particular position on a remote (HTTP) file so I can download only that part?
Lets say the bytes on a remote file were: 1234567890
I wanna seek to 4 and download 3 bytes from there so I would have: 456
and also, how do I check if a remote file exists?
I tried, os.path.isfile() but it returns False when I’m passing a remote file url.
If you are downloading the remote file through HTTP, you need to set the
Rangeheader.Check in this example how it can be done. Looks like this:
EDIT: I just found a better implementation. This class is very simple to use, as it can be seen in the docstring.
Update: The “better implementation” has moved to github: excid3/urlgrabber in the byterange.py file.