Jump to content

Fetcher - A simple python script wrote to filter appstore results.


1 post in this topic

Recommended Posts

Updated (edited)

Fetcher

Made only Json & Requests

Fetcher is a light weight, python script that also outputs all data to a text file in a formatted manor. I will probably update this once or twice.

Cant post on git because they deleted my main github :/

This color means default or contextual text.

It can be used to

  1. Sort versions from highest to lowest
  2. Search for apps via terms ("Last day on Earth")
  3. Custom entity input ("software,iPadSoftware")
  4. Version sorting (BUGGY, I wouldnt really call this a feature bc of its state but its here anyway)
  5. Search w/ country codes ("US")
  6. Limit results
  7. Search results via Genre ("Games")
  8. Filters any junk data from results (art work, description etc)
  9. Callback support (edit the code as it wasn't built with it in mind)

Might be buggy, not gonna always sort things well. Will try its best <3.

Plans:

  1. Almost 0 Plans for this. Might add more sorting/filters to the script.

Installing requests:

Quote

pip install requests

 

Code:

import json
import os
import time
import requests

DEBUG = False
PRINT_RESPONSE = False # recommeneded as false because lots of data

def filter(data):
    if not isinstance(data, list):
        raise ValueError("Input data should be a list of dictionaries.")
    
    filtered_data = []
    for item in data:
        if isinstance(item, dict):
            # items to filter, copy paste
            filtered_item = {
                "currentVersionReleaseDate": item.get("currentVersionReleaseDate"),
                "primaryGenreName": item.get("primaryGenreName"),
                "bundleId": item.get("bundleId"), # "com.attackgalaxyshooter.galaxyspaceshooter2020"
                "sellerName": item.get("sellerName"),
                "version": item.get("version"),
                "trackName": item.get("trackName"), # "Galaxy War: Space Shooter"
                "kind": item.get("kind"), # software
                "releaseDate": item.get("releaseDate"),
                "collectionViewUrl": item.get("collectionViewUrl"),
                "genres": item.get("genres"),
            }
            if DEBUG: print(json.dumps(filtered_item, indent=4))
            filtered_data.append(filtered_item)
        else:
            print(f"Skipping item, not a dictionary: {item}")
    return filtered_data


def sorter(data, target, high=False):
    try:

        s = sorted(data, key=lambda x: x[target], reverse=high)

        if DEBUG:
            print(json.dumps(s, indent=4))

        return s
    except Exception as err:
        print(f"[!] Error while sorting: {err}")
        exit(1)

def sortGenre(data, target, includeAllMatching = False):
    sorted_genres = [] # store here
    
    for genre in data:
        
        if isinstance(genre, dict):
        
            genre_name = genre.get('primaryGenreName')
            genre_list = genre.get('genres')

            # look for all that match the target
            if includeAllMatching: 
                if genre_name == target or target in genre_list: 
                    sorted_genres.append(genre)
            else:
                # only get the matching primaryGenreName
                if genre_name == target:
                    sorted_genres.append(genre)

    return sorted_genres

def sortVer(data, high=False):
    return sorter(data, 'version', high)

def versortCheck(data):
    shouldVerSort = str(input("Sort version? (y/n): ")).upper()

    if shouldVerSort == "Y" or shouldVerSort == "YES":
            
        sortHigh = str(input("Sort version High? (y/n) (n = low -> high): ")).upper()
            
        if sortHigh == "Y" or sortHigh == "YES":
            return sortVer(data, True)
        elif sortHigh == "N" or sortHigh == "NO":
            return sortVer(data, False)
        else:
            return data
    else:
        return data

def gensortCheck(data, target):
    shouldGenSort = str(input(f"Sort Genre by {target}? (y/n): ")).upper()

    if shouldGenSort == "Y" or shouldGenSort == "YES":
        return sortGenre(data, target)
    else:
        return data # since they dont want to genre sort we will then return the data as it is

def save(data, output):
    
    with open(output, 'a+') as f:
        
        if f.writable:
            f.write(json.dumps(data, indent=4))
            f.close()
        
            if f.closed:
                print(f"[+] File was closed and wrote to {output}")
            else:
                ValueError(f"[!] Issue checking if the file is closed successfully. Please make sure you/the program has sufficent privs.")
        
        else:
            ValueError(f"[!] Cannot write to {output}")

def main():
    try:
        limit = int(input("Limit (Number): ")) or 20
        entity = str(input("Entity to search (software,iPadSoftware): ")) or "software,iPadSoftware" 
        country = str(input("Country Code (US): ")).lower() or "us" # country code (us = america)
        term = str(input("Term: ")) or "terminator"
        targetGenre = str(input("Genre (\"Games\"): ")) or "games"
        
        if limit == 0: print("[!] Enter a value higher than 0"); main()

        # can add this back just do '&callback={callback}' in the url
        # callback = "fetch_with_cb_cb" # easy function parsing from result <3 apple

        output = str(input("Output file (result.txt): ")) or "results.txt"

        url = f"https://itunes.apple.com/search?limit={limit}&entity={entity}&country={country}&term={term}"

        res = requests.get(url)

        if PRINT_RESPONSE:
            print(json.dumps(res.json(), indent=4))

        if res.status_code != 200:
            ValueError(f"[!] Response code: {res.status_code}\nURL: {url}\nCorrect issues and try again.")
        
        if json.dumps(res.json().get('resultCount', int)) == '0':
            ValueError(f"[!] No results. Please correct any issues.\nLimit: {limit}\nEntity: {entity}\nCountry Code (default us): {country}\nSearch term: {term}")
        
        raw = res.json().get('results', []) # gets the results
        
        filtered = filter(raw)

        versorted = versortCheck(filtered) # i did this so i can shorten the code thats in the block.

        # we parse the return from versorted and then use that data
        gensorted = gensortCheck(versorted, targetGenre)
        
        # after we save it
        save(gensorted, output)

    except Exception as e:
        print(f"Uh oh you encountered an error!\n{e}")
        input("Press any key to continue")
        time.sleep(5)
        os.system('clear') # change to your distro/os clear equivilent. cls for win.
        main()

if __name__ == '__main__':
    if DEBUG: input("[!] WARNING YOU ARE USING DEBUG [!]\nPRESS ENTER TO CONTINUE\n")
    main()

Made this for fun. I know you can use the Decrypt IPA store for searching but this could be better due to the filters it gives. All outputs are in a Json string that is indented too for an easier read.

Updated by carpoa
if DEBUG == True -> if DEBUG

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • Design Family Life v0.1.602 [ +7 Cheats ] Currency Max
      Modded/Hacked App: Design Family Life By UGI Studio Cyprus LTD
      Bundle ID: com.ugi.designfamilylife
      App Store Link: https://apps.apple.com/ph/app/design-family-life/id6746701133?uo=4

      🤩 Hack Features

      - Gems

      - Cash

      - Energy

      - ADS Ticket

      - LVL & EXP [ Task ]

      - Rewards [ Gems Cash Energy ADS Ticket ] Linked With LvL

      - Chacter Status [ Fitness Joy +More ] 
      • 8 replies
    • Design Family Life v0.1.602 [ +7 Jailed ] Currency Max
      Modded/Hacked App: Design Family Life By UGI Studio Cyprus LTD
      Bundle ID: com.ugi.designfamilylife
      App Store Link: https://apps.apple.com/ph/app/design-family-life/id6746701133?uo=4

      🤩 Hack Features

      - Gems

      - Cash

      - Energy

      - ADS Ticket

      - LVL & EXP [ Task ]

      - Rewards [ Gems Cash Energy ADS Ticket ] Linked With LvL

      - Chacter Status [ Fitness Joy +More ] 
      • 10 replies
    • Pop Island v1.3.9 [ +1 Cheats ] Coins Max
      Modded/Hacked App: Pop Island By HISTAR INTERACTIVE PTE. LTD.
      Bundle ID: com.hmbdgames.match
      iTunes Store Link: https://apps.apple.com/us/app/pop-island/id6505047210?uo=4


      🤩 Hack Features

      - Coins [ Win Match Disable After Hack ]


      • 31 replies
    • Pop Island v1.3.9 [ +1 Jailed ] Coins Max
      Modded/Hacked App: Pop Island By HISTAR INTERACTIVE PTE. LTD.
      Bundle ID: com.hmbdgames.match
      iTunes Store Link: https://apps.apple.com/us/app/pop-island/id6505047210?uo=4


      🤩 Hack Features

      - Coins [ Win Match Disable After Hack ]


      • 33 replies
    • Match Villains v1.42.0 [ +4 Jailed ] Currency Max
      Modded/Hacked App: Match Villains By Good Job Games Bilisim Yazilim ve Pazarlama AS
      Bundle ID: com.goodjobgames.matchvillains
      iTunes Store Link: https://apps.apple.com/us/app/match-villains/id6479752688?uo=4
       

      🚀 Hack Features

      - Coins
      - Lives
      - Moves Freeze
      - Booster


      🍏 Jailbreak iOS hacks: https://iosgods.com/forum/5-game-cheats-hack-requests/
      🤖 Modded Android APKs: https://iosgods.com/forum/68-android-section/
        • Like
      • 39 replies
    • Match Villains v1.42.0 [ +4 Cheats ] Currency Max
      Modded/Hacked App: Match Villains By Good Job Games Bilisim Yazilim ve Pazarlama AS
      Bundle ID: com.goodjobgames.matchvillains
      iTunes Store Link: https://apps.apple.com/us/app/match-villains/id6479752688?uo=4
       

      🚀 Hack Features

      - Coins
      - Lives
      - Moves Freeze
      - Booster


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/forum/79-no-jailbreak-section/
      🤖 Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      • 35 replies
    • Turret Defense King v1.2.33 [ +9 APK MOD ] Gold Max
      Mod APK Game Name: Turret Defense King By MOBIRIX
      Rooted Device: Not Required.
      Google Play Store Link: https://play.google.com/store/apps/details?id=com.mobirix.tdwt&hl=en

       

      🤩 Hack Features

      - ADS NO [ Rewards Free]
      - Gold [ Revive To Get ]
      - Battle Coins [ Enemy Drop Kill ]
      - Tower Cost [ Earn Battle Coins ]
      - Enemy Max [ Only Stage Mod] Easy Win
      - Wave Max [ Only Stage Mod] Easy Win
      - Tower DMG [ Just Rebuild & Upgrade ]
      - Tower ATK Range
      - Tower Fire Rate

       

      ⬇️ Android Mod APK Download Link


      Hidden Content

      Download Modded APK







       

      📖 Android Installation Instructions

      STEP 1: Download the modded APK file from the link above using your preferred Android browser or download manager.
      STEP 2: Once the download is complete, open your file manager and locate the downloaded .apk file (usually in the Downloads folder).
      STEP 3: Tap the APK file, then select Install. If prompted, enable Install from Unknown Sources in your device settings.
      STEP 3A: If the mod includes an OBB file, extract it if it’s inside an archive. Then move the folder to: /Android/obb/
      STEP 3B: If the mod includes a DATA file, extract it if it’s archived. Then move the folder to: /Android/data/
      STEP 4: Once installed, open the game and toggle your desired cheats & features through the APK mod menu. Enjoy!

       

      NOTE: If you have any questions or issues, read our Frequently Asked Questions topic. If you still need help, post your issue below and we’ll assist you as soon as possible. If the mod works for you, please share your feedback to help other members!

       

      🙌 Credits

      - IK_IK

       

      📷 Cheat Video/Screenshots

      N/A

       

       iOS & iPadOS App Hacks
      If you’re looking for Non-Jailbroken & No Jailbreak required iOS IPA hacks, visit the iOS Game Cheats & Hacks or the iOSGods App for a variety of modded games and apps for non-jailbroken iOS devices.
      • 0 replies
    • Turret Defense King v1.2.33 [ +9 Cheats ] Gold Max
      Modded/Hacked App: Turret Defense King By MOBIRIX
      Bundle ID: com.mobirix.tdwt
      iTunes Store Link: https://apps.apple.com/us/app/turret-defense-king/id6480586157?uo=4


      🚀 Hack Features

      - ADS NO [ Rewards Free]

      - Gold [ Revive To Get ]

      - Battle Coins [ Enemy Drop Kill ]

      - Tower Cost [ Earn Battle Coins ]

      - Enemy Max [ Only Stage Mod] Easy Win

      - Wave Max [ Only Stage Mod] Easy Win

      - Tower DMG [ Just Rebuild & Upgrade ]

      - Tower ATK Range

      - Tower Fire Rate
      • 24 replies
    • Turret Defense King v1.2.33 [ +9 Jailed ] Gold Max
      Modded/Hacked App: Turret Defense King By MOBIRIX
      Bundle ID: com.mobirix.tdwt
      iTunes Store Link: https://apps.apple.com/us/app/turret-defense-king/id6480586157?uo=4


      🚀 Hack Features

      - ADS NO [ Rewards Free]

      - Gold [ Revive To Get ]

      - Battle Coins [ Enemy Drop Kill ]

      - Tower Cost [ Earn Battle Coins ]

      - Enemy Max [ Only Stage Mod] Easy Win

      - Wave Max [ Only Stage Mod] Easy Win

      - Tower DMG [ Just Rebuild & Upgrade ]

      - Tower ATK Range

      - Tower Fire Rate
      • 27 replies
    • Transcender : Idle RPG v1.9.6 +3 Cheats
      Mod APK Game Name: Transcender : Idle RPG By Rookie Project Co., Ltd.
      Rooted Device: Not Required.
      Google Play Store Link: https://play.google.com/store/apps/details?id=com.playgames.transcender

       

      🤩 Hack Features

      - Damage Multiplier
      - Never Die
      - Guest Login

       

      ⬇️ Android Mod APK Download Link


      Hidden Content

      Download Modded APK







       

      📖 Android Installation Instructions

      STEP 1: Download the modded APK file from the link above using your preferred Android browser or download manager.
      STEP 2: Once the download is complete, open your file manager and locate the downloaded .apk file (usually in the Downloads folder).
      STEP 3: Tap the APK file, then select Install. If prompted, enable Install from Unknown Sources in your device settings.
      STEP 3A: If the mod includes an OBB file, extract it if it’s inside an archive. Then move the folder to: /Android/obb/
      STEP 3B: If the mod includes a DATA file, extract it if it’s archived. Then move the folder to: /Android/data/
      STEP 4: Once installed, open the game and toggle your desired cheats & features through the APK mod menu. Enjoy!

       

      NOTE: If you have any questions or issues, read our Frequently Asked Questions topic. If you still need help, post your issue below and we’ll assist you as soon as possible. If the mod works for you, please share your feedback to help other members!

       

      🙌 Credits

      - AlyssaX64

       

      📷 Cheat Video/Screenshots

      N/A

       

       iOS & iPadOS App Hacks
      If you’re looking for Non-Jailbroken & No Jailbreak required iOS IPA hacks, visit the iOS Game Cheats & Hacks or the iOSGods App for a variety of modded games and apps for non-jailbroken iOS devices.
      • 1 reply
    • Island War Raid V6.0.0 [ +2 Cheats ] Win Fight
      Modded/Hacked App: Island War: Raid By SamShui Corporation
      Bundle ID: com.addictive.strategy.island.clash
      iTunes Store Link: https://apps.apple.com/us/app/island-war-raid/id1542454536?uo=4

      Hack Features:
      - Die Anyone [ Red & Blue ] Win Fight
      - Destroy Building [ Win Fight ] 



      Note:- Works Only [ Arena ]
      • 42 replies
    • Island War Raid V6.0.0 [ +2 Jailed ] Win Fight
      Modded/Hacked App: Island War: Raid By SamShui Corporation
      Bundle ID: com.addictive.strategy.island.clash
      iTunes Store Link: https://apps.apple.com/us/app/island-war-raid/id1542454536?uo=4


      Hack Features:

      - Die Anyone [ Red & Blue ] Win Fight
      - Destroy Building [ Win Fight ] 



      Note:- Works Only [ Arena ]
        • Like
      • 27 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines