Created
September 21, 2018 08:50
-
-
Save xiangzhuyuan/7b632e506b6d0ac4c904a0325536e2c5 to your computer and use it in GitHub Desktop.
try to bulk download fit file from garmin portal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#var s ='';$("#activity-name-edit > a").each(function(){s+=$(this).attr('href').split('/')[3]; s+="\n";});console.log(s) | |
ids='3031291759 3031291483 3031291242 3031291096 3031290952 3023644256 3022933525 3017780038 3017658434 3013372497 3009179215 3007461440 3005419661 3004834235 3004833926 2994827251 2994213912 2992526210 2991711451 2989717745' | |
for id in $ids | |
do | |
echo "https://connect.garmin.com/modern/proxy/download-service/files/activity/$id" | |
curl "https://connect.garmin.com/modern/proxy/download-service/files/activity/$id" -H 'authority: connect.garmin.com' -H 'cache-control: max-age=0' -H 'upgrade-insecure-requests: 1' -H 'dnt: 1' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'referer: https://connect.garmin.com/modern/activities' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: zh-CN,zh;q=0.9,ja;q=0.8,en-US;q=0.7,en;q=0.6' -H 'cookie: AKA_A2=A; __utma=143254506.9090777.1537517116.1537517116.1537517116.1; __utmc=143254506; __utmz=143254506.1537517116.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _ga=GA1.2.9090777.1537517116; _gid=GA1.2.926400645.1537517116; GARMIN-SSO=1; GarminNoCache=true; GARMIN-SSO-GUID=832467C25554F3EF2D8756D9025F318A6912FB4A; GARMIN-SSO-CUST-GUID=d3ba385b-b502-4abf-9df6-962a42b8d83e; SESSIONID=b75c048d-190c-4b31-81c7-d991b874eb1e; BIGipServercwp.garmin.com.80.pool=!72NXdGiMamoVUJhq7giluby4Yq0w5UD/gM0dbEhaBNi5qQAuAfTDr5eR5677aOMke2BvdXBgGjbDFBM=; G_ENABLED_IDPS=google; utag_main=v_id:0165fb2958310015364a11a05bbd0307900270710093c$_sn:1$_ss:0$_st:1537519379769$ses_id:1537517115442%3Bexp-session$_pn:10%3Bexp-session; __atuvc=7%7C38; __atuvs=5ba4a64517c90869006; __utmb=143254506.6.10.1537517116; ADRUM=s=1537518095907&r=https%3A%2F%2Fconnect.garmin.com%2Fmodern%2Factivity%2F3031291483%3F0' --compressed -o $id.zip | |
unzip $id.zip | |
rm $id.zip | |
done | |
echo all done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment