ipatool icon indicating copy to clipboard operation
ipatool copied to clipboard

Download with apple content id (trackId)

Open ryh opened this issue 2 years ago • 3 comments

apple content id is more easier for find when user searching for app, but bundle id is not on the web page.

for eg. testflight url https://apps.apple.com/us/app/testflight/id899247664 id 899247664 is in URL, and in HTML <meta name="apple:content_id" content="899247664"> also is trackId in search result.

so user directly input the apple content id could skip the search part in download sub command, maybe?

ryh avatar Apr 03 '22 08:04 ryh

@majd I did try display the id in the output to table style with ANSI-Colors, But this will depend on third package SwiftyTextTable I just forked and modified, so I am not sure If I should make a PR search git result: none style default style

ryh avatar Apr 04 '22 11:04 ryh

I'd rather not introduce a new dependency. I'm planning to revise the output format in an upcoming major version so I'll park this feature request until then.

majd avatar Apr 04 '22 16:04 majd

You can turn trackId into bundleId by chaining few commands like this: echo 899247664 | awk '{print "http://itunes.apple.com/lookup?id="$1}' | xargs curl -s | python3 -c "import sys, json; print(str(json.load(sys.stdin)['results'][0]['bundleId']))"

To download the resulting bundleId it with ipatool, just add it to the end like this: echo 899247664 | awk '{print "http://itunes.apple.com/lookup?id="$1}' | xargs curl -s | python3 -c "import sys, json; print(str(json.load(sys.stdin)['results'][0]['bundleId']))" | xargs ipatool download -b

If you want the input to be the full url, then it would be: echo https://apps.apple.com/us/app/testflight/id899247664 | awk -F/id '{print "http://itunes.apple.com/lookup?id="$2}' | xargs curl -s | python3 -c "import sys, json; print(str(json.load(sys.stdin)['results'][0]['bundleId']))" | xargs ipatool download -b

For ultimate convenience you can create an alias: alias ipatoolb='f() { echo $1 | awk -F/id '\''{print "http://itunes.apple.com/lookup?id="$2}'\'' | xargs curl -s | python3 -c "import sys, json; print(str(json.load(sys.stdin)[\"results\"][0][\"bundleId\"]))" | xargs ipatool download -b};f'

and call it like that ipatoolb https://apps.apple.com/us/app/testflight/id899247664

jankais3r avatar Apr 29 '22 09:04 jankais3r

I've ultimately decided to keep the CLI simple and not include yet another identifier as a command parameter. I'd suggest using one of the suggestions mentioned above.

majd avatar Dec 06 '22 22:12 majd

@majd What would be wrong with doing so, it would be a lot more convenient to just paste in the ID show in App Store URLs rather than. I don't see why that would be a problem, its not yet another, just one that would make things much easier for users. Honestly, it should've been the one to use for ipatool instead of bundle identifier?

How would you even easily get a bundle identifier? I'm just curious what made you pick it in the first place too.

YousufSSyed avatar May 17 '23 17:05 YousufSSyed