IPATool-py: download ipa easily

Overview

IPATool-py

Python version of IPATool!

Installation

pip3 install -r requirements.txt

Usage

Quickstart: download app with specific bundleId into DIR:

python3 main.py lookup -b com.touchingapp.potatsolite -c JP download -e APPLE_EMAIL -p APPLE_PWD -o DIR

Specific usage:

  1. Query app info:

    python3 main.py lookup -b com.touchingapp.potatsolite -c JP
    
  2. Download app with specific appVerId (salableAdamId):

    python3 main.py downlaod -i 123456 -e APPLE_EMAIL -p APPLE_PWD
    

    Can also supply an optional output dir (e.g. ipa_output):

    python3 main.py downlaod -i 123456 -e APPLE_EMAIL -p APPLE_PWD -o ipa_output
    
  3. Get history version (supply an appVerId for target app):

    python3 main.py historyver -i 123456 -e APPLE_EMAIL -p APPLE_PWD
    
  4. Chain multiple command, last command's output will be passed to next command (so you don't need to supply some arguments like appVerId)

    python3 main.py lookup -b com.touchingapp.potatsolite -c JP historyver -e APPLE_EMAIL -p APPLE_PWD
    
  5. Use json output for program using

    python3 main.py --json lookup -b com.touchingapp.potatsolite -c JP historyver -e APPLE_EMAIL -p APPLE_PWD
    

Development

  • All requests' reqBody and respBody are modeled using modified JSONSchema2PoPo2 (see my NyaMisty/JSONSchema2PoPo2), you can regenerate the binding by cd into reqs/schemas and execute python3 -m schema_defs

Credit

  • Thanks @majd's ipatool, which is written in swift
Comments
  • Automatically obtain license

    Automatically obtain license

    Is this possible that this script automatically obtains a license by simulating the purchase? For free apps only. If you can add that feature, that'd be super cool. Thank you so much for your great contribution.

    opened by rehmatworks 13
  • Can I purchase a paid app?

    Can I purchase a paid app?

    I tried

    python3 main.py lookup -b ch.threema.iapp -c IT download --purchase -e [email protected] -p password     
    [18:36:50] INFO     Looking up app in country IT with BundleID BundleID ch.threema.iapp                                                                                                                                                                        main.py:147
               INFO     Found app:                                                                                                                                                                                                                                 main.py:154
                                Name: Threema. App messaggi sicura                                                                                                                                                                                                            
                                Version: 4.8.1                                                                                                                                                                                                                                
                                bundleId: ch.threema.iapp                                                                                                                                                                                                                     
                                appId: 578665578                                                                                                                                                                                                                              
               INFO     Logging into iTunes...                                                                                                                                                                                                                     main.py:197
    [18:36:52] INFO     Logged in as Foo User                                                                                                                                                                                                                main.py:200
               INFO     Try to purchasing appId 578665578 
    

    but I received this

    Traceback (most recent call last):
      File "/Users/iosfora/Desktop/ipatool-py/main.py", line 325, in <module>
        main()
      File "/Users/iosfora/Desktop/ipatool-py/main.py", line 323, in main
        tool.tool_main()
      File "/Users/iosfora/Desktop/ipatool-py/main.py", line 131, in tool_main
        args.func(args)
      File "/Users/iosfora/Desktop/ipatool-py/main.py", line 252, in handleDownload
        Store.purchase(self.appId)
      File "/Users/iosfora/Desktop/ipatool-py/reqs/store.py", line 169, in purchase
        return self.buyProduct_purchase(appId)
      File "/Users/iosfora/Desktop/ipatool-py/reqs/store.py", line 162, in buyProduct_purchase
        resp.status + '-' + resp.jingleDocType)
    TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
    

    Anyway this works

    python3 main.py lookup -b ph.telegra.Telegraph -c IT download --purchase -e [email protected] -p password
    [18:35:32] INFO     Looking up app in country IT with BundleID BundleID ph.telegra.Telegraph                                                                                                                                                                   main.py:147
    [18:35:33] INFO     Found app:                                                                                                                                                                                                                                 main.py:154
                                Name: Telegram Messenger                                                                                                                                                                                                                      
                                Version: 9.0.1                                                                                                                                                                                                                                
                                bundleId: ph.telegra.Telegraph                                                                                                                                                                                                                
                                appId: 686449807                                                                                                                                                                                                                              
               INFO     Logging into iTunes...                                                                                                                                                                                                                     main.py:197
    [18:35:35] INFO     Logged in as Foo User                                                                                                                                                                                                               main.py:200
               INFO     Try to purchasing appId 686449807                                                                                                                                                                                                          main.py:250
    [18:35:36] WARNING  You have already purchased appId 686449807 before                                                                                                                                                                                          main.py:255
               INFO     Retriving download info for appId 686449807                                                                                                                                                                                                main.py:259
    [18:35:37] INFO     Downloading app Telegram (ph.telegra.Telegraph) with appId 686449807 (version 9.0.1, versionId 852359203)                                                                                                                                  main.py:274
               INFO     Downloading ipa to ./ph.telegra.Telegraph-9.0.1-686449807-852359203.ipa                                                                                                                                                                    main.py:285
    [18:35:40] INFO     Download progress: 5.92% (  5.0M / 84.5M)                                                                                                                                                                                                   main.py:53
    [18:35:42] INFO     Download progress: 11.83% ( 10.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:35:43] INFO     Download progress: 17.75% ( 15.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:35:45] INFO     Download progress: 23.66% ( 20.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:35:46] INFO     Download progress: 29.58% ( 25.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:35:49] INFO     Download progress: 35.49% ( 30.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:35:50] INFO     Download progress: 41.41% ( 35.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:35:51] INFO     Download progress: 47.32% ( 40.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:35:53] INFO     Download progress: 53.24% ( 45.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:35:54] INFO     Download progress: 59.16% ( 50.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:35:56] INFO     Download progress: 65.07% ( 55.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:35:58] INFO     Download progress: 70.99% ( 60.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:36:00] INFO     Download progress: 76.90% ( 65.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:36:02] INFO     Download progress: 82.82% ( 70.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:36:04] INFO     Download progress: 88.73% ( 75.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:36:06] INFO     Download progress: 94.65% ( 80.0M / 84.5M)                                                                                                                                                                                                  main.py:53
    [18:36:07] INFO     Download progress: 100.00% ( 84.5M / 84.5M)                                                                                                                                                                                                 main.py:53
               INFO     Writing out iTunesMetadata.plist...                                                                                                                                                                                                        main.py:288
               INFO     Downloaded ipa to ph.telegra.Telegraph-9.0.1-686449807-852359203.ipa 
    

    In particular I want to buy this new app and I have already added necessary money to my Apple ID.

    Edit

    After applied this PR I get another error

    [20:16:08] CRITICAL Store buyProduct_purchase failed! Message: Purchase of this item is not currently available. (errorType None-None)                                                                                       main.py:211
               CRITICAL     Raw Response: {'pings': [], 'metrics': {'dialogId': 'MZCommerce.PriceMismatch', 'message': 'Purchase of this item is ', 'messageCode': '2019', 'options': ['OK'], 'actionUrl':                       main.py:212
                        'p25-buy.itunes.apple.com/WebObjects/MZBuy.woa/wa/buyProduct', 'asnState': 0, 'eventType': 'dialog'}, 'cancel-purchase-batch': True, 'failureType': '2019', 'customerMessage': 'Purchase of this item is            
                        not currently available.', 'm-allowed': False, 'dialog': {'m-allowed': False, 'isFree': True, 'message': 'Purchase of this item is not currently available.', 'explanation': 'This item is being                    
                        modified. Please try again later.', 'defaultButton': 'ok', 'okButtonString': 'OK', 'initialCheckboxValue': True}} 
    
    opened by lorenzoferron98 1
  • Unable to purchase an app + Readme issue

    Unable to purchase an app + Readme issue

    Getting MZCommerce.PriceMismatch error - so unable to purchase paid apps

    Also you need to mention in readme that user needs to authorise computer and make first purchase in iTunes with marked "do not ask for password" checkbox, otherwise this error throws: MZCommerce.ConfirmationNeededForOneClickBuy.SoftwareApplication, it is not handled in your code.

    opened by ZonD80 0
  • Error on buy product

    Error on buy product

    I have error with kbsync from iPhone

    Store buyProduct failed! Message: main.py:205 MZCommerce.ConfirmPaymentSheet_message (errorType
    -MZCommerce.ConfirmPaymentSheet)

    opened by flashfoxter 1
  • License not found exception handing broken

    License not found exception handing broken

    Hi, first of all, thank you for this great tool!

    I think that there has been a regression between 1f4d9b06bedbf902d6359acb9c609f6ec25d0ab8 and a8b2d37bba40ed427420f6a2a8fa9a89c4844256 ( compare ).

    When downloading without the new --purchase option a not previously purchased item, the exception handling itself fails.

    In particular, the change from

    raise StoreException("download", resp.customerMessage, resp.failureType)
    

    to

    raise StoreException("volumeStoreDownloadProduct", resp, resp.customerMessage, resp.failureType + '-' + resp.metrics.dialogId)
    

    Seems to be the cause.

    When debugging with pdb, I can inspct the resp object, which seems to have a its metrics field set to None:

    <Class StoreDownloadResp. pings: [], cancel_purchase_batch: True, customerMessage: 'License not found', failureType: '9610', jingleDocType: None, jingleAction: None, status: None, dsPersonId: None, creditDisplay: None, creditBalance: None, freeSongBalance: None, authorized: None, download_queue_item_count: None, songList: None, metrics: None, subscriptionStatus: None>
    

    Once again, thank you for this great and useful tool and for adding the purchase option! All the best, tuxmind.

    opened by z-tux-mind 0
  • New Errors

    New Errors

    Hey, i am getting this new error if i try to download the com.ea.simpsonssocial.inc2 IPA with the purchase option.

    <Class StoreBuyproductResp. pings: [], jingleDocType: None, jingleAction: None, status: None, dsPersonId: None, creditDisplay: None, creditBalance: None, freeSongBalance: None, creditDisplayInternal: None, authorized: None, download_ queue_item_count: None, songList: None, download_queue_info: None, metrics: <Class _metri...ype: 'dialog'>, duAnonymousPings: None, subscriptionStatus: None, cancel_purchase_batch: None, failureType: '2059', customerMessage: 'This it em is... unavailable.', m_allowed: False, dialog: <Class _dialo...oxValue: True>> Traceback (most recent call last): File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\main.py", line 326, in <module> main() File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\main.py", line 324, in main tool.tool_main() File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\main.py", line 131, in tool_main args.func(args) File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\main.py", line 252, in handleDownload Store.purchase(self.appId) File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\reqs\store.py", line 175, in purchase return self.buyProduct_purchase(appId) File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\reqs\store.py", line 168, in buyProduct_purchase resp.status + '-' + resp.jingleDocType) TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' '

    If i try to download it without the purchase option ill get this error:

    <Logger main (INFO)> <Class StoreDownloadResp. pings: [], cancel_purchase_batch: True, customerMessage: 'License not found.', failureType: '9610', jingleDocType: None, jingleAction: None, status: None, dsPersonId: None, creditDisplay: None, creditBalance : None, freeSongBalance: None, authorized: None, download_queue_item_count: None, songList: None, metrics: None, subscriptionStatus: None> Traceback (most recent call last): File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\main.py", line 326, in <module> main() File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\main.py", line 324, in main tool.tool_main() File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\main.py", line 131, in tool_main args.func(args) File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\main.py", line 261, in handleDownload downResp = Store.download(self.appId, self.appVerId) File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\reqs\store.py", line 181, in download return self.volumeStoreDownloadProduct(appId, appVer) File "C:\Users\hacker\PycharmProjects\pythonProject1\ipa\reqs\store.py", line 87, in volumeStoreDownloadProduct resp.failureType + '-' + resp.metrics.dialogId) AttributeError: 'NoneType' object has no attribute 'dialogId' Any idea ?

    opened by damar1st 3
  • Add —write-metadata

    Add —write-metadata

    Add a flag that writes metadata by grabbing it from the App Store html page:

    1. Screenshots for all platforms and reviews in their original format. as (ipa name).screenshot-(number).(format) and a single (ipa name).screenshot-info.json with the original URLs of the screenshots and the platforms their on as well as links to the videos.
    2. Reviews as a (ipa name).reviews.json with the review content, star rating, age, and title. If an app has more than 1000 reviews you need to use the —write-all-reviews to write all of them.
    3. Icon as a (ipa name).icon.(file format)
    4. Description as a (ipa name).description.txt
    5. Version history as a .versionhistory.json with number, date, and developer description with bullets
    6. Privacy information about the app gets written to .privacypolicy.json
    7. Miscellaneous fields like app size, category, developer name, developer ID, ratings without a review, etc go to .info.json .
    opened by upintheairsheep2 0
Owner
I do all sorts of things.
null
A project which aims to protect your privacy using inexpensive hardware and easily modifiable software

Protecting your privacy using an ESP32, an IR sensor and a python script This project, which I personally call the "never-gonna-catch-me-in-the-act-ev

null 8 Oct 10, 2022
Tracking Pipeline helps you to solve the tracking problem more easily

Tracking_Pipeline Tracking_Pipeline helps you to solve the tracking problem more easily I integrate detection algorithms like: Yolov5, Yolov4, YoloX,

VNOpenAI 32 Dec 21, 2022
This application explain how we can easily integrate Deepface framework with Python Django application

deepface_suite This application explain how we can easily integrate Deepface framework with Python Django application install redis cache install requ

Mohamed Naji Aboo 3 Apr 18, 2022
A Python script that creates subtitles of a given length from text paragraphs that can be easily imported into any Video Editing software such as FinalCut Pro for further adjustments.

Text to Subtitles - Python This python file creates subtitles of a given length from text paragraphs that can be easily imported into any Video Editin

Dmytro North 9 Dec 24, 2022
Examples of using f2py to get high-speed Fortran integrated with Python easily

f2py Examples Simple examples of using f2py to get high-speed Fortran integrated with Python easily. These examples are also useful to troubleshoot pr

Michael 35 Aug 21, 2022
null 113 Nov 28, 2022
Easily benchmark PyTorch model FLOPs, latency, throughput, max allocated memory and energy consumption

⏱ pytorch-benchmark Easily benchmark model inference FLOPs, latency, throughput, max allocated memory and energy consumption Install pip install pytor

Lukas Hedegaard 21 Dec 22, 2022
One-line your code easily but still with the fun of doing so!

One-liner-iser One-line your code easily but still with the fun of doing so! Have YOU ever wanted to write one-line Python code, but don't have the sa

null 5 May 4, 2022
Easily pull telemetry data and create beautiful visualizations for analysis.

This repository is a work in progress. Anything and everything is subject to change. Porpo Table of Contents Porpo Table of Contents General Informati

Ryan Dawes 33 Nov 30, 2022
Springer Link Download Module for Python

♞ pupalink A simple Python module to search and download books from SpringerLink. ?? This project is still in an early stage of development. Expect br

Pupa Corp. 18 Nov 21, 2022
This is a simple backtesting framework to help you test your crypto currency trading. It includes a way to download and store historical crypto data and to execute a trading strategy.

You can use this simple crypto backtesting script to ensure your trading strategy is successful Minimal setup required and works well with static TP a

Andrei 154 Sep 12, 2022
Automatically download the cwru data set, and then divide it into training data set and test data set

Automatically download the cwru data set, and then divide it into training data set and test data set.自动下载cwru数据集,然后分训练数据集和测试数据集

null 6 Jun 27, 2022
Python script to download the celebA-HQ dataset from google drive

download-celebA-HQ Python script to download and create the celebA-HQ dataset. WARNING from the author. I believe this script is broken since a few mo

null 133 Dec 21, 2022
Simple API for UCI Machine Learning Dataset Repository (search, download, analyze)

A simple API for working with University of California, Irvine (UCI) Machine Learning (ML) repository Table of Contents Introduction About Page of the

Tirthajyoti Sarkar 223 Dec 5, 2022
Download files from DSpace systems (because for some reason DSpace won't let you)

DSpaceDL A tool for downloading files from DSpace items. For some reason, DSpace systems have a dogshit UI, and Universities absolutely LOOOVE to use

Soumitra Shewale 5 Dec 1, 2022
Download from Onlyfans.com.

OnlySave: Onlyfans downloader Getting Started: Download the setup executable from the latest release. Install and run. Only works on Windows currently

null 4 May 30, 2022
FAST Aiming at the problems of cumbersome steps and slow download speed of GNSS data

FAST Aiming at the problems of cumbersome steps and slow download speed of GNSS data, a relatively complete set of integrated multi-source data download terminal software fast is developed. The software contains most of the data sources required in the process of GNSS scientific research and learning. The way of parallel download greatly improves the efficiency of download.

ChangChuntao 23 Dec 31, 2022
Download & Install mods for your favorit game with a few simple clicks

Husko's SteamWorkshop Downloader ?? IMPORTANT ❗ ?? The Tool is currently being rewritten so updates will be slow and only on the dev branch until it i

Husko 67 Nov 25, 2022