Unable to download images through DownloadThemAll

ok waiting your solution please.

1 Like

@Kal_Lam @ahmaddiab this is the same issue I was referring too.

Thanks

1 Like

@Mujahid_Aliyu, linking your issue here for referencing:

Hi @Mujahid_Aliyu, @ahmaddiab, we are looking into a solution for this :+1: In the meantime, I have found a workaround that you can use.

Please go to the following URL and use DownThemAll from there:

https://[kf_url]/api/v2/assets/[asset_uid]/data

So for example, if you are on the HHI server, kf_url will be kf.kobotoolbox.org and on OCHA it will be kobo.humanitarianresponse.info. Your asset_uid is the id of your project, something like aC34iDewbTEGGVbbSREsXy.

The page will look like this:

From that page, the DownThemAll extension is able to pick up the media URLs to download :+1:

3 Likes

Many thanks for your help, while we await the issue to be resolved.

2 Likes

Hi @Mujahid_Aliyu, @ahmaddiab, another workaround, not using DownThemAll, could be to do something like this from your terminal:

TOKEN="your_secret_token"
curl -s "https://[kf_url]/api/v2/assets/[asset_uid]/data.json" \
-H "Authorization: Token $TOKEN" \
> data.json
for URL in $(cat data.json | jq '.results[]._attachments[].download_url' | sed s/\"//g); do \                          
  FILENAME=$(echo $URL | awk -F "%2F" '{print $(NF)}'); \
  wget "$URL" -O "$FILENAME" --header="Authorization: Token $TOKEN"; \
done
1 Like

Hey Josh thanks for your help , my page Freeze when i tried to load more.

can you please send me this way step by step to my email , ahmad.diab1st@live.com

Dear Kal ,

Please any update regarding this issue , the workarround that josh gave its very difficult and im not sure if im still downloading all data needed , i will prefer if the dowloadthem all work through the main data table , this issue is delaying our team productivity i hope you can give it high priority .

@ahmaddiab, it should take some time and we will update you when it’s been fixed.

please because as today im not able to download anything and the API page giving 502 Bad Gateway error , i will wait the solution from your side ASAP .

Thanks .

Hi @ahmaddiab, there is unfortunately no deployed change yet. You can try loading the API page with a limit parameter and then using start to paginate through your submissions:

https://[kf_url]/api/v2/assets/[asset_uid]/data?start=0&limit=100
1 Like

Dear Kal/Josh ,

Please any update about the issue , when we excpect the solution .

Thanks .

Hi @ahmaddiab, there has been no update yet. Have you tried the suggestion in my previous message?

1 Like

Hi @ahmaddiab, I’ve cobbled together a rough Python script for media downloads here that you can use. It will skip already downloaded media so you don’t have to download everything every time:

1 Like

hi Josh,

Sorry but seems im not familiar with coding :slightly_smiling_face: ,

can you please find for me a way that i can get only data for specific submittied date using API way !.

Hi @ahmaddiab, you can do this as follows:

If you want to download media from the date 2021-09-26:

https://[kf_url]/api/v2/assets/[asset_uid]/data/?query={"$and":[{"_submission_time":{"$gte":"2021-09-26"}},{"_submission_time":{"$lt":"2021-09-27"}}]}

Then use DownThemAll from on that filtered set of data :+1:

2 Likes

its giving me : 502 Bad Gateway

nginx/1.19.10

it work now but can i hide the medium size and small size images !