Open TomiMikola opened 8 years ago
maybe a bit late..but I added some error handling that will make sure the program continues even in case of a 404 or 400. Files that couldn't be downloaded are logged. https://github.com/oskardrenske/polar-flow-export
When trying to export session type of 'multisport' from Polar Flow the exporter throws error (400 bad request). That's due the download URL which is trying to download the plain tcx file. For some reason Flow provides only zipped version to be downloaded. So the issues lies on the line https://github.com/gabrielreid/polar-flow-export/blob/master/polarflowexport.py#L137 which has the 'false' in the URL.
How to get around? Read the response status code and try switching to zipped URL when 400. Or downloading all the sessions using zipped tcx files and unpacking them after download? The latter would be relatively easy to implement I guess. (Would try to fix a patch, but I'm limited with time at this moment)
PS. Huge thanks for this script - saved my day! Exporting the tcx files one by one (to be uploaded to TrainingPeaks) is pain in the ass.