wkentaro / gdown

Google Drive Public File Downloader when Curl/Wget Fails
MIT License
4.22k stars 348 forks source link

Fix content-type not found error #273

Closed hungpham3112 closed 8 months ago

hungpham3112 commented 1 year ago

See https://stackoverflow.com/questions/37339644/content-type-is-blank-in-the-headers-of-some-requests for more information

Need to check before merge.

This PR will solve the problem in https://github.com/serengil/deepface/issues/769

wkentaro commented 8 months ago

Looking at the PR in deepface, seems it's env problem, so closing for now.

hungpham3112 commented 8 months ago

Looking at the PR in deepface, seems it's env problem, so closing for now.

Hi @wkentaro . Can you look at the PR again? Deepface using gdown for downloading from google drive. This is a bug with gdown, not deepface. They are not related to this problem so they already closed issue.

wkentaro commented 8 months ago

@hungpham3112 Okay. Can you give a command to reproduce this?

hungpham3112 commented 8 months ago

@wkentaro. I used deepface as a way to reproduce the problem.

Step 1: Download deepface pip install deepface dlib Step 2: Run below code

  from deepface import DeepFace
  detected_face = DeepFace.extract_faces("./obama.jpg", detector_backend = 'dlib')

and see the problem. The code in gdown default assumes ["content-type"] is always available.

wkentaro commented 8 months ago

@hungpham3112 I was able to reproduce it. Fixing by https://github.com/wkentaro/gdown/pull/302

gdown http://dlib.net/files/shape_predictor_5_face_landmarks.dat.bz2