NyaMisty / ipatool-py

IPATool-py: download ipa easily
https://drafts.misty.moe/ipatool-py-5848aa887aff4bc49fad6dc495a6578f
444 stars 112 forks source link

Can I purchase a paid app? #27

Closed miticollo closed 1 year ago

miticollo commented 1 year ago

I tried

python3 main.py lookup -b ch.threema.iapp -c IT download --purchase -e email@gmail.com -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@gmail.com -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}} 
miticollo commented 1 year ago

Solved.

Using iTunes 12.6.5.3 you can buy an new paid app. From now on you can downgrade it because it appears in your "Purchase History".