Kaggle / kaggle-api

Official Kaggle API
Apache License 2.0
6.28k stars 1.1k forks source link

Downloading dataset from competitions result in 404 #413

Open RomainCendre opened 2 years ago

RomainCendre commented 2 years ago

Hi everyone, I was trying the Kaggle API for the first time the previous week, that seems pretty nice, but I'm facing an issue.

The dataset is provided by Meta deepfake-detection-challenge: https://www.kaggle.com/c/16880/datadownload/dfdc_train_all.zip

This is the code I'm using:

import re
import json
import os

import six
from kaggle.api.kaggle_api_extended import KaggleApi
# Un-comment if you want to read the credentials from a file
with open(os.path.expanduser("~/.kaggle/kaggle.json"), "rb") as f:
    creds = json.load(f)
os.environ["KAGGLE_USERNAME"] = creds["username"]
os.environ["KAGGLE_KEY"] = creds["key"]
api = KaggleApi()
api.authenticate()
api.competitions_data_download_file(id="deepfake-detection-challenge", file_name="dfdc_train_all.zip")
OR
api.competitions_data_download_file(id=16880, file_name="dfdc_train_all.zip")

I get: ApiException: (404) Reason: Not Found

with => 'Turbolinks-Location': 'https://www.kaggle.com/api/v1/competitions/data/download/deepfake-detection-challenge/dfdc_train_all.zip' (that seems correct?) Or 'https://www.kaggle.com/api/v1/competitions/data/download/16880/dfdc_train_all.zip'

Thanks for your feedbacks !