ntivirikin / xeno-canto-py

Python wrapper for the xeno-canto.org API to aid in downloading and managing recordings.
MIT License
35 stars 14 forks source link

fix download problem #6

Closed bilzard closed 2 years ago

bilzard commented 2 years ago

close #7

Root Cause

The API response assumed by the tool does not match the API response at this time (2022/3/24).

part of the current json response:

    {
      "id": "91359",
      "gen": "Hemignathus",
      ...
      "url": "//xeno-canto.org/91359",
      "file": "https://xeno-canto.org/91359/download",
      ...
    }

Changes

What I tested

I tested fixed program successfully download the audio file:

$ xeno-canto -dl Erckel\'s Francolin
Downloading all recordings for query...
Retrieving metadata...
Downloading metadate page 1...
Found 11 recordings for given query, downloading...
Downloading 410277.mp3...
Downloading 410276.mp3...
Downloading 252697.mp3...
Downloading 252696.mp3...
Downloading 267205.mp3...
Downloading 210297.mp3...
Downloading 83661.mp3...
Downloading 300641.mp3...
Downloading 300640.mp3...
Downloading 300639.mp3...
Downloading 66313.mp3...
ntivirikin commented 2 years ago

Thanks for the fix! Saw this issue occurring earlier and had a fix ready but didn't get around to testing it thoroughly. Will apply this for now and hopefully get around to more robust testing in the near future.